Exemple #1
0
        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);
        }
Exemple #2
0
 public void RefreshSettings(ILogger _logger)
 {
     GlobalSettings.Clear();
     GlobalSettings = ConfigsManager.GetAllConfigs();
     // TODO: Don't log configs every iteration
     _logger.LogInformation($"{PrintConfigs()}");
 }
Exemple #3
0
        public void GetDefault()
        {
            GlobalSettings.Clear();

            var cut = GlobalSettings.Get <SimpleGlobalSetting>();

            Assert.AreEqual(cut.Information, SimpleGlobalSetting.DefaultInformation);
        }
Exemple #4
0
        private static void LoadGlobalSettings(string database)
        {
            // Load or reload settings from the selected database
            GlobalSettings.Clear();
            GlobalSettings.Load(database);
            SystemDatabase = database;

            STFDispatcherManager.DisconnectFromDispatcher(false);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        /// <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);
        }
Exemple #8
0
        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);
            }
        }
Exemple #9
0
        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));
        }
Exemple #10
0
 public void RefreshSettings()
 {
     GlobalSettings.Clear();
     GlobalSettings = ConfigsManager.GetAllConfigs();
     //System.Console.WriteLine($"{PrintConfigs()}");
 }