Example #1
0
        public static void Main()
        {
            // Setup derived settings class
            Settings.Initialise();
            String appName = "OptikeyPro";

            Action runApp = () =>
            {
                splashScreen = new SplashScreen("/Resources/Icons/OptikeyProSplash.png");
                splashScreen.Show(false);

                var application = new App();
                application.InitializeComponent();
                application.Run();
            };

            if (Settings.Default.AllowMultipleInstances)
            {
                runApp();
            }
            else
            {
                using (_manager = SingleInstanceManager.Initialize(
                           new SingleInstanceManagerSetup(appName)))
                {
                    runApp();
                }
            }
        }
 static void Main()
 {
     using (SingleInstanceManager manager = SingleInstanceManager.Initialize(GetSingleInstanceManagerSetup()))
     {
         App app = new App();
         app.InitializeComponent();
         app.Run();
     }
 }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MainForm mainForm = new MainForm();

            using (SingleInstanceManager manager = SingleInstanceManager.Initialize(GetSingleInstanceManagerSetup(mainForm)))
            {
                Application.Run(mainForm);
            }
        }
Example #4
0
        public static void Main()
        {
            using (_manager = SingleInstanceManager.Initialize(GetSingleInstanceManagerSetup()))
            {
                splashScreen = new SplashScreen("/Resources/Icons/OptikeySymbolSplash.png");
                splashScreen.Show(false);

                var application = new App();
                application.InitializeComponent();
                application.Run();
            }
        }
Example #5
0
 static void Main()
 {
     try
     {
         using (SingleInstanceManager manager = SingleInstanceManager.Initialize(GetSingleInstanceManagerSetup()))
         {
             App app = new App();
             app.InitializeComponent();
             app.Run();
         }
     }
     catch (ApplicationInstanceAlreadyExistsException)
     {
     }
 }