Esempio n. 1
0
    private static void Main()
    {
      Log.Info("HCWHelper: Starting up");
      Thread.CurrentThread.Priority = ThreadPriority.Highest;

      if ((Process.GetProcessesByName("HcwHelper").Length == 1) &&
          ((Process.GetProcessesByName("MediaPortal").Length > 0) ||
           Process.GetProcessesByName("Configuration").Length > 0 ||
           (Process.GetProcessesByName("MediaPortal.vshost").Length > 0)))
      {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
        Form hcwHelper = new HcwHelper();
        try
        {
          hcwHelper.ShowDialog();
        }
        catch (ObjectDisposedException) {}
      }
      else if (Process.GetProcessesByName("HcwHelper").Length != 1)
      {
        Log.Info("HCWHelper: HCWHelper already running - exiting");
      }
      else
      {
        Log.Info("HCWHelper: MediaPortal not running - exiting");
      }
      Log.Info("HCWHelper: Shutting down");
    }
Esempio n. 2
0
        private static void Main()
        {
            Log.Info("HCWHelper: Starting up");
            Thread.CurrentThread.Priority = ThreadPriority.Highest;

            if ((Process.GetProcessesByName("HcwHelper").Length == 1) &&
                ((Process.GetProcessesByName("MediaPortal").Length > 0) ||
                 Process.GetProcessesByName("Configuration").Length > 0 ||
                 (Process.GetProcessesByName("MediaPortal.vshost").Length > 0)))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
                Form hcwHelper = new HcwHelper();
                try
                {
                    hcwHelper.ShowDialog();
                }
                catch (ObjectDisposedException) {}
            }
            else if (Process.GetProcessesByName("HcwHelper").Length != 1)
            {
                Log.Info("HCWHelper: HCWHelper already running - exiting");
            }
            else
            {
                Log.Info("HCWHelper: MediaPortal not running - exiting");
            }
            Log.Info("HCWHelper: Shutting down");
        }