/// <summary> /// Loads data to UI. /// </summary> private void LoadData() { try{ FetchMessages_Settings settings = m_pVirtualServer.SystemSettings.FetchMessages; m_pEnabled.Checked = settings.Enabled; m_pFetchInterval.Value = settings.FetchInterval; } catch (Exception x) { wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace()); frm.ShowDialog(this); } }
private void LoadData() { try { FetchMessages_Settings fetchMessages = this.m_pVirtualServer.SystemSettings.FetchMessages; this.m_pEnabled.Checked = fetchMessages.Enabled; this.m_pFetchInterval.Value = fetchMessages.FetchInterval; } catch (Exception x) { ErrorForm errorForm = new ErrorForm(x, new StackTrace()); errorForm.ShowDialog(this); } }
private void SaveData(bool confirmSave) { try { FetchMessages_Settings fetchMessages = this.m_pVirtualServer.SystemSettings.FetchMessages; fetchMessages.Enabled = this.m_pEnabled.Checked; fetchMessages.FetchInterval = (int)this.m_pFetchInterval.Value; if (this.m_pVirtualServer.SystemSettings.HasChanges && (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)) { this.m_pVirtualServer.SystemSettings.Commit(); } } catch (Exception x) { ErrorForm errorForm = new ErrorForm(x, new StackTrace()); errorForm.ShowDialog(this); } }
/// <summary> /// Saves data. /// </summary> /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param> private void SaveData(bool confirmSave) { try{ FetchMessages_Settings settings = m_pVirtualServer.SystemSettings.FetchMessages; settings.Enabled = m_pEnabled.Checked; settings.FetchInterval = (int)m_pFetchInterval.Value; if (m_pVirtualServer.SystemSettings.HasChanges) { if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { m_pVirtualServer.SystemSettings.Commit(); } } } catch (Exception x) { wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace()); frm.ShowDialog(this); } }