src/TestApplications/WinFormsTestApp/Program.cs
/// <summary>
/// The main entry point for the application.
/// </summary>
The main entry point for the application.
The main entry point for the application .
[STAThread]
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var forms = new Dictionary<string, Form>
                                 {
                                     {"NoTitleBar", GetFormWithNoTitleBar()},
                                     {"PropertyGrid", new FormWithPropertyGrid()},
                                     {"LargeTree", new FormContainingLargeTree()},
                                     {"ReverseTab", new TabControlsWithSpecialProperties()},
                                     {"ListView", new ListViewScenarios()},
                                 };
            if (Environment.CommandLine.Contains("splash"))
            {
                var screen = new SplashScreen();
                screen.Show();
                MessageBox.Show("Bar", "Foo");
                screen.Close();
                return;
            }
            try
            {
                KeyValuePair<string, Form> keyValuePair = forms.First(pair => Environment.CommandLine.Contains(pair.Key));
                Application.Run(keyValuePair.Value);
                return;
            }
            catch (InvalidOperationException)
            {
            }
            var form = new Form1(Environment.CommandLine.Contains("ModalAtClose"));
            if (Environment.CommandLine.Contains("ampersand"))
                form.Text = "Form&1";
            if (Environment.CommandLine.Contains("notitle"))
                form.FormBorderStyle = FormBorderStyle.None;
            if (Environment.CommandLine.Contains("notableheader"))
                form.NoTableHeader();
            Application.Run(form);
        }
[ STAThread ] public static void Main ( ) { Application . EnableVisualStyles ( ) ; Application . SetCompatibleTextRenderingDefault ( false ) ; var forms = new Dictionary < string , Form > { { " " , GetFormWithNoTitleBar ( ) } , { " " , new FormWithPropertyGrid ( ) } , { " " , new FormContainingLargeTree ( ) } , { " " , new TabControlsWithSpecialProperties ( ) } , { " " , new ListViewScenarios ( ) } , } ; if ( Environment . CommandLine . Contains ( " " ) ) { var screen = new SplashScreen ( ) ; screen . Show ( ) ; MessageBox . Show ( " " , " " ) ; screen . Close ( ) ; return ; } try { KeyValuePair < string , Form > keyValuePair = forms . First ( pair => Environment . CommandLine . Contains ( pair . Key ) ) ; Application . Run ( keyValuePair . Value ) ; return ; } catch ( InvalidOperationException ) { } var form = new Form1 ( Environment . CommandLine . Contains ( " " ) ) ; if ( Environment . CommandLine . Contains ( " " ) ) form . Text = " " ; if ( Environment . CommandLine . Contains ( " " ) ) form . FormBorderStyle = FormBorderStyle . None ; if ( Environment . CommandLine . Contains ( " " ) ) form . NoTableHeader ( ) ; Application . Run ( form ) ; }
The main entry point for the application.
The main entry point for the application .