Exemplo n.º 1
0
        protected override void OnStop()
        {
            Logger.LogInfo("Service preparing to stop ...");

            try
            {
                StopServiceHelper();
                Logger.LogInfo("Service stopped with success.");
            }
            catch (Exception ex)
            {
                Logger.LogInfo("Service failed to stop correctly. {0}", ex.Message);
            }

            LoggedApplication.Stop();
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoggedApplication.Start("OPMedia.RemoteControlEmulator");

            try
            {
                Application.Run(new MainForm());
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }

            LoggedApplication.Stop();
        }
Exemplo n.º 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                LoggedApplication.Start("GuiTester");

                //AppConfig.AllowRealtimeGUISetup = false;
                Translator.SetInterfaceLanguage(AppConfig.LanguageID);


                Application.Run(new MainForm());
            }
            finally
            {
                LoggedApplication.Stop();
            }
        }
Exemplo n.º 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                Translator.SetInterfaceLanguage(AppConfig.LanguageID);

                Translator.RegisterTranslationAssembly(typeof(MainForm).Assembly);
                Translator.RegisterTranslationAssembly(typeof(SerialDeviceCfgDlg).Assembly);
                Translator.RegisterTranslationAssembly(typeof(MediaPlayer).Assembly);

                LoggedApplication.Start(ProTONEConstants.RCCManagerName);

                if (!AppConfig.CurrentUserIsAdministrator)
                {
                    MessageDisplay.Show(Translator.Translate("TXT_ADMIN_RIGHTS_REQUIRED"),
                                        Translator.Translate("TXT_CAUTION"), MessageBoxIcon.Exclamation);

                    Logger.LogInfo("RCC Manager started with non-admin rights. Exiting.");

                    return;
                }

                ServiceControl.StopService();

                mainFrm = new MainForm();
                Application.Run(mainFrm);
                mainFrm.Dispose();
            }
            catch (Exception ex)
            {
                ErrorDispatcher.DispatchFatalError(ex);
            }
            finally
            {
                LoggedApplication.Stop();
                ServiceControl.StartService();
            }
        }
        protected override void OnStop()
        {
            Logger.LogInfo("Service preparing to stop ...");

            TicToc ticToc = new TicToc("Persistence.Service.OnStop", 1);

            try
            {
                ticToc.Tic();

                StopServiceHelper();
                Logger.LogInfo("Service stopped with success.");
            }
            catch (Exception ex)
            {
                Logger.LogInfo("Service failed to stop correctly. {0}", ex.Message);
            }
            finally
            {
                ticToc.Toc();
            }

            LoggedApplication.Stop();
        }