Ejemplo n.º 1
0
 private void LogicInit()
 {
     if (wtch == null)
     {
         wtch = new WMIProcessWatcher(TeraProcessName);
     }
     else
     {
         wtch.RemoveWatchCreateProcessEvent();
     }
     if (((!string.IsNullOrWhiteSpace(ShinraMeterConfiguration.ShinraPath)) && (ShinraMeterConfiguration.ShinraMeterRunWithTera)) ||
         ((!string.IsNullOrWhiteSpace(TccConfiguration.TccPath)) && (TccConfiguration.TccRunWithTera)))
     {
         CleanUpTaskSheduler();
         AddWorksIntoTaskSheduler();
         try
         {
             wtch.AddWatchCreateProcessEvent(processesStartBody);
         }
         catch (Exception ex)
         {
             log.Error(ex, "LogicInit -> AddWatchCreateProcessEvent");
         }
     }
     else
     {
         CleanUpTaskSheduler();
     }
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     wtch.Dispose();
     wtch = null;
 }