Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (Array.Find(args,
                           delegate(string arg)
            {
                string s = arg.ToLowerInvariant();
                return(s == "-regapp" || s == "/regapp");
            }
                           ) != default(string))
            {
                HandleRegApp();
                return;
            }
            else if (Array.Find(args,
                                delegate(string arg)
            {
                string s = arg.ToLowerInvariant();
                return(s == "-unregapp" || s == "/unregapp");
            }
                                ) != default(string))
            {
                HandleUnRegApp();
                return;
            }

            SingleInstance si = SingleInstance.CreateSingleInstance(guid);

            si.ArgsRecieved += new ArgsHandler(OnNewCommandLineArgs);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            si.Run(typeof(MainForm));
        }