Show / Hide Table of Contents

Class ConsoleCommandBase

A Prompt console command.

Inheritance
object
ConsoleCommandBase
Implements
IConsoleCommand
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Dnn.PersonaBar.Library.Prompt
Assembly: Dnn.PersonaBar.Library.dll
Syntax
[Obsolete("Deprecated in DotNetNuke 9.7.0. Moved to DotNetNuke.Prompt in the core library project. Scheduled for removal in v11.0.0.")]
public abstract class ConsoleCommandBase : IConsoleCommand

Constructors

ConsoleCommandBase()

Declaration
protected ConsoleCommandBase()

Properties

Args

Declaration
protected string[] Args { get; }
Property Value
Type Description
string[]

Flags

Declaration
protected Hashtable Flags { get; }
Property Value
Type Description
Hashtable

LocalResourceFile

Declaration
public abstract string LocalResourceFile { get; }
Property Value
Type Description
string

PortalId

Declaration
protected int PortalId { get; }
Property Value
Type Description
int

PortalSettings

Declaration
protected PortalSettings PortalSettings { get; }
Property Value
Type Description
PortalSettings

ResultHtml

Gets resource key for the result html.

Declaration
public virtual string ResultHtml { get; }
Property Value
Type Description
string

TabId

Declaration
protected int TabId { get; }
Property Value
Type Description
int

User

Declaration
protected UserInfo User { get; }
Property Value
Type Description
UserInfo

ValidationMessage

Declaration
public string ValidationMessage { get; }
Property Value
Type Description
string

Methods

AddMessage(string)

Declaration
protected void AddMessage(string message)
Parameters
Type Name Description
string message

GetFlagValue<T>(string, string, T, bool, bool, bool)

Get the flag value.

Declaration
public virtual T GetFlagValue<T>(string flag, string fieldName, T defaultVal, bool required = false, bool checkmain = false, bool checkpositive = false)
Parameters
Type Name Description
string flag

Flag name to look.

string fieldName

Filed name to show in message.

T defaultVal

Default value of the flag, if any.

bool required

Is this a required flag or not.

bool checkmain

Try to find the flag value in first args or not.

bool checkpositive

This would be applicable only if the output is of type int or double and value should be positive.

Returns
Type Description
T

The flag value or defaultVal.

Type Parameters
Name Description
T

Type of the output expected.

HasFlag(string)

Declaration
protected bool HasFlag(string flagName)
Parameters
Type Name Description
string flagName
Returns
Type Description
bool

Init(string[], PortalSettings, UserInfo, int)

Declaration
public virtual void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId)
Parameters
Type Name Description
string[] args
PortalSettings portalSettings
UserInfo userInfo
int activeTabId

Initialize(string[], PortalSettings, UserInfo, int)

Declaration
public void Initialize(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId)
Parameters
Type Name Description
string[] args
PortalSettings portalSettings
UserInfo userInfo
int activeTabId

IsFlag(object)

Declaration
protected bool IsFlag(object input)
Parameters
Type Name Description
object input
Returns
Type Description
bool

IsValid()

Declaration
public virtual bool IsValid()
Returns
Type Description
bool

LocalizeString(string)

Declaration
protected string LocalizeString(string key)
Parameters
Type Name Description
string key
Returns
Type Description
string

Run()

Declaration
public abstract ConsoleResultModel Run()
Returns
Type Description
ConsoleResultModel

Implements

IConsoleCommand

Extension Methods

JsonExtensionsWeb.ToJson(object)
Back to top by the community, for the community... #DNNCMS