Class ConsoleCommandBase
A Prompt console command.
Inheritance
ConsoleCommandBase
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
Flags
Declaration
protected Hashtable Flags { get; }
Property Value
LocalResourceFile
Declaration
public abstract string LocalResourceFile { get; }
Property Value
PortalId
Declaration
protected int PortalId { get; }
Property Value
PortalSettings
Declaration
protected PortalSettings PortalSettings { get; }
Property Value
ResultHtml
Gets resource key for the result html.
Declaration
public virtual string ResultHtml { get; }
Property Value
TabId
Declaration
protected int TabId { get; }
Property Value
User
Declaration
protected UserInfo User { get; }
Property Value
ValidationMessage
Declaration
public string ValidationMessage { get; }
Property Value
Methods
AddMessage(string)
Declaration
protected void AddMessage(string message)
Parameters
| Type |
Name |
Description |
| string |
message |
|
GetFlagValue<T>(string, string, T, bool, bool, bool)
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
Init(string[], PortalSettings, UserInfo, int)
Declaration
public virtual void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId)
Parameters
Initialize(string[], PortalSettings, UserInfo, int)
Declaration
public void Initialize(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId)
Parameters
IsFlag(object)
Declaration
protected bool IsFlag(object input)
Parameters
| Type |
Name |
Description |
| object |
input |
|
Returns
IsValid()
Declaration
public virtual bool IsValid()
Returns
LocalizeString(string)
Declaration
protected string LocalizeString(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
|
Returns
Run()
Declaration
public abstract ConsoleResultModel Run()
Returns
Implements
Extension Methods