Contains() 공개 메소드

Determines whether contains any param in the specified param list.
public Contains ( ) : bool
리턴 bool
예제 #1
0
        static void Main(string[] arguments)
        {
            using (Stream stream = typeof(Program).Assembly.GetManifestResourceStream("DroidExplorer.Bootstrapper.DroidExplorer.Bootstrapper.log4net")) {
                XmlConfigurator.Configure(stream);
            }

            Arguments args = new Arguments(arguments);

            if (args.Contains("l", "log"))
            {
                Logger.Level = log4net.Core.Level.All;
            }
            else
            {
                Logger.Level = log4net.Core.Level.All;
            }

            Logger.LogInfo(typeof(Program), "System Info: {0} {1}", Environment.OSVersion.VersionString, Program.ApplicationArchitecture);
            Logger.LogDebug(typeof(Program), "Starting setup with arguments: {0}", string.Join(",", arguments));

            /*Logger.LogDebug ( typeof ( Program ), "Checking for Minimum .net version" );
             * if ( Requirements.HasDotNet35SP1OrGreater ( ) ) {
             *      Logger.LogDebug ( typeof ( Program ), "At least .net version 3.5 SP 1 is installed." );
             * } else {
             *      Logger.LogFatal ( typeof ( Program ), "The requirement of .net framework 3.5 SP 1 was not found." );
             *      if ( MessageBox.Show ( "Microsoft .NET Framework 3.5 SP 1 was not found on this machine.\nClick 'OK' to navigate to the Microsoft website to download, or click 'Cancel' to just exit.\n\nSetup will not continue.", "Missing .NET Framework 3.5 SP1", MessageBoxButtons.OKCancel, MessageBoxIcon.Error ) == DialogResult.OK ) {
             *              Process proc = new Process ( );
             *              ProcessStartInfo psi = new ProcessStartInfo ( "http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en" );
             *              proc.StartInfo = psi;
             *              proc.Start ( );
             *      }
             *      return;
             * }*/


            if (!Requirements.IsCorrectPlatform( ))
            {
                Logger.LogFatal(typeof(Program), "Installing on the wrong platform.");
                MessageBox.Show(string.Format("You are attempting to install the {0} version of Droid Explorer which is not supported on this platform. Please download the correct installer for your platform ({1})", Program.ApplicationArchitecture.ToString( ), Requirements.Is64Bit( ) ? ArchitectureTypes.x64.ToString( ) : ArchitectureTypes.x86.ToString( )),
                                "Can not install", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            if (args.Contains("u", "uninstall", "x", "remove"))
            {
                Mode = InstallMode.Uninstall;
                Logger.LogDebug(typeof(Program), "Mode set to uninstall");
            }
            else
            {
                if (args.Contains("s", "sdk", "sdkonly"))
                {
                    /*Mode = InstallMode.SdkOnly;
                     * Logger.LogDebug ( typeof ( Program ), "Mode set to SDK Only" );*/
                    Logger.LogDebug(typeof(Program), "Mode '{0}' is no longer supported.");
                }
                else
                {
                    Mode = InstallMode.Install;
                    Logger.LogDebug(typeof(Program), "Mode set to install");
                }
            }

            /*Application.SetUnhandledExceptionMode ( UnhandledExceptionMode.Automatic );
             * Application.ThreadException += delegate ( object sender, System.Threading.ThreadExceptionEventArgs e ) {
             *      Logger.LogError ( typeof ( Program ), e.Exception.Message, e.Exception );
             *      if ( wizard != null && !wizard.IsDisposed ) {
             *              wizard.Error ( e.Exception );
             *      }
             * };*/

            Application.EnableVisualStyles( );
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new WizardForm( ));
        }
예제 #2
0
        static void Main( string[] arguments )
        {
            using ( Stream stream = typeof ( Program ).Assembly.GetManifestResourceStream ( "DroidExplorer.Bootstrapper.DroidExplorer.Bootstrapper.log4net" ) ) {
                XmlConfigurator.Configure ( stream );
            }

            Arguments args = new Arguments ( arguments );

            if ( args.Contains ( "l", "log" ) ) {
                Logger.Level = log4net.Core.Level.All;
            } else {
                Logger.Level = log4net.Core.Level.All;
            }

            Logger.LogInfo ( typeof ( Program ), "System Info: {0} {1}", Environment.OSVersion.VersionString, Program.ApplicationArchitecture );
            Logger.LogDebug ( typeof ( Program ), "Starting setup with arguments: {0}", string.Join ( ",", arguments ) );

            /*Logger.LogDebug ( typeof ( Program ), "Checking for Minimum .net version" );
            if ( Requirements.HasDotNet35SP1OrGreater ( ) ) {
                Logger.LogDebug ( typeof ( Program ), "At least .net version 3.5 SP 1 is installed." );
            } else {
                Logger.LogFatal ( typeof ( Program ), "The requirement of .net framework 3.5 SP 1 was not found." );
                if ( MessageBox.Show ( "Microsoft .NET Framework 3.5 SP 1 was not found on this machine.\nClick 'OK' to navigate to the Microsoft website to download, or click 'Cancel' to just exit.\n\nSetup will not continue.", "Missing .NET Framework 3.5 SP1", MessageBoxButtons.OKCancel, MessageBoxIcon.Error ) == DialogResult.OK ) {
                    Process proc = new Process ( );
                    ProcessStartInfo psi = new ProcessStartInfo ( "http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en" );
                    proc.StartInfo = psi;
                    proc.Start ( );
                }
                return;
            }*/

            if ( !Requirements.IsCorrectPlatform ( ) ) {
                Logger.LogFatal ( typeof ( Program ), "Installing on the wrong platform." );
                MessageBox.Show ( string.Format ( "You are attempting to install the {0} version of Droid Explorer which is not supported on this platform. Please download the correct installer for your platform ({1})", Program.ApplicationArchitecture.ToString ( ), Requirements.Is64Bit ( ) ? ArchitectureTypes.x64.ToString ( ) : ArchitectureTypes.x86.ToString ( ) ),
                    "Can not install", MessageBoxButtons.OK, MessageBoxIcon.Error );
                return;
            }

            if ( args.Contains ( "u", "uninstall", "x", "remove" ) ) {
                Mode = InstallMode.Uninstall;
                Logger.LogDebug ( typeof ( Program ), "Mode set to uninstall" );
            } else {
                if ( args.Contains ( "s", "sdk", "sdkonly" ) ) {
                    /*Mode = InstallMode.SdkOnly;
                    Logger.LogDebug ( typeof ( Program ), "Mode set to SDK Only" );*/
                    Logger.LogDebug ( typeof ( Program ), "Mode '{0}' is no longer supported." );
                } else {
                    Mode = InstallMode.Install;
                    Logger.LogDebug ( typeof ( Program ), "Mode set to install" );
                }
            }

            /*Application.SetUnhandledExceptionMode ( UnhandledExceptionMode.Automatic );
            Application.ThreadException += delegate ( object sender, System.Threading.ThreadExceptionEventArgs e ) {
                Logger.LogError ( typeof ( Program ), e.Exception.Message, e.Exception );
                if ( wizard != null && !wizard.IsDisposed ) {
                    wizard.Error ( e.Exception );
                }
            };*/

            Application.EnableVisualStyles ( );
            Application.SetCompatibleTextRenderingDefault ( false );
            Application.Run ( new WizardForm ( ) );
        }