예제 #1
0
        public static void startPipeServer()
        {
            PipeManager = new NamedPipeManager("OSGameLauncher");
            PipeManager.StartServer();

            PipeManager.ReceiveString += PipeManager_OpenRequest;
        }
예제 #2
0
        void App_Startup(object sender, StartupEventArgs e)
        {
            Console.WriteLine("Checking mutex");
            bool createdNew;

            mutex = new Mutex(true, "OSGameLauncher_8ec3a574-c889-4ad8-a3a1-2b4cd6fd9b7d", out createdNew);
            if (!createdNew)
            {
                Console.WriteLine("Mutex already exists");
                mutex = null;
                var manager = new NamedPipeManager("OSGameLauncher");
                manager.Write("CUSTOM_ACTION::SET_MAIN_WND_FOCUS");
                var j_sta = JsonConvert.SerializeObject(e.Args);
                manager.Write("STARTUP_ARGS::" + j_sta);
                Application.Current.Shutdown(0);
                return;
            }
            else
            {
                startupArgs = new List <string>(Environment.GetCommandLineArgs());
            }
        }