private void grpDsp1_SelectionChange(GroupDisplayer sender) { Logger.EnteringMethod(); int total = sender.SelectedRules.Count + sender.SelectedGroups.Count; btnEdit.Enabled = (total == 1); btnDelete.Enabled = (total > 0); btnSaveRules.Enabled = (total > 0); if (sender.SelectedGroups.Count == 1) { btnAddAndGroup.Enabled = true; btnAddOrGroup.Enabled = true; btnAddRule.Enabled = true; btnLoadRules.Enabled = true; if (sender.Equals(grpDspPackageLevel)) { _currentGroupPackageLevel = sender.SelectedGroups[0]; } else { _currentGroupUpdateLevel = sender.SelectedGroups[0]; } } else { btnAddAndGroup.Enabled = false; btnAddOrGroup.Enabled = false; btnAddRule.Enabled = false; btnLoadRules.Enabled = false; } }
private void grpDsp1_EditionRequest(GroupDisplayer sender) { Logger.EnteringMethod(); sender.InnerGroup.Edit(); if (sender.Equals(grpDspUpdateLevel)) { grpDspUpdateLevel.Initialize(_masterGroupUpdateLevel); } else { grpDspPackageLevel.Initialize(_masterGroupPackageLevel); } }
private void grpDisplayer_SelectionChange(GroupDisplayer sender) { UpdateSelectedRulesAndGroupsList(); }
private void Display() { tlpRulesAndGroups.Controls.Clear(); tlpRulesAndGroups.AutoScroll = false; tlpRulesAndGroups.VerticalScroll.Enabled = true; tlpRulesAndGroups.VerticalScroll.Visible = true; tlpRulesAndGroups.HorizontalScroll.Enabled = false; tlpRulesAndGroups.HorizontalScroll.Visible = false; //tlpRulesAndGroups.SuspendLayout(); _innerGroupDisplayers.Clear(); rtbxStart.Text = ""; rtbxEnd.Text = ""; if (InnerGroup.GroupType == RulesGroup.GroupLogicalOperator.And) { print(rtbxStart, normalFont, green, resMan.GetString("GroupStart")); print(rtbxStart, boldFont, black, resMan.GetString("RuleAnd")); print(rtbxStart, normalFont, green, ">"); } else { print(rtbxStart, normalFont, green, resMan.GetString("GroupStart")); print(rtbxStart, boldFont, black, resMan.GetString("RuleOR")); print(rtbxStart, normalFont, green, ">"); } foreach (GenericRule rule in InnerGroup.InnerRules.Values) { RuleDisplayer tempRuleDisplayer = new RuleDisplayer(rule); tempRuleDisplayer.SelectedChange += new RuleDisplayer.SelectedChangeEventHandler(Rule_SelectedChange); tempRuleDisplayer.EditionRequested += new RuleDisplayer.EditionRequestedEventHandler(Rule_EditionRequested); tlpRulesAndGroups.Controls.Add(tempRuleDisplayer); } foreach (RulesGroup group in InnerGroup.InnerGroups.Values) { GroupDisplayer grpDisplayer = new GroupDisplayer(); grpDisplayer.Dock = DockStyle.Top; _innerGroupDisplayers.Add(grpDisplayer); grpDisplayer.SelectionChange += new SelectionChangeEventHandler(grpDisplayer_SelectionChange); grpDisplayer.EditionRequest += new EditionRequestEventHandler(grpDisplayer_EditionRequest); grpDisplayer.RuleEditionRequest += new RuleEditionRequestEventHandler(Rule_EditionRequested); tlpRulesAndGroups.Controls.Add(grpDisplayer); grpDisplayer.Initialize(group); } if (InnerGroup.GroupType == RulesGroup.GroupLogicalOperator.And) { print(rtbxEnd, normalFont, green, resMan.GetString("GroupEnd")); print(rtbxEnd, boldFont, black, resMan.GetString("RuleAnd")); print(rtbxEnd, normalFont, green, ">"); } else { print(rtbxEnd, normalFont, green, resMan.GetString("GroupEnd")); print(rtbxEnd, boldFont, black, resMan.GetString("RuleOR")); print(rtbxEnd, normalFont, green, ">"); } //tlpRulesAndGroups.ResumeLayout(); //tableLayoutPanel1.PerformLayout(); tlpRulesAndGroups.AutoScroll = true; //tableLayoutPanel1.Refresh(); }
void grpDisplayer_EditionRequest(GroupDisplayer sender) { sender.InnerGroup.Edit(); sender.Initialize(sender.InnerGroup); }