default source apikey
This commit is contained in:
@ -86,14 +86,14 @@ namespace isn
|
||||
{
|
||||
// Une suppression
|
||||
Settings.Sources.Remove(source);
|
||||
if (Program.Settings.DefaultSource==source) Settings.DefaultSource = null;
|
||||
if (Settings.DefaultSource == source) Settings.DefaultSource = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Une mise À jour
|
||||
string ptd = Protector.Protect(apiKey);
|
||||
Settings.Sources[source].ApiKey = ptd;
|
||||
if (Program.Settings.DefaultSource==null) Settings.DefaultSource = source;
|
||||
if (Settings.DefaultSource == null) Settings.DefaultSource = source;
|
||||
}
|
||||
}
|
||||
else if (apiKey != null)
|
||||
|
@ -25,7 +25,11 @@ namespace isn
|
||||
{
|
||||
var wrqueryHandler = new UploadFilesToServerUsingWebRequest();
|
||||
// await wrqueryHandler.UploadFilesToServerAsync(report, new Uri(source), fi, apikey);
|
||||
if (source == null) source = Program.Settings.DefaultSource;
|
||||
if (source == null)
|
||||
{
|
||||
source = Program.Settings.DefaultSource;
|
||||
apikey = Program.Settings.Sources[source].ApiKey;
|
||||
}
|
||||
if (Program.Settings.Sources.ContainsKey(source))
|
||||
if (apikey is null) apikey = Program.Protector.UnProtect(Program.Settings.Sources[source].ApiKey);
|
||||
wrqueryHandler.UploadFilesToServer(report, new Uri(source), fi, apikey);
|
||||
|
@ -7,12 +7,13 @@ namespace isn
|
||||
public string ApiKey { get; set; }
|
||||
public string Alias { get; set; }
|
||||
}
|
||||
|
||||
public class Settings
|
||||
{
|
||||
public string DataProtectionTitle {get; set; }
|
||||
public Dictionary<string, SourceSettings> Sources {get; set; }
|
||||
public Dictionary<string, SourceSettings> Sources { get; set; }
|
||||
|
||||
public bool AutoUpdateApiKey { get; set; } = false;
|
||||
public string DefaultSource { get; set; }
|
||||
public string DefaultSource { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user