コード例 #1
0
        private object GetPropertyValue(object source, ConfigurationClassPropertyDefinition propertyModel)
        {
            var nestedProperty = propertyModel.GetPropertyValue(source);

            if (nestedProperty == null)
            {
                nestedProperty = propertyModel.NewItemInstance();
            }
            var itemValue = BuildObject(nestedProperty, propertyModel.ConfigurationProperties);

            return(itemValue);
        }
コード例 #2
0
        private object GetConfigPropertyValueFromInput(JObject source, ConfigurationClassPropertyDefinition propertyModel, ConfigurationIdentity configIdentity, IEnumerable <ConfigurationSet> requiredConfigurationSets)
        {
            var propertySource = (JObject)source.GetValue(propertyModel.ConfigurationPropertyName.ToLowerCamelCase());

            if (propertySource == null)
            {
                return(null);
            }
            var result = propertyModel.NewItemInstance();

            return(UpdateObject(result, propertySource, propertyModel.ConfigurationProperties, configIdentity, requiredConfigurationSets));
        }