Search Results for

    Show / Hide Table of Contents

    Class CommandLineParametersBase

    The CommandLineParametersBase is a baseclass for creating a application specific command line parameters class.

    Inheritance
    System.Object
    CommandLineParametersBase
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: ImageVault.Common.Lib.Configuration.CommandLine
    Assembly: ImageVault.Common.dll
    Syntax
    public abstract class CommandLineParametersBase
    Remarks

    2009-06-23 dan: Created

    Constructors

    CommandLineParametersBase()

    Initializes a new instance of the CommandLineParameters class.

    Declaration
    protected CommandLineParametersBase()

    Properties

    AnswerYes

    Get/Sets the AnswerYes of the CommandLineParameters

    Declaration
    [CommandLineSwitch("y", "Answers yes on all questions")]
    public bool AnswerYes { get; set; }
    Property Value
    Type Description
    System.Boolean

    DisplayHelp

    Get/Sets the DisplayHelp of the CommandLineParameters

    Declaration
    [CommandLineSwitch("help", "Displays help")]
    [CommandLineAlias("h")]
    [CommandLineAlias("?")]
    public bool DisplayHelp { get; set; }
    Property Value
    Type Description
    System.Boolean

    Errors

    Gets the Errors of the BaseOperation

    Declaration
    public List<string> Errors { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    HelpMessage

    Get/Sets the HelpMessage of the CommandLineParametersBase

    Declaration
    protected string HelpMessage { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    AskYesNo(String)

    Displays a question and waits for the user to enter y or n

    Declaration
    public bool AskYesNo(string question)
    Parameters
    Type Name Description
    System.String question

    The question to display

    Returns
    Type Description
    System.Boolean

    True if y was pressed, false if n was pressed

    Execute()

    Executes the commandLine

    Declaration
    public abstract int Execute()
    Returns
    Type Description
    System.Int32

    The return code of the operation where 0 means success and anything else is an error. (should be returned to the console and will be visible as the %ERRORLEVEL% environment variable.

    ShowHelp()

    Declaration
    public void ShowHelp()

    Extension Methods

    EnumExtensions.GetNames<TEnum>(TEnum)
    In This Article
    Back to top (c) Meriworks 2002-2022