Show / Hide Table of Contents

Class DeviceManagementViewModel

View model for device management.

Inheritance
System.Object
DeviceManagementViewModel
Implements
IDeviceViewProvider
IViewProvider
Namespace: Phoenix.DeviceManagement
Assembly: Phoenix.dll
Syntax
public class DeviceManagementViewModel : ViewModelBase<DeviceManagementView>, IDeviceViewProvider

Constructors

View Source

DeviceManagementViewModel(DeviceManagementView, IWindowingControl, IEventAggregator, IPhoenixLogger, IDeviceManager, IDeviceCommandManager, IDeviceConfigManager, IWindowManager)

Initializes a new instance of the DeviceManagementViewModel class.

Declaration
public DeviceManagementViewModel(DeviceManagementView view, IWindowingControl windowing, IEventAggregator eventAggregator, IPhoenixLogger logger, IDeviceManager deviceManager, IDeviceCommandManager commandManager, IDeviceConfigManager deviceConfigManager, IWindowManager windowManager)
Parameters
Type Name Description
DeviceManagementView view

The view this view model is driving.

IWindowingControl windowing
IEventAggregator eventAggregator

The event aggregator for the application.

IPhoenixLogger logger

The logger for the application.

IDeviceManager deviceManager

The device manager.

IDeviceCommandManager commandManager

The device command manager.

IDeviceConfigManager deviceConfigManager
IWindowManager windowManager

Properties

View Source

ChangeSelectionCommand

Gets the command for changing selection.

Declaration
public DelegateCommand<ICollection<object>> ChangeSelectionCommand { get; }
Property Value
Type Description
DelegateCommand<System.Collections.Generic.ICollection<System.Object>>
View Source

CopyDeviceIpCommand

Gets the command that copies the selected devices' IP to the clipboard.

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

CopyNodeCommand

Gets the command for copying a node.

Declaration
public DelegateCommand<GroupControlModel> CopyNodeCommand { get; }
Property Value
Type Description
DelegateCommand<GroupControlModel>
View Source

Dispatcher

Gets the dispatcher that this DataModel is bound to.

Declaration
public Dispatcher Dispatcher { get; }
Property Value
Type Description
System.Windows.Threading.Dispatcher
View Source

MoveNodeCommand

Gets the command for moving a node.

Declaration
public DelegateCommand<GroupControlModel> MoveNodeCommand { get; }
Property Value
Type Description
DelegateCommand<GroupControlModel>
View Source

RemoveGroupCommand

Gets the command that removes a group.

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

RenameGroupCommand

Gets the command that renames a group.

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

Root

Gets the root GroupControlModel where ungrouped nodes are located.

Declaration
public GroupControlModel Root { get; }
Property Value
Type Description
GroupControlModel
View Source

SelectedNodes

Gets a collection of the currently selected nodes.

Declaration
public ReadOnlyCollection<DeviceListNodeViewModel> SelectedNodes { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<DeviceListNodeViewModel>
View Source

ShowAddDeviceWindowCommand

Gets the command that shows the "Add New Device" window.

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

ShowAddGroupWindowCommand

Gets the command that shows the "Add New Group" window.

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

ValidCopyTargets

Gets a collection of valid group models that all the currently selected nodes can be copied to.

Declaration
public ObservableCollection<GroupControlModel> ValidCopyTargets { get; }
Property Value
Type Description
System.Collections.ObjectModel.ObservableCollection<GroupControlModel>
View Source

ValidMoveTargets

Gets a collection of valid group models that all the currently selected nodes can be moved to.

Declaration
public ObservableCollection<GroupControlModel> ValidMoveTargets { get; }
Property Value
Type Description
System.Collections.ObjectModel.ObservableCollection<GroupControlModel>

Methods

View Source

AddDevice(String, String)

Adds a device.

Declaration
public void AddDevice(string device, string factory)
Parameters
Type Name Description
System.String device

The device address or DNS name.

System.String factory

The device type factory.

View Source

CanMoveNodesToGroup(IEnumerable<DeviceListNodeViewModel>, GroupControlModel, Boolean)

Gets a value indicating whether or not the nodes can be moved (or copied) to the specified group.

Declaration
public bool CanMoveNodesToGroup(IEnumerable<DeviceListNodeViewModel> nodes, GroupControlModel group, bool copy)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<DeviceListNodeViewModel> nodes

The nodes being checked for move validity

GroupControlModel group

The group to check for the nodes to move into

System.Boolean copy

A value representing the move is a copy and not a move.

Returns
Type Description
System.Boolean

Whether or not the nodes can be moved (or copied) to the group.

View Source

CreateNewGroupInSelection(String)

Creates a new group and adds it to the selected group if possible.

Declaration
public void CreateNewGroupInSelection(string groupName)
Parameters
Type Name Description
System.String groupName

The name of the new group.

View Source

FindContainingGroup(DeviceListNodeViewModel)

Finds the GroupControlModel that contains the specified node.

Declaration
public GroupControlModel FindContainingGroup(DeviceListNodeViewModel node)
Parameters
Type Name Description
DeviceListNodeViewModel node

The node whose parent is to be found.

Returns
Type Description
GroupControlModel

The node's parent, or null

View Source

MoveNodesToGroup(IEnumerable<DeviceListNodeViewModel>, GroupControlModel)

Moves the nodes to the specified group.

Declaration
public void MoveNodesToGroup(IEnumerable<DeviceListNodeViewModel> nodes, GroupControlModel group)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<DeviceListNodeViewModel> nodes

The nodes to move to the group.

GroupControlModel group

The group to move the nodes into.

View Source

MoveNodesToGroup(IEnumerable<DeviceListNodeViewModel>, GroupControlModel, Boolean)

Moves (or copies) the nodes to the specified group.

Declaration
public void MoveNodesToGroup(IEnumerable<DeviceListNodeViewModel> nodes, GroupControlModel group, bool copy)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<DeviceListNodeViewModel> nodes

The nodes to move to the group.

GroupControlModel group

The group to move the nodes into.

System.Boolean copy

If true, the nodes are copied into the group instead of moved.

View Source

NotifyDrop(DeviceListNodeViewModel, IDataObject, DragDropKeyStates)

Notifies the listeners that a drag and drop event just fired.

Declaration
public void NotifyDrop(DeviceListNodeViewModel targetNode, IDataObject data, DragDropKeyStates state)
Parameters
Type Name Description
DeviceListNodeViewModel targetNode

The node that the drag and drop was happening on

System.Windows.IDataObject data

The data object containing the drop information.

System.Windows.DragDropKeyStates state

The state of the modifier keys when the drop took place.

View Source

OnClosed()

Called when the application is closed.

Declaration
protected override void OnClosed()
View Source

RemoveAllDeviceModels(IDevice)

Removes all device models that match the passed device.

Declaration
public void RemoveAllDeviceModels(IDevice device)
Parameters
Type Name Description
IDevice device

The device which is being removed.

Implements

IDeviceViewProvider
IViewProvider
  • View Source
In This Article
Back to top Generated by DocFX