AutoWikiBrowser.MainForm.ParseCommandLine C# (CSharp) Method

ParseCommandLine() public method

public ParseCommandLine ( string args ) : void
args string
return void
        public void ParseCommandLine(string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i])
                {
                    case "/s":
                        if ((i + 1) < args.Length)
                        {
                            string fileName = args[i + 1];

                            if (string.IsNullOrEmpty(Path.GetExtension(fileName)) && !File.Exists(fileName))
                                fileName += ".xml";

                            if (File.Exists(fileName))
                                SettingsFile = fileName;
                        }
                        break;
                    case "/u":
                        if ((i + 1) < args.Length)
                            _profileToLoad = args[i + 1];
                        break;
                }
            }
        }

Usage Example

Beispiel #1
0
        static void Main(string[] args)
        {
            try
            {
                System.Threading.Thread.CurrentThread.Name = "Main thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += ApplicationThreadException;

                if (WikiFunctions.Variables.UsingMono)
                {
                    MessageBox.Show("AWB is not currently supported by mono", "Not supported",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                AwbDirs.MigrateDefaultSettings();

                MainForm awb = new MainForm();
                AWB = awb;
                awb.ParseCommandLine(args);

                Application.Run(awb);
            }
            catch (Exception ex)
            {
                WikiFunctions.ErrorHandler.Handle(ex);
            }
        }
All Usage Examples Of AutoWikiBrowser.MainForm::ParseCommandLine
MainForm