Exemplo n.º 1
0
        public static void Run(Form form, StartupNextInstanceEventHandler startupHandler)
        {
            OneInstanceApp oneInstanceApp =
                new OneInstanceApp();

            oneInstanceApp.MainForm             = form;
            oneInstanceApp.StartupNextInstance += startupHandler;
            oneInstanceApp.Run(Environment.GetCommandLineArgs());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Un4seen.Bass.BassNet.Registration("*****@*****.**", "2X22297242238");
            switch (args.Length)
            {
            case 1:
                if (args[0].ToLower().Equals("radio"))
                {
                    OneInstanceApp.Run(new Form2(), StartupNextInstanceHandler);
                }
                else if (Directory.Exists(args[0]))
                {
                    OneInstanceApp.Run(new Form1(args[0]), StartupNextInstanceHandler);
                }
                else if (File.Exists(args[0]))
                {
                    OneInstanceApp.Run(new Form1(args[0], true), StartupNextInstanceHandler);
                }
                else
                {
                    OneInstanceApp.Run(new Form1(), StartupNextInstanceHandler);
                }
                break;

            case 2:
                if (args[0].ToLower().Equals("radio"))
                {
                    if (Directory.Exists(args[1]))
                    {
                        OneInstanceApp.Run(new Form2(args[1]), StartupNextInstanceHandler);
                    }
                    else if (File.Exists(args[1]))
                    {
                        OneInstanceApp.Run(new Form2(args[1], true), StartupNextInstanceHandler);
                    }
                    else
                    {
                        OneInstanceApp.Run(new Form2(), StartupNextInstanceHandler);
                    }
                }
                else
                {
                    OneInstanceApp.Run(new Form1(), StartupNextInstanceHandler);
                }
                break;

            default:
                OneInstanceApp.Run(new Form1(), StartupNextInstanceHandler);
                break;
            }
        }