private void SIPProvidersDataGrid_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { try { if (m_riaContext.SIPProviders.Count() > 0) { DataGrid dataGrid = (DataGrid)sender; if (dataGrid.CurrentColumn.Header as string != "Delete") { SIPProvider sipProvider = (SIPProvider)m_sipProvidersDataGrid.SelectedItem; if (m_selectedSIPProvider == null || m_selectedSIPProvider != sipProvider) { m_selectedSIPProvider = sipProvider; m_editControl = new SIPProviderDetailsControl(DetailsControlModesEnum.Edit, m_selectedSIPProvider, m_owner, null, UpdateSIPProvider, DetailsControlClosed); m_sipProvidersPanel.SetDetailsElement(m_editControl); } } } } catch (Exception excp) { string excpMessage = (excp.InnerException != null) ? excp.InnerException.Message : excp.Message; LogActivityMessage_External(MessageLevelsEnum.Error, "Exception showing SIP Provider details. " + excpMessage); m_selectedSIPProvider = null; } }
private void SIPProvidersPanel_Add() { m_selectedSIPProvider = null; m_addControl = new SIPProviderDetailsControl(DetailsControlModesEnum.Add, m_selectedSIPProvider, m_owner, SIPProviderAdd, null, DetailsControlClosed); m_sipProvidersPanel.SetDetailsElement(m_addControl); }