Class DeviceManagementViewModel
View model for device management.
Inheritance
Namespace: Phoenix.DeviceManagement
Assembly: Phoenix.dll
Syntax
public class DeviceManagementViewModel : ViewModelBase<DeviceManagementView>, IDeviceViewProvider
Constructors
View SourceDeviceManagementViewModel(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 SourceChangeSelectionCommand
Gets the command for changing selection.
Declaration
public DelegateCommand<ICollection<object>> ChangeSelectionCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<System.Collections.Generic.ICollection<System.Object>> |
CopyDeviceIpCommand
Gets the command that copies the selected devices' IP to the clipboard.
Declaration
public DelegateCommand CopyDeviceIpCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
CopyNodeCommand
Gets the command for copying a node.
Declaration
public DelegateCommand<GroupControlModel> CopyNodeCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<GroupControlModel> |
Dispatcher
Gets the dispatcher that this DataModel is bound to.
Declaration
public Dispatcher Dispatcher { get; }
Property Value
Type | Description |
---|---|
System.Windows.Threading.Dispatcher |
MoveNodeCommand
Gets the command for moving a node.
Declaration
public DelegateCommand<GroupControlModel> MoveNodeCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<GroupControlModel> |
RemoveGroupCommand
Gets the command that removes a group.
Declaration
public DelegateCommand RemoveGroupCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
RenameGroupCommand
Gets the command that renames a group.
Declaration
public DelegateCommand RenameGroupCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
Root
Gets the root GroupControlModel where ungrouped nodes are located.
Declaration
public GroupControlModel Root { get; }
Property Value
Type | Description |
---|---|
GroupControlModel |
SelectedNodes
Gets a collection of the currently selected nodes.
Declaration
public ReadOnlyCollection<DeviceListNodeViewModel> SelectedNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<DeviceListNodeViewModel> |
ShowAddDeviceWindowCommand
Gets the command that shows the "Add New Device" window.
Declaration
public DelegateCommand ShowAddDeviceWindowCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
ShowAddGroupWindowCommand
Gets the command that shows the "Add New Group" window.
Declaration
public DelegateCommand ShowAddGroupWindowCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
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> |
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 SourceAddDevice(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. |
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. |
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. |
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 |
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. |
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. |
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. |
OnClosed()
Called when the application is closed.
Declaration
protected override void OnClosed()
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. |