-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComputerModel.cs
51 lines (44 loc) · 1.22 KB
/
ComputerModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text;
using RDPShadow.Annotations;
using RDPShadow.Entities;
namespace RDPShadow
{
public class ComputerModel : INotifyPropertyChanged
{
private LoadingStatus _status;
public ComputerModel(Computer computer)
{
Computer = computer;
}
public Computer Computer { get; }
public string Name => Computer.Name;
public string DistinguishedName => Computer.DistinguishedName;
public LoadingStatus Status
{
get => _status;
set
{
if (value == _status) return;
_status = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public enum LoadingStatus
{
None,
Loading,
Failed,
Done
}
}