private void cbxQueueNames_SelectedIndexChanged(object sender, EventArgs e) { try { if (DoActions(QueueQuickEventDefine.ChangeQueueBefore, sender) == false) { return; } BindQueueCall(); DoActions(QueueQuickEventDefine.ChangeQueueBefore, sender); if (_qqc == null) { _qqc = QueueQuickConfig.GetConfig(_moduleName); _qqc.DefaultQueueName = cbxQueueNames.Text; } QueueQuickConfig.SetConfig(_qqc, _moduleName); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
static public QueueQuickConfig GetConfig(string sectionName) { QueueQuickConfig qc = new QueueQuickConfig(); try { SettingItem queueSetting = AppSettingHelper.GetSpecifySection(sectionName); qc.DefaultQueueName = queueSetting.ReadSetting("DefaultQueueName"); } catch (Exception ex) { MsgBox.ShowException(ex); } return(qc); }
static public void SetConfig(QueueQuickConfig qc, string sectionName) { AppSetting.BatchBegin(); try { SettingItem queueSetting = AppSettingHelper.GetSpecifySection(sectionName); queueSetting.WriteSetting("DefaultQueueName", qc.DefaultQueueName); AppSetting.BatchCommit(); } catch (Exception ex) { AppSetting.BatchCancel(); MsgBox.ShowException(ex); } }
public override void ModuleLoaded() { base.ModuleLoaded(); if (cbxQueueNames.Items.Count <= 0) { return; } //读取上次选择的队列 _qqc = QueueQuickConfig.GetConfig(_moduleName); if (string.IsNullOrEmpty(_qqc.DefaultQueueName) == false) { cbxQueueNames.Text = _qqc.DefaultQueueName; } else { cbxQueueNames.SelectedIndex = 0; } }
public void CopyFrom(QueueQuickConfig sourcePar) { this.DefaultQueueName = sourcePar.DefaultQueueName; }