Plugins
From UBot Studio
(Difference between revisions)
(→IUBotFunction) |
(→Plugin Interfaces) |
||
| Line 29: | Line 29: | ||
IEnumerable<UBotParameterDefinition> ParameterDefinitions { get; } | IEnumerable<UBotParameterDefinition> ParameterDefinitions { get; } | ||
void Execute(IUBotStudio ubotStudio, Dictionary<string, string> parameters); | void Execute(IUBotStudio ubotStudio, Dictionary<string, string> parameters); | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === IUBotStudio === | ||
| + | |||
| + | <syntaxhighlight lang="csharp"> | ||
| + | public interface IUBotStudio | ||
| + | { | ||
| + | void RunScript(string script); | ||
| + | void ChangeUserInterface(string name); | ||
| + | IUBotCommand ContainerParent { get; set; } | ||
| + | void RunContainerCommands(); | ||
| + | void SetVariable(string variableName, string value); | ||
| + | void SetList(string listName, List<string> value); | ||
| + | void SetTable(string tableName, string[,] value); | ||
| + | string GetVariable(string variableName); | ||
| + | List<string> GetList(string listName); | ||
| + | string[,] GetTable(string tableName); | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === IEventEnabled === | ||
| + | |||
| + | <syntaxhighlight lang="csharp"> | ||
| + | public interface IEventEnabled | ||
| + | { | ||
| + | void StartEventListener(); | ||
| + | void StopEventListener(); | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === IWizardEnabled === | ||
| + | |||
| + | <syntaxhighlight lang="csharp"> | ||
| + | public interface IWizardEnabled | ||
| + | { | ||
| + | IWizard GenerateWizard(); | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === IWizard === | ||
| + | |||
| + | <syntaxhighlight lang="csharp"> | ||
| + | public interface IWizard | ||
| + | { | ||
| + | Window WizardWindow { get; } | ||
| + | Dictionary<string, string> WizardValues { get; } | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === UBotParameterDefinition === | ||
| + | |||
| + | <syntaxhighlight lang="csharp"> | ||
| + | public class UBotParameterDefinition | ||
| + | { | ||
| + | public string Name { get; private set; } | ||
| + | public UBotType Type { get; private set; } | ||
| + | public IEnumerable<string> Options { get; set; } | ||
| + | public object DefaultValue { get; set; } | ||
| + | |||
| + | public UBotParameterDefinition(string name, UBotType type) | ||
| + | { | ||
| + | Name = name; | ||
| + | Type = type; | ||
| + | } | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === UBotType === | ||
| + | |||
| + | <syntaxhighlight lang="csharp"> | ||
| + | public enum UBotType | ||
| + | { | ||
| + | String, | ||
| + | UBotVariable, | ||
| + | UBotList, | ||
| + | UBotTable | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 15:26, 15 October 2012
Contents |
Using Plugins
Building Plugins
Plugin Interfaces
IUBotCommand
public interface IUBotCommand { string CommandName { get; } string Category { get; } IEnumerable<UBotParameterDefinition> ParameterDefinitions { get; } void Execute(IUBotStudio ubotStudio, Dictionary<string, string> parameters); bool IsContainer { get; } }
IUBotFunction
public interface IUBotFunction { string FunctionName { get; } object ReturnValue { get; } UBotType ReturnValueType { get; } string Category { get; } IEnumerable<UBotParameterDefinition> ParameterDefinitions { get; } void Execute(IUBotStudio ubotStudio, Dictionary<string, string> parameters); }
IUBotStudio
public interface IUBotStudio { void RunScript(string script); void ChangeUserInterface(string name); IUBotCommand ContainerParent { get; set; } void RunContainerCommands(); void SetVariable(string variableName, string value); void SetList(string listName, List<string> value); void SetTable(string tableName, string[,] value); string GetVariable(string variableName); List<string> GetList(string listName); string[,] GetTable(string tableName); }
IEventEnabled
public interface IEventEnabled { void StartEventListener(); void StopEventListener(); }
IWizardEnabled
public interface IWizardEnabled { IWizard GenerateWizard(); }
IWizard
public interface IWizard { Window WizardWindow { get; } Dictionary<string, string> WizardValues { get; } }
UBotParameterDefinition
public class UBotParameterDefinition { public string Name { get; private set; } public UBotType Type { get; private set; } public IEnumerable<string> Options { get; set; } public object DefaultValue { get; set; } public UBotParameterDefinition(string name, UBotType type) { Name = name; Type = type; } }
UBotType
public enum UBotType { String, UBotVariable, UBotList, UBotTable }