private void AddModality() { SCPConfig cfg = _mgt.GetSCPConfig(); if (cfg == null) { return; } FormModality frm = new FormModality(null); if (frm.ShowDialog(this) != DialogResult.OK) { return; } Modality modality = frm.Modality; if (modality == null) { return; } cfg.KnownModalities.Add(modality); RefreshModalityList(); SelectModality(modality); RefreshModalityButton(); }
private void SaveSetting() { SCPConfig cfg = _mgt.GetSCPConfig(); if (cfg == null) { return; } cfg.AETitle = this.textBoxAETitle.Text; cfg.Port = (int)this.numericUpDownPort.Value; cfg.MaxPduLength = (int)this.numericUpDownPDULength.Value; cfg.AssociationTimeOut = (int)this.numericUpDownTimeOut.Value; cfg.EnableModalityChecking = this.radioButtonNotAllowAll.Checked; cfg.EnableAETitleChecking = this.checkBoxEnableAETitleChecking.Checked; }
private void LoadSetting() { SCPConfig cfg = _mgt.GetSCPConfig(); if (cfg == null) { return; } this.textBoxAETitle.Text = cfg.AETitle; this.numericUpDownPort.Value = cfg.Port; this.numericUpDownPDULength.Value = cfg.MaxPduLength; this.numericUpDownTimeOut.Value = cfg.AssociationTimeOut; this.radioButtonNotAllowAll.Checked = cfg.EnableModalityChecking; this.checkBoxEnableAETitleChecking.Checked = cfg.EnableAETitleChecking; RefreshModalityList(); RefreshModalityButton(); }
private void DeleteModality() { SCPConfig cfg = _mgt.GetSCPConfig(); if (cfg == null) { return; } Modality modality = GetSelectedModality(); if (modality == null) { return; } cfg.KnownModalities.Remove(modality); RefreshModalityList(); RefreshModalityButton(); }
private void RefreshModalityList() { SCPConfig cfg = _mgt.GetSCPConfig(); if (cfg == null) { return; } int index = 1; this.listViewModality.Items.Clear(); foreach (Modality mod in cfg.KnownModalities) { ListViewItem item = this.listViewModality.Items.Add((index++).ToString()); item.SubItems.Add(mod.AETitle); item.SubItems.Add(mod.IPAddress); //item.SubItems.Add(mod.Port.ToString()); item.SubItems.Add(mod.Description); item.Tag = mod; } }