Beispiel #1
0
 public ResolvableElementDebugView(ResolvableElement resolvableElement) =>
 this.resolvableElement = resolvableElement;
        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;
            }
        }
Beispiel #3
0
 public void Add(ResolvableElement value)
 {
     base.BaseAdd(value);
 }