Class BotBrainAutomationViewModel
The view model for a bot brain automation panel.
Inheritance
Inherited Members
Namespace: Phoenix.BotBrain
Assembly: Phoenix.Plugin.BotBrain.BrainEditor.dll
Syntax
public class BotBrainAutomationViewModel : BotAutomationViewModel, INotifyPropertyChanged, IDisposable
Constructors
View SourceBotBrainAutomationViewModel(IServiceProvider, IBrainHelper?, BotBrainLogForwarder?, BotBrainUIHelpers?)
Initializes a new instance of the BotBrainAutomationViewModel class.
Declaration
public BotBrainAutomationViewModel(IServiceProvider services, IBrainHelper? brainHelper = null, BotBrainLogForwarder? logForwarder = null, BotBrainUIHelpers? uiHelpers = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | services | The service provider. |
IBrainHelper | brainHelper | The brain helper. |
BotBrainLogForwarder | logForwarder | The log forwarder. |
BotBrainUIHelpers | uiHelpers | The bot brain UI helpers. |
Fields
View SourceDefaultBotBrainOutputFolder
The default output folder for bot brain resources.
Declaration
public const string DefaultBotBrainOutputFolder = "BotBrain"
Field Value
Type | Description |
---|---|
string |
Properties
View SourceAreBotAndBrainFileExtensionsIdentical
Gets a value indicating whether or not bots and brains use the same file extension.
Declaration
protected bool AreBotAndBrainFileExtensionsIdentical { get; }
Property Value
Type | Description |
---|---|
bool |
AvailableBrains
Gets the list of available brains.
Declaration
public ObservableCollection<string> AvailableBrains { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<string> |
AvailableBrainsLastLoaded
Gets or sets the time when available brains were last loaded.
Declaration
protected DateTime AvailableBrainsLastLoaded { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
BotBrainFolderPath
Gets the bot brain folder path.
Declaration
public string BotBrainFolderPath { get; }
Property Value
Type | Description |
---|---|
string |
BotFileExtensionsForOpenDialog
Gets the file extensions to allow when opening bot files.
Declaration
protected override string BotFileExtensionsForOpenDialog { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
View SourceBrainFileExtension
Gets the brain file extension.
Declaration
public string BrainFileExtension { get; }
Property Value
Type | Description |
---|---|
string |
BrainListRefreshTime
Gets the amount of time before the list of available brains can be refreshed.
Declaration
protected virtual TimeSpan BrainListRefreshTime { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
BrainLoop
Gets the brain loop.
Declaration
protected BotBrainLoop BrainLoop { get; }
Property Value
Type | Description |
---|---|
BotBrainLoop |
BrainTick
Gets the update frequency for bot brains.
Declaration
protected virtual TimeSpan BrainTick { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
LoadAvailableBrainsCommand
Gets the command to load the list of available brains.
Declaration
public DelegateCommand LoadAvailableBrainsCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
LoadBrainCommand
Gets the command to load a brain.
Declaration
public DelegateCommand<object> LoadBrainCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<object> |
Serializer
Gets the brain serializer.
Declaration
protected IBrainSerializer Serializer { get; }
Property Value
Type | Description |
---|---|
IBrainSerializer |
Methods
View SourceCanPopoutSelectedBot()
Determines whether or not the selected bot can be popped out in a new window.
Declaration
protected override bool CanPopoutSelectedBot()
Returns
Type | Description |
---|---|
bool | A bool. |
Overrides
View SourceCreateBotBrainViewModel(string?)
Creates a brain view model.
Declaration
protected virtual IBotBrainViewModel CreateBotBrainViewModel(string? name = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The brain name. |
Returns
Type | Description |
---|---|
IBotBrainViewModel | The brain view model. |
CreateBotFromFile(string)
Creates a bot from a file.
Declaration
protected override IBotViewModel CreateBotFromFile(string filepath)
Parameters
Type | Name | Description |
---|---|---|
string | filepath | The file path. |
Returns
Type | Description |
---|---|
IBotViewModel | The bot. |
Overrides
View SourceDispose()
Removes all event handlers.
Declaration
public override void Dispose()
Overrides
View SourceLoadAvailableBrains()
Loads the list of available brains.
Declaration
protected virtual Task LoadAvailableBrains()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
PromptToSaveBotFile(IBotViewModel)
Prompts the user to save a bot file.
Declaration
protected override string? PromptToSaveBotFile(IBotViewModel bot)
Parameters
Type | Name | Description |
---|---|---|
IBotViewModel | bot | The bot being saved. |
Returns
Type | Description |
---|---|
string | The path to the file the user selected, or null if canceled. |