public System.IAsyncResult Begincreate(GlobalLBRuleRuleDefinition [] rules, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("create", new object[] { rules}, callback, asyncState); }
public void modify_rule( GlobalLBRuleRuleDefinition [] rules ) { this.Invoke("modify_rule", new object [] { rules}); }
private bool DoSaveNodeGTM(TreeNode tn) { bool bSaved = false; if ((null != tn) && (null != tn.Tag)) { iRuleInfo iri = (iRuleInfo)tn.Tag; String sRule = iri.rule_name; //String sRuleDef = m_textEditor.Text; String sRuleDef = iri.rule_details.Trim(); if (iri.modified) { if (sRuleDef.Length > 0) { iControl.GlobalLBRuleRuleDefinition[] rule_defs = new iControl.GlobalLBRuleRuleDefinition[1]; rule_defs[0] = new iControl.GlobalLBRuleRuleDefinition(); rule_defs[0].rule_name = sRule; rule_defs[0].rule_definition = sRuleDef; try { Clients.GlobalLBRule.create(rule_defs); iri.rule_details = sRuleDef; iri.original_rule_details = sRuleDef; markItem(tn, false); bSaved = true; } catch (Exception ex) { // Check to see if rule doesn't exist and they try to create it. if (-1 != ex.Message.IndexOf("already exists")) { try { Clients.GlobalLBRule.modify_rule(rule_defs); iri.rule_details = sRuleDef; iri.original_rule_details = sRuleDef; bSaved = true; markItem(tn, false); } catch (Exception ex1) { treeView_iRules.SelectedNode = tn; bookmarksFromStatus(ex1.Message); } } else { treeView_iRules.SelectedNode = tn; bookmarksFromStatus(ex.Message); } } } else { MessageBox.Show("Your iRule must contain more than whitespace characters.", "Nice Try..."); } } } else { MessageBox.Show("You must select a rule to save", "Error"); } if (bSaved) { setStatus("iRule successfully saved.", getStatusVisible()); } return bSaved; }
public void create( GlobalLBRuleRuleDefinition [] rules ) { this.Invoke("create", new object [] { rules}); }
private void DoParseGTM() { String sRule = "iRuler_Parse_Test_Rule"; String sRuleDef = m_textEditor.Text; iControl.GlobalLBRuleRuleDefinition[] rule_defs = new iControl.GlobalLBRuleRuleDefinition[1]; rule_defs[0] = new iControl.GlobalLBRuleRuleDefinition(); rule_defs[0].rule_name = sRule; rule_defs[0].rule_definition = sRuleDef; try { Clients.GlobalLBRule.delete_rule(new string[] { sRule }); } catch (Exception) { } try { Clients.GlobalLBRule.create(rule_defs); Clients.GlobalLBRule.delete_rule(new string[] { sRule }); MessageBox.Show("The text is a valid iRule!", "Success", MessageBoxButtons.OK); setStatus("The text is a valid iRule!", getStatusVisible()); } catch (Exception ex) { //MessageBox.Show("Parse Failure", "Parse Failure", MessageBoxButtons.OK); //setStatus(ex.Message, true); bookmarksFromStatus(ex.Message); } }