Show / Hide Table of Contents

Class BotViewModelBase

The view model for a bot, which may be controlled by a script or by a brain.

Inheritance
object
BindableBase
ViewModelBase
BotViewModelBase
BotBrainViewModel
BotViewModel
Implements
IBotViewModel
INotifyPropertyChanged
IOnSelected
Inherited Members
ViewModelBase.Services
ViewModelBase.Logger
ViewModelBase.LogVerboseException(Exception, string, string)
BindableBase.SetProperty<T>(ref T, T, string)
BindableBase.SetProperty<T>(ref T, T, Action, string)
BindableBase.RaisePropertyChanged(string)
BindableBase.OnPropertyChanged(PropertyChangedEventArgs)
BindableBase.PropertyChanged
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Phoenix.BotBrain
Assembly: Phoenix.Plugin.BotBrain.BotScripting.dll
Syntax
public abstract class BotViewModelBase : ViewModelBase, IBotViewModel, INotifyPropertyChanged, IOnSelected

Constructors

View Source

BotViewModelBase(IServiceProvider)

Initializes a new instance of the BotViewModelBase class.

Declaration
protected BotViewModelBase(IServiceProvider services)
Parameters
Type Name Description
IServiceProvider services

The service provider.

Properties

View Source

AllListViewChoices

Gets all possible titles for the list view, if the bot has many component types, such as actions, urges, and/or considerations.

Declaration
public virtual IEnumerable<string>? AllListViewChoices { get; }
Property Value
Type Description
IEnumerable<string>
View Source

BotScriptTelemetryClient

Gets the bot script telemetry client.

Declaration
protected IBotScriptTelemetryClient? BotScriptTelemetryClient { get; }
Property Value
Type Description
IBotScriptTelemetryClient
View Source

CanResume

Gets a value indicating whether or not the bot can be resumed.

Declaration
public virtual bool CanResume { get; }
Property Value
Type Description
bool
View Source

CanSave

Gets a value indicating whether or not the bot can be saved to its current location.

Declaration
public virtual bool CanSave { get; }
Property Value
Type Description
bool
View Source

CanStart

Gets a value indicating whether or not the bot can be started.

Declaration
public virtual bool CanStart { get; }
Property Value
Type Description
bool
View Source

CanStop

Gets a value indicating whether or not the bot can be stopped.

Declaration
public virtual bool CanStop { get; }
Property Value
Type Description
bool
View Source

DetailsTitle

Gets the title of the primary view for controlling this bot.

Declaration
public virtual string DetailsTitle { get; }
Property Value
Type Description
string
View Source

DeviceManager

Gets the device manager.

Declaration
protected IDeviceManager DeviceManager { get; }
Property Value
Type Description
IDeviceManager
View Source

FilePath

Gets or sets the bot's file path.

Declaration
public string? FilePath { get; set; }
Property Value
Type Description
string
View Source

IsRunning

Gets a value indicating whether or not the bot is running.

Declaration
public abstract bool IsRunning { get; }
Property Value
Type Description
bool
View Source

ListDetailsTitle

Gets the title for presenting details about the selected list view item.

Declaration
public virtual string ListDetailsTitle { get; }
Property Value
Type Description
string
View Source

ListViewContext

Gets the data context for the list view presenting actions, urges, or other components.

Declaration
public virtual IListViewModel? ListViewContext { get; protected set; }
Property Value
Type Description
IListViewModel
View Source

ListViewTitle

Gets the title for the list view.

Declaration
public virtual string? ListViewTitle { get; protected set; }
Property Value
Type Description
string
View Source

ModifyListViewTitleIndexCommand

Gets the command to change the selected list view type.

Declaration
public DelegateCommand<int?> ModifyListViewTitleIndexCommand { get; }
Property Value
Type Description
DelegateCommand<int?>
View Source

Name

Gets or sets the bot's name.

Declaration
public virtual string? Name { get; set; }
Property Value
Type Description
string
View Source

