public CecSettings() { // Read MediaPortal config _config = new CecConfig(); try { _config.ReadConfig(); } catch (Exception exp) { MessageBox.Show("Error while reading configuration from MediaPortal.xml" + exp.ToString()); } InitializeComponent(); AddBindings(); }
private void PrepareClient() { if (_client == null) { _client = new CecRemoteClient(); } if (_config == null) { _config = new CecConfig(); try { _config.ReadConfig(); _client.SetConfig(_config); } catch (Exception ex) { Log.Error("CecRemote: Error while reading config. " + ex.ToString()); // Defaults will be used automatically if config reading fails, so we can still try to connect. } } }