private static int Main(string[] args) { try { GlobalSettings.Clear(); GlobalSettings.Load(args[1]); // Console.WriteLine(args[0]); // Console.WriteLine(args[1]); string sessionid = args[2]; using (TraceLogContext context = new TraceLogContext()) { var activity = ActivityExecution.SelectBySession(context, sessionid); var activityCount = activity.Count(x => x.ActivityType.Equals("ScanToFolder")); if (activityCount > 0) { string[] files = Directory.GetFiles(args[0], sessionid, SearchOption.AllDirectories); if (activityCount <= files.Count()) { return(0); } } } } catch (Exception ex) { Console.WriteLine(ex.Message); //TraceFactory.Logger.Error(ex.Message); } return(-1); }
public void RefreshSettings(ILogger _logger) { GlobalSettings.Clear(); GlobalSettings = ConfigsManager.GetAllConfigs(); // TODO: Don't log configs every iteration _logger.LogInformation($"{PrintConfigs()}"); }
public void GetDefault() { GlobalSettings.Clear(); var cut = GlobalSettings.Get <SimpleGlobalSetting>(); Assert.AreEqual(cut.Information, SimpleGlobalSetting.DefaultInformation); }
private static void LoadGlobalSettings(string database) { // Load or reload settings from the selected database GlobalSettings.Clear(); GlobalSettings.Load(database); SystemDatabase = database; STFDispatcherManager.DisconnectFromDispatcher(false); }
public void TestClear() { var cut = GlobalSettings.Get <SimpleGlobalSetting>(); cut.Information = "My information"; cut.Save(); GlobalSettings.Clear(); var read = GlobalSettings.Get <SimpleGlobalSetting>(); Assert.AreNotEqual(cut.Information, read.Information); }
public void GetUserAndClearGlobal() { var cut = UserSettings.Get <SimpleUserSetting>(); cut.Name = "Some Name"; cut.Save(); GlobalSettings.Clear(); var read = UserSettings.Get <SimpleUserSetting>(); Assert.AreEqual(cut.Name, read.Name); }
/// <summary> /// Pushes the settings portion of this manifest to the <see cref="GlobalSettings"/>. /// </summary> public void PushToGlobalSettings() { GlobalSettings.Clear(); foreach (string item in Settings.Keys) { GlobalSettings.Items.Add(item, Settings[item]); } foreach (string service in WcfHosts.Keys) { GlobalSettings.WcfHosts.Add(service, WcfHosts[service]); } PluginFactory.PluginRelativePath = GlobalSettings.Items[Setting.PluginRelativeLocation]; PluginFactory.Register(PluginDefinitions); }
public void LoadLaunchSettings() { if (!File.Exists(launchSettingsJsonPath)) { CreateAndAddDefaultLaunchSettings(); return; } var launchSettingsJson = TryParse(); GlobalSettings.Clear(); foreach (var token in launchSettingsJson) { if (token.Key == "profiles") { ProfilesObject = token.Value as JObject; continue; } GlobalSettings.Add(token.Key, token.Value); } }
public void LoadLaunchSettings() { if (!File.Exists(LaunchSettingsJsonPath)) { CreateAndAddDefaultLaunchSettings(); return; } var launchSettingsJson = TryParse(); GlobalSettings.Clear(); foreach (var token in launchSettingsJson) { if (token.Key == "profiles") { ProfilesObject = token.Value as JObject; continue; } GlobalSettings.Add(token.Key, token.Value); } Profiles = new ConcurrentDictionary <string, LaunchProfileData> (LaunchProfileData.DeserializeProfiles(ProfilesObject)); }
public void RefreshSettings() { GlobalSettings.Clear(); GlobalSettings = ConfigsManager.GetAllConfigs(); //System.Console.WriteLine($"{PrintConfigs()}"); }