Show / Hide Table of Contents

Class BotBrainClient

The view model for a bot automated by a brain.

Inheritance
object
BindableBase
ViewModelBase
BotViewModelBase
BotViewModel
BotBrainClient
Implements
ICanMoveItemsTo
IBotBrainClient
IBotViewModelWithActions
IBotViewModelWithBrain
IBotViewModel
INotifyPropertyChanged
IOnSelected
IDisposable
Inherited Members
BotViewModel.Name
BotViewModel.Status
BotViewModel.Actions
BotViewModel.SelectedAction
BotViewModel.Bot
BotViewModel.Device
BotViewModel.ListViewTitle
BotViewModel.IsRunningOn(IDevice)
BotViewModel.MoveItemsTo(object)
BotViewModel.CopyItemsTo(object)
BotViewModel.OnCanExecuteChanged()
BotViewModel.Load(string)
BotViewModel.SetupBot()
BotViewModel.DisposeBot()
BotViewModel.DisposeBot(IAutomatedBot)
BotViewModel.SaveToString()
BotViewModel.SetRunningAction(int)
BotViewModel.ClearRunningAction()
BotViewModel.SetRunningActions(IEnumerable<int>)
BotViewModel.RegisterBotEvents()
BotViewModel.OnBotActionFailed(object, BotActionFailedEventArgs)
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.BrainEditor.dll
Syntax
public class BotBrainClient : BotViewModel, ICanMoveItemsTo, IBotBrainClient, IBotViewModelWithActions, IBotViewModelWithBrain, IBotViewModel, INotifyPropertyChanged, IOnSelected, IDisposable

Constructors

View Source

BotBrainClient(IServiceProvider)

Initializes a new instance of the BotBrainClient class.

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

The service provider.

Properties

View Source

AvailableUpdateTicks

Gets the valid bot brain iteration numbers.

Declaration
protected List<uint> AvailableUpdateTicks { get; }
Property Value
Type Description
List<uint>
View Source

Brain

Gets or sets the brain.

Declaration
public virtual IBotBrain? Brain { get; set; }
Property Value
Type Description
IBotBrain
View Source

BrainView

Gets or sets the bot brain view model.

Declaration
public BotBrainViewModel? BrainView { get; set; }
Property Value
Type Description
BotBrainViewModel
View Source

CurrentAction

Gets the current action, if one is running.

Declaration
public object? CurrentAction { get; }
Property Value
Type Description
object
View Source

CurrentUpdateNumber

Gets or sets the current bot brain update number.

Declaration
public uint CurrentUpdateNumber { get; set; }
Property Value
Type Description
uint
View Source

IsRunning

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

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

LatestAction

Gets the latest action added to the view, if one is running.

Declaration
public object? LatestAction { get; }
Property Value
Type Description
object
View Source

ModifySelectedUpdateIndexCommand

Gets the command to modify the selected update index.

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

RecommendedActions

Gets the history of recommended actions.

Declaration
public ICollectionView RecommendedActions { get; }
Property Value
Type Description
ICollectionView
View Source

SelectedUpdateNumber

Gets or sets the selected bot brain update number.

Declaration
public uint SelectedUpdateNumber { get; set; }
Property Value
Type Description
uint
View Source

StartTime

Gets the time this brain was started, if it is running.

Declaration
public DateTime? StartTime { get; }
Property Value
Type Description
DateTime?

Methods

View Source

CanAppendItems(object)

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

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

The items.

Returns
Type Description
bool

A boolean.

Overrides
BotViewModel.CanAppendItems(object)
View Source

CheckAreActionsEditable()

Updates whether or not the actions are not editable.

Declaration
protected override void CheckAreActionsEditable()
Overrides
BotViewModel.CheckAreActionsEditable()
Remarks

Leave IsClearable = true to allow the user to clear the action queue.

View Source

ClearData()

Clears the history of recommended actions.

Declaration
protected virtual void ClearData()
View Source

Dispose()

Disposes the bot brain client.

Declaration
public override void Dispose()
Overrides
BotViewModel.Dispose()
View Source

HandleBotUpdatedWithoutEventsAvailable(IBrainBotData)

Handles updating UI when a bot is updated by the brain, and it doesn't have events available to notify us of actions it starts or stops.

Declaration
protected virtual void HandleBotUpdatedWithoutEventsAvailable(IBrainBotData data)
Parameters
Type Name Description
IBrainBotData data

The brain bot data.

View Source

HasActionChanged(object?, object)

Determines whether or not an action is new.

Declaration
protected virtual bool HasActionChanged(object? currentAction, object newAction)
Parameters
Type Name Description
object currentAction

The current action.

object newAction

The action which may be new.

Returns
Type Description
bool

True if the action is new.

View Source

OnBotActionFinished(object?, BotActionEventArgs)

Called when a bot action finishes.

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

The sender.

BotActionEventArgs e

Not used.

Overrides
BotViewModel.OnBotActionFinished(object?, BotActionEventArgs)
View Source

OnBotActionStarted(object?, BotActionEventArgs)

Called when a bot action starts.

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

The sender.

BotActionEventArgs e

Not used.

Overrides
BotViewModel.OnBotActionStarted(object?, BotActionEventArgs)
View Source

OnBotUpdated(IBrainBotData)

Called when the brain updates this bot.

Declaration
public virtual void OnBotUpdated(IBrainBotData data)
Parameters
Type Name Description
IBrainBotData data

The brain bot data.

View Source

StartAsync()

Starts the bot.

Declaration
public override Task StartAsync()
Returns
Type Description
Task

A task.

Overrides
BotViewModel.StartAsync()
View Source

StopAsync()

Stops the bot.

Declaration
public override Task StopAsync()
Returns
Type Description
Task

A task.

Overrides
BotViewModel.StopAsync()

Implements

ICanMoveItemsTo
IBotBrainClient
IBotViewModelWithActions
IBotViewModelWithBrain
IBotViewModel
INotifyPropertyChanged
IOnSelected
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