Search Results for

    Show / Hide Table of Contents

    Class CommandShellContext

    The shell context is the core of the command execution. Here are all commands registred. A ShellContext can be created of the ShellManager

    Inheritance
    System.Object
    CommandShellContext
    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: Simplic.CommandShell
    Assembly: Simplic.CommandShell.dll
    Syntax
    public class CommandShellContext

    Constructors

    | Improve this Doc View Source

    CommandShellContext(String)

    Create new shell context

    Declaration
    public CommandShellContext(string contextName)
    Parameters
    Type Name Description
    System.String contextName

    Properties

    | Improve this Doc View Source

    ContextName

    Unique name of the context

    Declaration
    public string ContextName { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    Execute(String, out Boolean)

    Execute a shell command

    Declaration
    public string Execute(string command, out bool errorOccured)
    Parameters
    Type Name Description
    System.String command

    Command line content

    System.Boolean errorOccured

    Out parameter which defines wether an error occured

    Returns
    Type Description
    System.String

    Return-Message of the execute method

    | Improve this Doc View Source

    ExecuteMultiline(String, Boolean, out Boolean)

    Execute multiple commands

    Declaration
    public string ExecuteMultiline(string commands, bool continueOnError, out bool errorOccured)
    Parameters
    Type Name Description
    System.String commands

    String with commands

    System.Boolean continueOnError

    Continue if one of the commands failed

    System.Boolean errorOccured

    Continues if an error occurse

    Returns
    Type Description
    System.String

    Result-String

    | Improve this Doc View Source

    RegisterMethod(String, CommandShellCommandDelegate, String[])

    Register a method to the shell context

    Declaration
    public void RegisterMethod(string cmdName, CommandShellCommandDelegate methodDelegate, params string[] requiredParameter)
    Parameters
    Type Name Description
    System.String cmdName

    name of the cmd, must be unique in one shell context

    CommandShellCommandDelegate methodDelegate

    Delegate to the .Net method

    System.String[] requiredParameter

    name of the required parameter, so that the system will automatically return an error if not all parameter were passed

    | Improve this Doc View Source

    RegisterMethod(String, Object, String, String[])

    Register a method to the shell context

    Declaration
    public void RegisterMethod(string cmdName, object classInstance, string methodName, string[] requiredParameter)
    Parameters
    Type Name Description
    System.String cmdName

    name of the cmd, must be unique in one shell context

    System.Object classInstance

    Instance of a class

    System.String methodName

    Name of the method

    System.String[] requiredParameter

    All parameter

    | Improve this Doc View Source

    RegisterStaticMethod(String, Type, String, String[])

    Register a static method to the shell context

    Declaration
    public void RegisterStaticMethod(string cmdName, Type classType, string methodName, string[] requiredParameter)
    Parameters
    Type Name Description
    System.String cmdName

    name of the cmd, must be unique in one shell context

    System.Type classType

    Type of the static class or the class instance

    System.String methodName

    Name of the method

    System.String[] requiredParameter

    All parameter

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx