Dreamine.Communication.Wpf 1.0.2
Dreamine.Communication.Wpf 통신 기능과 관련 API를 제공합니다.
로딩중...
검색중...
일치하는것 없음
CommunicationChannelViewItem.cs
이 파일의 문서화 페이지로 가기
1using System.ComponentModel;
2using System.Runtime.CompilerServices;
3using Dreamine.Communication.Abstractions.Enums;
4
6
15public sealed class CommunicationChannelViewItem : INotifyPropertyChanged
16{
25 private string _name = string.Empty;
34 private TransportKind _kind;
43 private ConnectionState _state = ConnectionState.Disconnected;
52 private string _description = string.Empty;
53
62 public event PropertyChangedEventHandler? PropertyChanged;
63
72 public string Name
73 {
74 get => _name;
75 set => SetProperty(ref _name, value);
76 }
77
86 public TransportKind Kind
87 {
88 get => _kind;
89 set => SetProperty(ref _kind, value);
90 }
91
100 public ConnectionState State
101 {
102 get => _state;
103 set => SetProperty(ref _state, value);
104 }
105
114 public string Description
115 {
116 get => _description;
117 set => SetProperty(ref _description, value);
118 }
119
160 private void SetProperty<T>(
161 ref T storage,
162 T value,
163 [CallerMemberName] string? propertyName = null)
164 {
165 if (EqualityComparer<T>.Default.Equals(storage, value))
166 {
167 return;
168 }
169
170 storage = value;
171 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
172 }
173}
void SetProperty< T >(ref T storage, T value, [CallerMemberName] string? propertyName=null)