public void modify_rule(
		LocalLBRuleRuleDefinition [] rules
	)
        {
            this.Invoke("modify_rule", new object [] {
                rules});
        }
        public void create(
		LocalLBRuleRuleDefinition [] rules
	)
        {
            this.Invoke("create", new object [] {
                rules});
        }
        private bool DoSaveNodeLTM(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)
                {
                    bool bValid = DoSanityCheck(sRuleDef);
                    if (bValid)
                    {
                        if (sRuleDef.Length > 0)
                        {
                            iControl.LocalLBRuleRuleDefinition[] rule_defs = new iControl.LocalLBRuleRuleDefinition[1];
                            rule_defs[0] = new iControl.LocalLBRuleRuleDefinition();
                            rule_defs[0].rule_name = sRule;
                            rule_defs[0].rule_definition = sRuleDef;

                            try
                            {
                                Clients.Rule.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.Rule.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("iRule failed Sanity Check.", "Nice Try...");
                    }
                }

            }
            else
            {
                MessageBox.Show("You must select a rule to save", "Error");
            }
            if (bSaved)
            {
                setStatus("iRule successfully saved.", getStatusVisible());
            }
            return bSaved;
        }
 public System.IAsyncResult Beginmodify_rule(LocalLBRuleRuleDefinition [] rules, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("modify_rule", new object[] {
     rules}, callback, asyncState);
 }
        private void DoParseLTM()
        {
            String sRule = "iRuler_Parse_Test_Rule";
            String sRuleDef = m_textEditor.Text;

            iControl.LocalLBRuleRuleDefinition[] rule_defs = new iControl.LocalLBRuleRuleDefinition[1];
            rule_defs[0] = new iControl.LocalLBRuleRuleDefinition();
            rule_defs[0].rule_name = sRule;
            rule_defs[0].rule_definition = sRuleDef;
            try
            {
                Clients.Rule.delete_rule(new string[] { sRule });
            }
            catch (Exception)
            {
            }
            try
            {
                Clients.Rule.create(rule_defs);
                Clients.Rule.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);
            }
        }