public bool HasCurrentCrmConnection(out ConnectionConfiguration connectionConfig) { bool result = false; connectionConfig = ConnectionConfiguration.Get(); if (connectionConfig.CurrentConnectionData == null) { this.WriteToOutput(null, Properties.OutputStrings.CurrentCrmConnectionIsNotSelected); this.ActivateOutputWindow(null); var crmConnection = new WindowCrmConnectionList(this, connectionConfig, true); crmConnection.ShowDialog(); connectionConfig.Save(); } result = connectionConfig.CurrentConnectionData != null; return(result); }
public void HandleConnectionOpenList() { ConnectionConfiguration connectionConfig = ConnectionConfiguration.Get(); var thread = new System.Threading.Thread(() => { try { var form = new WindowCrmConnectionList(this, connectionConfig); form.ShowDialog(); connectionConfig.Save(); } catch (Exception ex) { DTEHelper.WriteExceptionToOutput(null, ex); } }); thread.SetApartmentState(System.Threading.ApartmentState.STA); thread.Start(); }