Exemplo n.º 1
0
 public void RegenStarters()
 {
     if (starters == null)
     {
         starters = new Dictionary <string, ProgramStarter>();
     }
     foreach (var t in CecTypes)
     {
         ProgramStarter ps = new ProgramStarter(t);
         var            pb = ps.Start <ProgramBase>();
         starters[pb.ShortName] = ps;
     }
 }
Exemplo n.º 2
0
        public static void OpenNuitrackApp()
        {
#if !NUITRACK_PORTABLE
            string nuitrackHomePath = Environment.GetEnvironmentVariable("NUITRACK_HOME");
            string workingDir       = Path.Combine(nuitrackHomePath, "activation_tool");
            if (nuitrackHomePath == null)
            {
                return;
            }
#else
            string workingDir = Path.Combine(Application.dataPath, "NuitrackSDK", "Plugins", "x86_64");
#endif
            string path = Path.Combine(workingDir, "Nuitrack.exe");
            ProgramStarter.Run(path, workingDir, true);
        }
Exemplo n.º 3
0
 public void Execute(IJobContext context, Operation operation)
 {
     if (context.Phase == JobPhase.OnOperationSurfaced)
     {
         string[] programs = _settings.GetSetting(SettingKeys.ExternalTool).GetStringArray();
         foreach (string program in programs)
         {
             try
             {
                 Task.Factory.StartNew(() => ProgramStarter.StartProgramTask(program, this));
             }
             catch (Exception ex)
             {
                 Logger.Instance.LogFormat(LogType.Error, this, CreatingProgramFailed, program);
                 Logger.Instance.LogException(this, ex);
             }
         }
     }
 }
Exemplo n.º 4
0
        void IUIJob.OnNewOperation(IOperationViewer operationViewer, Operation operation)
        {
            string[] programs = new string[0];
            using (var service = ServiceFactory.GetCallbackServiceWrapper <ISettingsService>(new SettingsServiceCallback()))
            {
                programs = service.Instance.GetSetting(SettingKeys.ExternalTool).GetStringArray();
            }

            foreach (string program in programs)
            {
                try
                {
                    Task.Factory.StartNew(() => ProgramStarter.StartProgramTask(program, this));
                }
                catch (Exception ex)
                {
                    Logger.Instance.LogFormat(LogType.Error, this, Resources.CreatingProgramFailed, program);
                    Logger.Instance.LogException(this, ex);
                }
            }
        }