2using System.Threading.Tasks;
41 get => this.connectionState.Value;
44 this.connectionState.Value = value;
45 this.connected.Value = value ==
XmppState.Connected;
50 public override async Task
Start()
55 this.networkModel.OnStateChanged += this.NetworkModel_OnStateChanged;
59 this.ConnectionState = this.networkModel.
State;
60 return Task.CompletedTask;
65 public override async Task
Stop()
67 this.networkModel.OnStateChanged -= this.NetworkModel_OnStateChanged;
71 private Task NetworkModel_OnStateChanged(
object Sender,
XmppState NewState)
77 this.ConnectionState = this.networkModel.
State;
86 return Task.CompletedTask;
97 await h(
this, NewState);
Interaction logic for MainWindow.xaml
static void UpdateGui(GuiDelegate Method)
Calls a method from the Main UI thread.
A model that is sensitive to the connection state.
override async Task Stop()
Stops the model.
bool Connected
If connected or not.
EventHandlerAsync< XmppState > OnStateChanged
Event raised when connection state changes.
override async Task Start()
Starts the model.
XmppState ConnectionState
Current connection state.
ConnectionSensitiveModel()
A model that is sensitive to the connection state.
NetworkModel Network
Network model
virtual async Task StateChanged(XmppState NewState)
Method called when connection state has changed.
XmppState State
Connection state.
Abstract base class for persistant view models
Generic class for properties
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
XmppState
State of XMPP connection.