private HTTPStreamModifierCondition LoadCondition(NameValueItem nviConditionItem, IEnvironment eEnviornment)
        {
            string strKey = nviConditionItem["conditionKey"][0].Value;
            ISubPlugInDefinition <HTTPStreamModifierCondition> conditionDefinition = (ISubPlugInDefinition <HTTPStreamModifierCondition>)eEnviornment.GetPlugInByKey(strKey);

            if (conditionDefinition != null)
            {
                HTTPStreamModifierCondition htCondition = conditionDefinition.Create(nviConditionItem);
                foreach (NameValueItem nviChild in nviConditionItem["condition"])
                {
                    htCondition.AddChildRule(LoadCondition(nviChild, eEnviornment));
                }
                return(htCondition);
            }

            return(null);
        }
        private NameValueItem SaveCondition(IEnvironment eEnviornment, HTTPStreamModifierCondition cCondition)
        {
            NameValueItem nviRule = null;
            ISubPlugInDefinition <HTTPStreamModifierCondition> ispConditionDefinition = null;

            ispConditionDefinition = GetConditionefinitionForName(eEnviornment, cCondition.Name);

            if (ispConditionDefinition != null)
            {
                nviRule = new NameValueItem("condition", "");
                nviRule.AddChildItem(new NameValueItem("conditionKey", ispConditionDefinition.PluginKey));
                nviRule.AddChildRange(ispConditionDefinition.GetConfiguration(cCondition));
                foreach (HTTPStreamModifierCondition cChild in cCondition.ChildRules)
                {
                    NameValueItem nvi = SaveCondition(eEnviornment, cChild);
                    if (nvi != null)
                    {
                        nviRule.AddChildItem(nvi);
                    }
                }
            }
            return(nviRule);
        }