Class BotAutomationViewModel
The view model for a bot automation panel.
Inheritance
Inherited Members
Namespace: Phoenix.BotBrain
Assembly: Phoenix.Plugin.BotBrain.BotScripting.dll
Syntax
public class BotAutomationViewModel : AutomationViewModelBase<BotAutomationView>, INotifyPropertyChanged, IDisposable
Constructors
View SourceBotAutomationViewModel(IServiceProvider, BotAutomationView?)
Initializes a new instance of the BotAutomationViewModel class.
Declaration
public BotAutomationViewModel(IServiceProvider services, BotAutomationView? view = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | services | The service provider. |
BotAutomationView | view | The view for this view model. |
Properties
View SourceAreBotDetailsExpanded
Gets or sets a value indicating whether or not the bot details are expanded.
Declaration
public bool AreBotDetailsExpanded { get; set; }
Property Value
Type | Description |
---|---|
bool |
BotFileExtension
Gets the file extension for bot files.
Declaration
public virtual string BotFileExtension { get; }
Property Value
Type | Description |
---|---|
string |
BotFileExtensionsForOpenDialog
Gets the file extensions to allow when opening bot files.
Declaration
protected virtual string BotFileExtensionsForOpenDialog { get; }
Property Value
Type | Description |
---|---|
string |
Bots
Gets the view model for managing bots.
Declaration
public TreeViewModel<IBotViewModel> Bots { get; }
Property Value
Type | Description |
---|---|
TreeViewModel<IBotViewModel> |
LoadBotFileCommand
Gets the command to load a bot from a file.
Declaration
public DelegateCommand LoadBotFileCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
OpenFileDialogFileTypeFilter
Gets the file type filter to use for opening files.
Declaration
public virtual string OpenFileDialogFileTypeFilter { get; }
Property Value
Type | Description |
---|---|
string |
PopoutSelectedBotCommand
Gets the command to pop out a bot in a new window.
Declaration
public DelegateCommand PopoutSelectedBotCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
SaveBotAsFileCommand
Gets the command to save a bot as a new file.
Declaration
public DelegateCommand SaveBotAsFileCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
SelectedBot
Gets the currently selected bot.
Declaration
public IBotViewModel? SelectedBot { get; }
Property Value
Type | Description |
---|---|
IBotViewModel |
Methods
View SourceCanPopoutSelectedBot()
Determines whether or not the selected bot can be popped out in a new window.
Declaration
protected virtual bool CanPopoutSelectedBot()
Returns
Type | Description |
---|---|
bool | A bool. |
CreateBotFromFile(string)
Creates a bot from a file.
Declaration
protected virtual IBotViewModel CreateBotFromFile(string filepath)
Parameters
Type | Name | Description |
---|---|---|
string | filepath | The file path. |
Returns
Type | Description |
---|---|
IBotViewModel | The bot. |
CreateBotFromString(string)
Creates a bot from a string.
Declaration
protected virtual IBotViewModel CreateBotFromString(string data)
Parameters
Type | Name | Description |
---|---|---|
string | data | A string representation of a bot. |
Returns
Type | Description |
---|---|
IBotViewModel | The bot. |
HandleDeviceSelected(DeviceCollectionChangeInfo)
Handles when the user's device selection changes.
Declaration
protected override void HandleDeviceSelected(DeviceCollectionChangeInfo changeInfo)
Parameters
Type | Name | Description |
---|---|---|
DeviceCollectionChangeInfo | changeInfo | The change information. |
Overrides
View SourceLoadBotFile(string)
Loads a bot from a file.
Declaration
public virtual void LoadBotFile(string filepath)
Parameters
Type | Name | Description |
---|---|---|
string | filepath | The file path. |
PopoutSelectedBot()
Pops out the selected bot in a new window.
Declaration
protected virtual void PopoutSelectedBot()
PromptToLoadBotFile()
Prompts the user to load a bot from a file.
Declaration
protected virtual void PromptToLoadBotFile()
PromptToOpenBotFile()
Prompts the user to open a bot file.
Declaration
protected virtual string? PromptToOpenBotFile()
Returns
Type | Description |
---|---|
string | The path to the file the user selected, or null if canceled. |
PromptToSaveBotFile(IBotViewModel)
Prompts the user to save a bot file.
Declaration
protected virtual 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. |
SaveBotAsFile()
Prompts the user to save a bot to a new file.
Declaration
protected virtual void SaveBotAsFile()