public void AddRuleToTable(string [] displayObjectArray, PolicyCustomRules customRule, bool warnUser) { // Attach the int row number we added it to customRule.RowNumber = this.rulesDataGrid.RowCount - 1; string action = displayObjectArray[0]; string level = displayObjectArray[1]; string name = warnUser ? "*Hash* " + displayObjectArray[2] : displayObjectArray[2]; string files = displayObjectArray[3]; string exceptions = displayObjectArray[4]; // Add to the DisplayObject this.displayObjects.Add(new DisplayObject(action, level, name, files, exceptions)); this.rulesDataGrid.RowCount += 1; // Add custom list to RulesList this.Policy.CustomRules.Add(customRule); // Scroll to bottom to see new rule added to list this.rulesDataGrid.FirstDisplayedScrollingRowIndex = this.rulesDataGrid.RowCount - 1; bubbleUp(); // close the custom Rule Conditions Panel this.customRuleConditionsPanel.Close(); this.customRuleConditionsPanel = null; // this.label_AddCustomRules.Text = "+ Custom Rules"; }
public Exceptions_Control(CustomRuleConditionsPanel pRuleConditionsPanel) { InitializeComponent(); this.ExceptionRule = new PolicyCustomRules(); this.Log = pRuleConditionsPanel.Log; this.CustomRule = pRuleConditionsPanel.PolicyCustomRule; this.ConditionsPanel = pRuleConditionsPanel; }
//private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) /// <summary> /// Shows the Custom Rules Panel when the user clicks on +Custom Rules. /// </summary> private void label_AddCustomRules_Click(object sender, EventArgs e) { // Open the custom rules conditions panel if (this.customRuleConditionsPanel == null) { this.customRuleConditionsPanel = new CustomRuleConditionsPanel(this); this.customRuleConditionsPanel.Show(); this.customRuleConditionsPanel.BringToFront(); this.customRuleConditionsPanel.Focus(); // this.label_AddCustomRules.Text = "- Custom Rules"; } this.Log.AddInfoMsg("--- Create Custom Rules Selected ---"); }
public void CustomRulesPanel_Closing() { // User has closed custom rules panel. Reset panel and text this.customRuleConditionsPanel = null; // this.label_AddCustomRules.Text = "+ Custom Rules"; }