CommandLineParser.HasUseableCommandLine C# (CSharp) Метод

HasUseableCommandLine() публичный статический Метод

TRUE if we believe there is enough information in the command line to proceed with running the headless task
public static HasUseableCommandLine ( CommandLineParser, commandLine ) : bool
commandLine CommandLineParser,
Результат bool
    public static bool HasUseableCommandLine(CommandLineParser commandLine)
    {
        //If the command line does not contain a "-command" argument, then we know there's nothing we can do
        if(string.IsNullOrWhiteSpace(commandLine.GetParameterValue(Parameter_Command)))
        {
            return false;
        }

        return true;
    }

Usage Example

Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //UI form we are going to show
            var form = new FormSiteExportImport();

            //See if we have command line arguments to run
            var commandLine = new CommandLineParser();

            if (CommandLineParser.HasUseableCommandLine(commandLine))
            {
                form.SetStartupCommandLine(commandLine);
            }

            Application.Run(form);
        }
All Usage Examples Of CommandLineParser::HasUseableCommandLine