示例#1
0
        private void BuildDynamicComponentPropertyList(string name, IType type)
        {
            ComponentType component = type as ComponentType;

            if (component == null)
            {
                return;
            }

            bool isDynamicComponent = component.ReturnedClass == typeof(IDictionary);

            for (int i = 0; i < component.PropertyNames.Length; i++)
            {
                string fullName = name + "." + component.PropertyNames[i];

                if (isDynamicComponent)
                {
                    var dynamicProperty = new DynamicComponentProperty(component.PropertyNames[i], component.Subtypes[i].ReturnedClass);

                    _caseInsensitiveDynamicProperties[fullName] = dynamicProperty;
                    _caseSensitiveDynamicProperties[fullName]   = dynamicProperty;
                }

                BuildDynamicComponentPropertyList(fullName, component.Subtypes[i]);
            }
        }
        private void BuildDynamicComponentPropertyList(string name, IType type)
        {
            ComponentType component = type as ComponentType;
            if (component == null)
                return;

            bool isDynamicComponent = component.ReturnedClass == typeof(IDictionary);

            for (int i = 0; i < component.PropertyNames.Length; i++)
            {
                string fullName = name + "." + component.PropertyNames[i];

                if (isDynamicComponent)
                {
                    var dynamicProperty = new DynamicComponentProperty(component.PropertyNames[i], component.Subtypes[i].ReturnedClass);

                    _caseInsensitiveDynamicProperties[fullName] = dynamicProperty;
                    _caseSensitiveDynamicProperties[fullName] = dynamicProperty;
                }

                BuildDynamicComponentPropertyList(fullName, component.Subtypes[i]);
            }
        }