/// <summary> /// Initializes a new instance of the <see cref="SettingsModel"/> class. /// </summary> public SettingsModel() { GUIClient client = GUIClient.GetInstance(); client.MessageReceived += MessageFromServer; Task.Run(() => client.SendMessageToServer(CommandEnum.GetConfigCommand, new string[] { "" })); }
/// <summary> /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class. /// </summary> public MainWindowViewModel() { GUIClient client = GUIClient.GetInstance(); ServerConnected = GUIClient.isConnected; client.CheckConnection += CheckConnection; WindowColor = Brushes.Gray; if (ServerConnected) { WindowColor = Brushes.MediumVioletRed; } }
/// <summary> /// Sends the message to server. /// </summary> /// <param name="commandID">The command identifier.</param> /// <param name="args">The arguments.</param> public override void SendMessageToServer(CommandEnum commandID, string args) { GUIClient client = GUIClient.GetInstance(); client.SendMessageToServer(commandID, new string[] { args }); }