public static void UpdateConfiguration(
            string routineNamespace,
            string routineClass,
            string routineMember,
            string routineFor,
            string resolvableNamespace,
            string resolvableType,
            string resolvableValue,
            string sectionName = key)
        {
            var               routinesConfigurationSection = (RoutinesConfigurationSection)ConfigurationManager.GetSection(sectionName);
            RoutineElement    ourRoutineElement            = null;
            ResolvableElement ourResolvableElement         = null;

            foreach (RoutineElement routineElement in routinesConfigurationSection.Routines)
            {
                if (StringExtensions.AsterixEquals(routineNamespace, routineElement.Namespace))
                {
                    if (StringExtensions.AsterixEquals(routineClass, routineElement.Type))
                    {
                        if (StringExtensions.AsterixEquals(routineMember, routineElement.Member))
                        {
                            if (StringExtensions.AsterixEquals(routineFor, routineElement.For))
                            {
                                ourRoutineElement = routineElement;
                                foreach (ResolvableElement resolvableElement in routineElement.Resolvables)
                                {
                                    if (StringExtensions.AsterixEquals(resolvableNamespace, resolvableElement.Namespace))
                                    {
                                        if (StringExtensions.AsterixEquals(resolvableType, resolvableElement.Type))
                                        {
                                            ourResolvableElement = resolvableElement;
                                            break;
                                        }
                                    }
                                }
                                break;
                            }
                        }
                    }
                }
            }
            if (ourRoutineElement == null)
            {
                ourRoutineElement = new RoutineElement()
                {
                    Namespace = routineNamespace, Type = routineClass, Member = routineMember, For = routineFor
                };
                ourRoutineElement.Validate();
                routinesConfigurationSection.Routines.Add(ourRoutineElement);
            }
            if (ourResolvableElement == null)
            {
                ourResolvableElement = new ResolvableElement()
                {
                    Namespace = resolvableNamespace, Type = resolvableType, Value = resolvableValue
                };
                ourResolvableElement.Validate();
                ourRoutineElement.Resolvables.Add(ourResolvableElement);
            }
            else
            {
                ourResolvableElement.Value = resolvableValue;
            }
        }
 public void Add(RoutineElement value)
 {
     base.BaseAdd(value);
 }
 public void Remove(RoutineElement value)
 {
     BaseRemove(value);
 }
Beispiel #4
0
 public RoutineElementDebugView(RoutineElement routineElement) =>
 this.routineElement = routineElement;