static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            applicationListener.WriteLine($"Starting up: {DateTime.Now}");
            applicationListener.Flush();

            Application.ApplicationExit += Application_ApplicationExit;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            WatchOperations.Instance.TraceListener = applicationListener;
            WatchOperations.Instance.EnableWatch();


            //         using (var processIcon = new ProcessIcon())
            //{
            //	processIcon.Display();
            //	Application.Run();
            //}

            _processIcon = new ProcessIcon();
            _processIcon.Display();
            Application.Run();
        }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Show the system tray icon.
            using (ProcessIcon pi = new ProcessIcon())
            {
                pi.Display();

                //start to work 4 hours
                Timers.CheckPassExp();

                //check for message every x amount of time
                Timers.ScanMsgConfig();

                //configure timer for info
                Timers.SetConsoleToPop();

                //write printer files
                Timers.PrinterTextOutput();

                //initiate loop at startup
                PasswordCalculation.GetAllInformation();

                // Make sure the application runs!
                Application.Run();
            }
        }
Exemple #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var setting = ConfigurationManager.AppSettings["TestMode"];

            if (!String.IsNullOrEmpty(setting) && Convert.ToBoolean(setting) == true)
            {
                // Show the system tray icon.
                using (PolicyForm pf = new PolicyForm())
                {
                    pf.Show();

                    // Make sure the application runs!
                    Application.Run();
                }
            }
            else
            {
                // Show the system tray icon.
                using (ProcessIcon pi = new ProcessIcon())
                {
                    pi.Display();

                    // Make sure the application runs!
                    Application.Run();
                }
            }
        }
Exemple #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var window = new Window();

            Boolean start = true;

            Process[] instances = Process.GetProcessesByName("nzbhydra");
            if (instances.Length != 0)
            {
                DialogResult result = MessageBox.Show("You appear to already have an instance of NZB Hydra running. Do you want to shut that down and start a new one? If not I'll quit.", "NZB Hydra instance found", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    foreach (Process p in instances)
                    {
                        p.Kill();
                    }
                }
                else
                {
                    start = false;
                }
            }

            if (start)
            {
                // Show the system tray icon.
                using (ProcessIcon pi = new ProcessIcon(window)) {
                    pi.Display();
                    Application.Run(window);
                }
            }
        }
Exemple #5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Show the system tray icon.
            using (ProcessIcon pi = new ProcessIcon())
            {
                pi.Display();

                // Make sure the application runs!
                Application.Run();
            }
        }
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                string accountStatus = string.Empty;

                #region Added by Vandna on 02-june-2018 for Call live UserInfo and Show Reminder Types //19-May-2018
                //added by Vandna on 06-june-2018 for autoupgarde plugin on new version
                //new System.Threading.Tasks.Task(() =>
                //{

                DentalPlugin.Authentic _objAuth = new DentalPlugin.Authentic();
                _objDBUI = _objAuth.checkAuthenticity(DentalPlugin.GeneralUtilities.getUsername()).Result;

                accountStatus = _objDBUI.AccountStatus.ToLower();
                // Auto Upgrade on new version added by vandna on 30 Aug 2017 and commented on 18-Sept-2017
                UpgradeLatestVersion objUpgrade = new UpgradeLatestVersion(_objAuth.AuID, _objAuth.AuUID, _objDBUI.ODVersion);
                objUpgrade.Auto_UpgradeLatestVersion();
                ///if (!_objDBUI.isAuthentic)
                if (accountStatus.Equals("new"))
                {
                    NewUser objnew = new NewUser();
                    objnew.ShowDialog();
                }
                //else if (accountStatus.Equals("pending"))
                //{
                //    MessageBox.Show("Your Registration is pending Approval! If you have any queries you can contact us at [email protected] / phone: +1-949-542-6773.", "ConvergedComm", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //    Application.Exit();
                //}
                //else if (accountStatus.Equals("expired"))
                //{
                //    MessageBox.Show("Your Subscription at patientXpress has either expired or is outside the active period. Please contact us at [email protected] / phone: +1-949-542-6773..", "ConvergedComm", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //    Application.Exit();
                //}
                //else if (accountStatus.Equals("disable"))
                //{
                //    MessageBox.Show("Your Account has been disabled. Please contact [email protected] / phone: +1-949-542-6773.", "ConvergedComm", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //    Application.Exit();
                //}
                else
                {
                    WindowsIdentity  identity  = WindowsIdentity.GetCurrent();
                    WindowsPrincipal principal = new WindowsPrincipal(identity);
                    bool             isAdmin   = principal.IsInRole(WindowsBuiltInRole.Administrator);
                    if (!isAdmin)
                    {
                        HRDsqData.Library.WriteErrorLog("Try to run as admin , HRDsq Tray.");
                        ProcessStartInfo startInfo = new ProcessStartInfo();
                        startInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + "HRDSQTray.exe";
                        startInfo.Verb     = "runas";
                        Process.Start(startInfo);
                        Application.Exit();
                    }
                    else
                    {
                        //  CreateStartupShortcut
                        CreateStartupShortcut();

                        // Create Reports folder in installtion directory if not exist.
                        if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\Reports"))
                        {
                            Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "\\Reports");
                        }

                        // Show the system tray icon.
                        using (ProcessIcon pi = new ProcessIcon())
                        {
                            pi.Display();

                            // Make sure the application runs!

                            Application.Run();

                            SetRecoveryOptions("HRDSQPlugin");
                        }
                        HRDsqData.Library.WriteErrorLog("Successfully run HRDsq Tray.");
                    }
                }
                // }).Start();
                #endregion
            }
            catch (Exception ex)
            {
                HRDsqData.Library.WriteErrorLog("Exception On Tray Load - " + ex);
            }
        }