Esempio n. 1
0
        private static void Main(string[] args)
        {
            var pipeInterOp   = new ArgsPipeInterOp();
            var instanceCount = int.MaxValue;

            if (!CommandLineParser.NoInstanceCheck(args))
            {
                instanceCount = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length;
            }

            if (instanceCount > 1)
            {
                pipeInterOp.SendArgs(args);
                return;
            }

            Util.SetPriorityProcessAndThreads(Process.GetCurrentProcess().ProcessName, ProcessPriorityClass.Idle, ThreadPriorityLevel.Lowest);

            _controller  = new RgbFusion();
            _transaction = new Transaction(_controller);
            Util.MinimizeMemory();
            pipeInterOp.StartArgsPipeServer();
            Util.MinimizeMemory();
            _controller.Init(false);
            pipeInterOp.SendArgs(args);
            SystemEvents.SessionEnding += SystemEvents_SessionEnding;
            _controller.StartListening();
        }