Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            this.singleInstanceApp = new SingleInstanceApplication();

            if (singleInstanceApp.IsMasterInstanceRunning())
            {
                singleInstanceApp.RunAsSlave(e.Args);
                this.Shutdown();
                return;
            }

            singleInstanceApp.RunAsMaster();
            base.OnStartup(e);
        }