ResumeCommand

Gets the command to resume the bot.

Declaration
public DelegateCommand ResumeCommand { get; }
Property Value
Type Description
DelegateCommand
View Source

SaveCommand

Gets the command to save the bot.

Declaration
public DelegateCommand SaveCommand { get; }
Property Value
Type Description
DelegateCommand
View Source

StartCommand

Gets the command to start the bot.

Declaration
public DelegateCommand StartCommand { get; }
Property Value
Type Description
DelegateCommand
View Source

Status

Gets the bot's status.

Declaration
public virtual string Status { get; }
Property Value
Type Description
string
View Source

StopCommand

Gets the command to stop the bot.

Declaration
public DelegateCommand StopCommand { get; }
Property Value
Type Description
DelegateCommand
View Source

TelemetryClient

Gets the telemetry client.

Declaration
protected override ITelemetryClient? TelemetryClient { get; }
Property Value
Type Description
ITelemetryClient
Overrides
ViewModelBase.TelemetryClient

Methods

View Source

IsRunningOn(IDevice)

Gets a value indicating whether or not the bot is running on the device.

Declaration
public abstract bool IsRunningOn(IDevice device)
Parameters
Type Name Description
IDevice device

The device.

Returns
Type Description
bool

True if it is running on the device.

View Source

Load(string)

Loads a serialized representation of a bot.

Declaration
public abstract void Load(string data)
Parameters
Type Name Description
string data

The data to load.

View Source

OnCanExecuteChanged()

Handles UI updates when the bot's status changes.

Declaration
public virtual void OnCanExecuteChanged()
View Source

OnDeviceSelected(DeviceCollectionChangeInfo)

Handles when the user's device selection changes.

Declaration
public void OnDeviceSelected(DeviceCollectionChangeInfo changeInfo)
Parameters
Type Name Description
DeviceCollectionChangeInfo changeInfo

The change information.

View Source

OnSelected(object?)

Occurs when the item is selected.

Declaration
public virtual void OnSelected(object? sender)
Parameters
Type Name Description
object sender

The sender.

View Source

ResumeAsync()

Resumes the bot.

Declaration
public virtual Task ResumeAsync()
Returns
Type Description
Task

A task.

View Source

Save()

Saves the bot.

Declaration
public virtual void Save()
View Source

SaveToString()

Saves the bot to a string.

Declaration
protected abstract string SaveToString()
Returns
Type Description
string

A string representation of the bot.

View Source

StartAsync()

Starts the bot.

Declaration
public abstract Task StartAsync()
Returns
Type Description
Task

A task.

View Source

StopAsync()

Stops the bot.

Declaration
public abstract Task StopAsync()
Returns
Type Description
Task

A task.

View Source

TryRunTask(string, Func<Task>)

Attempts to run a task, and logs a message if an exception is encountered.

Declaration
protected virtual Task TryRunTask(string name, Func<Task> action)
Parameters
Type Name Description
string name

The action description.

Func<Task> action

A function that provides the task to run.

Returns
Type Description
Task

A task.

Events

View Source

IsRunningChanged

Occurs when the IsRunning property changes.

Declaration
public event EventHandler? IsRunningChanged
Event Type
Type Description
EventHandler

Implements

IBotViewModel
INotifyPropertyChanged
IOnSelected

Extension Methods

INotifyPropertyChangedExtensions.OnPropertyChanged(INotifyPropertyChanged, string, Action)
INotifyPropertyChangedExtensions.OnPropertyChanged(INotifyPropertyChanged, string, Action<object?, string>)
INotifyPropertyChangedExtensions.OnPropertyChangedUntil(INotifyPropertyChanged, string, Func<bool>)
INotifyPropertyChangedExtensions.OnPropertyChangedUntil(INotifyPropertyChanged, string, Func<object?, string, bool>)
  • View Source
In this article
Back to top Generated by DocFX