Show / Hide Table of Contents

Class BotViewModel

The view model for a scripted bot.

Inheritance
object
BindableBase
ViewModelBase
BotViewModelBase
BotViewModel
BotBrainClient
BotWithQueueViewModel<T>
Implements
IBotViewModelWithActions
IBotViewModel
INotifyPropertyChanged
IOnSelected
ICanMoveItemsTo
IDisposable
Inherited Members
BotViewModelBase.IsRunningChanged
BotViewModelBase.CanStart
BotViewModelBase.CanResume
BotViewModelBase.CanStop
BotViewModelBase.CanSave
BotViewModelBase.DetailsTitle
BotViewModelBase.ListViewContext
BotViewModelBase.AllListViewChoices
BotViewModelBase.ListDetailsTitle
BotViewModelBase.StartCommand
BotViewModelBase.StopCommand
BotViewModelBase.ResumeCommand
BotViewModelBase.SaveCommand
BotViewModelBase.ModifyListViewTitleIndexCommand
BotViewModelBase.FilePath
BotViewModelBase.DeviceManager
BotViewModelBase.TelemetryClient
BotViewModelBase.BotScriptTelemetryClient
BotViewModelBase.ResumeAsync()
BotViewModelBase.Save()
BotViewModelBase.OnDeviceSelected(DeviceCollectionChangeInfo)
BotViewModelBase.OnSelected(object)
BotViewModelBase.TryRunTask(string, Func<Task>)
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 class BotViewModel : BotViewModelBase, IBotViewModelWithActions, IBotViewModel, INotifyPropertyChanged, IOnSelected, ICanMoveItemsTo, IDisposable

Constructors

View Source

BotViewModel(IServiceProvider)

Initializes a new instance of the BotViewModel class.

Declaration
public BotViewModel(IServiceProvider services)
Parameters
Type Name Description
IServiceProvider services

The service provider.

Properties

View Source

Actions

Gets the actions view model.

Declaration
public ListViewModel<IBotActionViewModel> Actions { get; }
Property Value
Type Description
ListViewModel<IBotActionViewModel>
View Source

Bot

Gets or sets the bot being automated.

Declaration
public IAutomatedBot? Bot { get; protected set; }
Property Value
Type Description
IAutomatedBot
View Source

Device

Gets or sets the device associated with the bot.

Declaration
public IDevice? Device { get; set; }
Property Value
Type Description
IDevice
View Source

IsRunning

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

Declaration
public override bool IsRunning { get; }
Property Value
Type Description
bool
Overrides
BotViewModelBase.IsRunning
View Source

ListViewTitle

Gets the title for the list view.

Declaration
public override string ListViewTitle { get; }
Property Value
Type Description
string
Overrides
BotViewModelBase.ListViewTitle
View Source

Name

Gets or sets the bot's name.

Declaration
public override string? Name { get; set; }
Property Value
Type Description
string
Overrides
BotViewModelBase.Name
View Source

SelectedAction

Gets or sets the selected action.

Declaration
public IBotActionViewModel? SelectedAction { get; set; }
Property Value
Type Description
IBotActionViewModel
View Source

Status

Gets the bot's status.

Declaration
public override string Status { get; }
Property Value
Type Description
string
Overrides
BotViewModelBase.Status

Methods

View Source

CanAppendItems(object)

Determines if the given items can be moved or copied into this object.

Declaration
public virtual bool CanAppendItems(object dragData)
Parameters
Type Name Description
object dragData

The items.

Returns
Type Description
bool

A boolean.

View Source

CheckAreActionsEditable()

Updates whether or not the actions are not editable.

Declaration
protected virtual void CheckAreActionsEditable()
View Source

ClearRunningAction()

Resets the currently running action.

Declaration
protected void ClearRunningAction()
View Source

CopyItemsTo(object)

Copies the given items into this object.

Declaration
public void CopyItemsTo(object dragData)
Parameters
Type Name Description
object dragData

The items.

View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public virtual void Dispose()
View Source

DisposeBot()

Disposes the bot in order to start a new one.

Declaration
protected virtual void DisposeBot()
View Source

DisposeBot(IAutomatedBot)

Disposes the bot.

Declaration
protected virtual void DisposeBot(IAutomatedBot bot)
Parameters
Type Name Description
IAutomatedBot bot

The bot.

View Source

IsRunningOn(IDevice?)

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

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

The device.

Returns
Type Description
bool

True if it is running on the device.

Overrides
BotViewModelBase.IsRunningOn(IDevice)
View Source

Load(string)

Loads a serialized representation of a bot.

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

The data to load.

Overrides
BotViewModelBase.Load(string)
View Source

MoveItemsTo(object)

Moves the given items into this object.

Declaration
public void MoveItemsTo(object dragData)
Parameters
Type Name Description
object dragData

The items.

View Source

OnBotActionFailed(object?, BotActionFailedEventArgs)

Called when a bot action fails.

Declaration
protected virtual void OnBotActionFailed(object? sender, BotActionFailedEventArgs e)
Parameters
Type Name Description
object sender

The sender.

BotActionFailedEventArgs e

Contains the action and exception.

View Source

OnBotActionFinished(object?, BotActionEventArgs)

Called when a bot action finishes.

Declaration
protected virtual void OnBotActionFinished(object? sender, BotActionEventArgs e)
Parameters
Type Name Description
object sender

The sender.

BotActionEventArgs e

Not used.

View Source

OnBotActionStarted(object?, BotActionEventArgs)

Called when a bot action starts.

Declaration
protected virtual void OnBotActionStarted(object? sender, BotActionEventArgs e)
Parameters
Type Name Description
object sender

The sender.

BotActionEventArgs e

Not used.

View Source

OnCanExecuteChanged()

Handles UI updates when the bot's status changes.

Declaration
public override void OnCanExecuteChanged()
Overrides
BotViewModelBase.OnCanExecuteChanged()
View Source

RegisterBotEvents()

Registers bot events.

Declaration
protected virtual void RegisterBotEvents()
View Source

SaveToString()

Saves the bot to a string.

Declaration
protected override string SaveToString()
Returns
Type Description
string

A string representation of the bot.

Overrides
BotViewModelBase.SaveToString()
View Source

SetRunningAction(int)

Sets the currently running action.

Declaration
protected void SetRunningAction(int index)
Parameters
Type Name Description
int index

The action index.

View Source

SetRunningActions(IEnumerable<int>)

Sets the currently running actions.

Declaration
protected void SetRunningActions(IEnumerable<int> indices)
Parameters
Type Name Description
IEnumerable<int> indices

The action indices.

View Source

SetupBot()

Sets up the bot in order to start it.

Declaration
protected virtual Task SetupBot()
Returns
Type Description
Task

A task.

View Source

StartAsync()

Starts the bot.

Declaration
public override Task StartAsync()
Returns
Type Description
Task

A task.

Overrides
BotViewModelBase.StartAsync()
View Source

StopAsync()

Stops the bot.

Declaration
public override Task StopAsync()
Returns
Type Description
Task

A task.

Overrides
BotViewModelBase.StopAsync()

Implements

IBotViewModelWithActions
IBotViewModel
INotifyPropertyChanged
IOnSelected
ICanMoveItemsTo
IDisposable

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