Esempio n. 1
0
        private void SetWatcher()
        {
            if (ConfigPath == null)
            {
                ConfigDir  = ThereIsConstants.Path.Here;
                ConfigPath = ConfigDir + Config_File_Name;
            }
            if (!File.Exists(ConfigPath.GetValue()))
            {
                var _f = File.Create(ConfigPath.GetValue());
                _f.Dispose();
            }
            File.WriteAllText(ConfigPath.GetValue(), DEFAULT_CONFIG_TEXT);
#if __LINUX__
            WatcherWorker ??= new Trigger();
            WatcherWorker.Tick += Watcher_Worker;
            WatcherWorker.SetInterval(WORKER_INTERVAL);
            WatcherWorker.Start();
#elif __WINDOWS__
            // create a new worker and start it up.
            // ReSharper disable once RedundantArgumentDefaultValue
            WatcherWorker = new Worker(Watcher_Worker, DEFAULT_Z_BASE);
            WatcherWorker.Start();
#endif
        }
Esempio n. 2
0
 private void SetWatcher()
 {
     if (ConfigPath == null)
     {
         ConfigDir  = Directory.GetCurrentDirectory();
         ConfigPath = ConfigDir + ThereIsConstants.Path.DoubleSlash
                      + Config_File_Name;
     }
     if (!File.Exists(ConfigPath.GetValue()))
     {
         var _f = File.Create(ConfigPath.GetValue());
         _f.Dispose();
     }
     File.WriteAllText(ConfigPath.GetValue(), DEFAULT_CONFIG_TEXT);
     if (IsWindows)
     {
         // create a new worker and start it up.
         // ReSharper disable once RedundantArgumentDefaultValue
         WatcherWorker = new Worker(Watcher_Worker, DEFAULT_Z_BASE);
         WatcherWorker.Start();
     }
 }