示例#1
0
        /// <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[] { "" }));
        }
示例#2
0
        /// <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;
            }
        }
示例#3
0
        /// <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 });
        }