Exemple #1
0
 void notifyIcon_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         MusicAlarm.GUI.MainForm form = new GUI.MainForm();
         form.Show();
     }
 }
        public static void StartApp(bool block, string[] args)
        {
            try
            {
                bool hideOnLoad     = false;
                bool verboseLogging = false;

                foreach (string arg in args)
                {
                    string lowerArg = arg.ToLower();
                    if (lowerArg == "/hide")
                    {
                        hideOnLoad = true;
                    }
                    else if (lowerArg == "/verbose")
                    {
                        verboseLogging = true;
                    }
                }

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                GUI.MainForm m = new GUI.MainForm(hideOnLoad);
                Config.CreateInstance();
                PWLib.UsbDrive.UsbDriveList.CreateInstance(m);

                m.ControlSwitcher.SwitchUserControl(FormControlType.Welcome, FormControlSwitchType.Start);

                Log.Init(verboseLogging);
                Log.WriteLine(LogType.TextLog, "******************* Starting application *******************");

                m.StartSpineThread();

                if (block)
                {
                    Application.Run(m);
                }
                else
                {
                    m.Show();
                }
            }
            catch (System.Exception ex)
            {
                Log.WriteException("Fatal exception caught", ex);
            }
        }
        public static void StartApp( bool block, string[] args )
        {
            try
            {
                bool hideOnLoad = false;
                bool verboseLogging = false;

                foreach ( string arg in args )
                {
                    string lowerArg = arg.ToLower();
                    if ( lowerArg == "/hide" )
                        hideOnLoad = true;
                    else if ( lowerArg == "/verbose" )
                        verboseLogging = true;
                }

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault( false );

                GUI.MainForm m = new GUI.MainForm( hideOnLoad );
                Config.CreateInstance();
                PWLib.UsbDrive.UsbDriveList.CreateInstance( m );

                m.ControlSwitcher.SwitchUserControl( FormControlType.Welcome, FormControlSwitchType.Start );

                Log.Init( verboseLogging );
                Log.WriteLine( LogType.TextLog, "******************* Starting application *******************" );

                m.StartSpineThread();

                if ( block )
                    Application.Run( m );
                else
                    m.Show();
            }
            catch ( System.Exception ex )
            {
                Log.WriteException( "Fatal exception caught", ex );
            }
        }