Exemplo n.º 1
0
 public static void Init(TestContext testContext)
 {
     argReader = new ArgumentReader(false, SwitchArgument.CreateHelpArgument(SwitchCharacter.Slash), "My Error Text",
                                    "Using: program.exe <filename> [/D] [/F=3]", "Example", "BlaBla",
                                    new PureArgument <String>("MyPureArgument", false, false, "Filename", "Pure Argument: %message%"),
                                    new SwitchArgument(SwitchCharacter.Slash, "D", "Switch D", "Switch D: %message%"),
                                    new SwitchedContentArgument <Int32>("SwitchedArgument", SwitchCharacter.Slash, "F", SeparatorCharacter.Equal, true, true, "Switched Content F", "Switched Content F: %message%"));
 }
Exemplo n.º 2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            Arguments = new ArgumentReader(false,
                                           SwitchArgument.CreateHelpArgument(SwitchCharacter.Slash),
                                           new PureArgument <String>("File Name", true, true, ""),
                                           new SwitchArgument(SwitchCharacter.Slash, "nosplash", ""));
            Arguments.AllowUnknownArgs = true;

            if (!Arguments.EvaluateArguments(false, e.Args))
            {
                MessageDialogEx.ShowDialog("The arguments are invalid!", "Error", MessageButtons.OK, MessageIcons.Error);
                return;
            }

            if (Arguments.ArgumentList[NOSPLASHSWITCH].IsSet)
            {
                new MainWindow().Show();
            }
            else
            {
                new Splash().Show();
            }
        }