public void SendConfigurationUpdate(ConfigurationUpdateMessage message) { try { MMConfiguration.Reload(_watchToken); if (isConnected()) { _client.Send(message); } // Publish configuration to handlers (See feedback window) _messageHandler.Consume(MMConfiguration); if (!message.RequiresRestart) { return; } setConnectedFromConfiguration(message.LocalFile); notifyAboutConnectedState(); } catch (Exception ex) { Logger.Write(ex); } }
public void Connect(int port, IConnectHandlers handler, IMessageHandlers messageHandler, bool startPaused, string watchToken) { _watchToken = watchToken; MMConfiguration.Reload(_watchToken); _connectHandler = handler; _messageHandler = messageHandler; _messageHandler.Consume(MMConfiguration); _client = new NetClient(this); _port = port; _client = new NetClient(this); _client.MessageReceived += new EventHandler <MessageReceivedEventArgs>(_client_MessageReceived); _connectHandler.Connecting(port, startPaused); var thread = new Thread(connect); thread.Start(); }