コード例 #1
0
        private ConfigurationPropertyPayload BuildProperty(ConfigurationPropertyModelBase value)
        {
            switch (value)
            {
            case ConfigurationPrimitivePropertyModel input:
                return(BuildProperty(input));

            case ConfigurationPropertyWithOptionsModelDefinition input:
                return(BuildProperty(input));

            case ConfigurationCollectionPropertyDefinition input:
                return(BuildProperty(input));

            default:
                throw new InvalidOperationException($"Could not handle ConfigurationPropertyModelBase of type {value.GetType().Name}");
            }
        }
コード例 #2
0
        private ConfigurationPropertyPayload BuildProperty(ConfigurationPropertyModelBase value, ConfigurationIdentity configIdentity, IEnumerable <ConfigurationSet> requiredConfigurationSets)
        {
            switch (value)
            {
            case ConfigurationPrimitivePropertyModel input:
                return(BuildProperty(input));

            case IOptionPropertyDefinition input:
                return(BuildProperty(input, configIdentity, requiredConfigurationSets));

            case ConfigurationCollectionPropertyDefinition input:
                return(BuildProperty(input, configIdentity, requiredConfigurationSets));

            default:
                throw new InvalidOperationException($"Could not handle ConfigurationPropertyModelBase of type {value.GetType().Name}");
            }
        }
コード例 #3
0
        public string GetPropertyType(ConfigurationPropertyModelBase propertyModel)
        {
            switch (propertyModel)
            {
            case ConfigurationPrimitivePropertyModel input:
                return(GetPropertyType(input));

            case ConfigurationPropertyWithOptionsModelDefinition input:
                return(GetPropertyType(input));

            case ConfigurationCollectionPropertyDefinition input:
                return(GetPropertyType(input));

            default:
                throw new InvalidOperationException($"Could not handle ConfigurationPropertyModelBase of type {propertyModel.GetType().Name}");
            }
        }