Beispiel #1
0
        internal static EnhancedTimeSpan GetTimespanValueFromMultivaluedProperty(string name, IEnumerable <string> property, EnhancedTimeSpan defaultValue)
        {
            string stringValueFromMultivaluedProperty = MultivaluedPropertyAccessors.GetStringValueFromMultivaluedProperty(name, property, null);

            if (string.IsNullOrEmpty(stringValueFromMultivaluedProperty))
            {
                return(defaultValue);
            }
            EnhancedTimeSpan result;

            if (EnhancedTimeSpan.TryParse(stringValueFromMultivaluedProperty, out result))
            {
                return(result);
            }
            return(defaultValue);
        }
Beispiel #2
0
        internal static Version GetVersionValueFromMultivaluedProperty(string name, IEnumerable <string> property, Version defaultValue)
        {
            string stringValueFromMultivaluedProperty = MultivaluedPropertyAccessors.GetStringValueFromMultivaluedProperty(name, property, null);

            if (string.IsNullOrEmpty(stringValueFromMultivaluedProperty))
            {
                return(defaultValue);
            }
            Version result;

            if (Version.TryParse(stringValueFromMultivaluedProperty, out result))
            {
                return(result);
            }
            return(defaultValue);
        }
Beispiel #3
0
        internal static ByteQuantifiedSize GetByteQuantifiedValueFromMultivaluedProperty(string name, IEnumerable <string> property, ByteQuantifiedSize defaultValue)
        {
            string stringValueFromMultivaluedProperty = MultivaluedPropertyAccessors.GetStringValueFromMultivaluedProperty(name, property, null);

            if (string.IsNullOrEmpty(stringValueFromMultivaluedProperty))
            {
                return(defaultValue);
            }
            ByteQuantifiedSize result;

            if (ByteQuantifiedSize.TryParse(stringValueFromMultivaluedProperty, out result))
            {
                return(result);
            }
            return(defaultValue);
        }
Beispiel #4
0
        internal static int GetIntValueFromMultivaluedProperty(string name, IEnumerable <string> property, int defaultValue)
        {
            string stringValueFromMultivaluedProperty = MultivaluedPropertyAccessors.GetStringValueFromMultivaluedProperty(name, property, null);

            if (string.IsNullOrEmpty(stringValueFromMultivaluedProperty))
            {
                return(defaultValue);
            }
            int result;

            if (int.TryParse(stringValueFromMultivaluedProperty, out result))
            {
                return(result);
            }
            return(defaultValue);
        }
Beispiel #5
0
 internal static void TransportRuleRegexValidationTimeoutSetter(object value, IPropertyBag propertyBag)
 {
     MultivaluedPropertyAccessors.UpdateMultivaluedProperty <EnhancedTimeSpan>((EnhancedTimeSpan)value, TransportConfigContainerSchema.TransportRuleRegexValidationTimeout.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig]);
 }
Beispiel #6
0
 internal static void TransportRuleAttachmentTextScanLimitSetter(object value, IPropertyBag propertyBag)
 {
     MultivaluedPropertyAccessors.UpdateMultivaluedProperty <ByteQuantifiedSize>((ByteQuantifiedSize)value, TransportConfigContainerSchema.TransportRuleAttachmentTextScanLimit.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig]);
 }
Beispiel #7
0
 internal static object TransportRuleRegexValidationTimeoutGetter(IPropertyBag propertyBag)
 {
     return(MultivaluedPropertyAccessors.GetTimespanValueFromMultivaluedProperty(TransportConfigContainerSchema.TransportRuleRegexValidationTimeout.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig], (EnhancedTimeSpan)TransportConfigContainerSchema.TransportRuleRegexValidationTimeout.DefaultValue));
 }
Beispiel #8
0
 internal static object TransportRuleAttachmentTextScanLimitGetter(IPropertyBag propertyBag)
 {
     return(MultivaluedPropertyAccessors.GetByteQuantifiedValueFromMultivaluedProperty(TransportConfigContainerSchema.TransportRuleAttachmentTextScanLimit.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig], (ByteQuantifiedSize)TransportConfigContainerSchema.TransportRuleAttachmentTextScanLimit.DefaultValue));
 }
Beispiel #9
0
 internal static void TransportRuleLimitSetter(object value, IPropertyBag propertyBag)
 {
     MultivaluedPropertyAccessors.UpdateMultivaluedProperty <int>((int)value, TransportConfigContainerSchema.TransportRuleLimit.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig]);
 }
Beispiel #10
0
 internal static object TransportRuleLimitGetter(IPropertyBag propertyBag)
 {
     return(MultivaluedPropertyAccessors.GetIntValueFromMultivaluedProperty(TransportConfigContainerSchema.TransportRuleLimit.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig], (int)TransportConfigContainerSchema.TransportRuleLimit.DefaultValue));
 }
Beispiel #11
0
 internal static void TransportRuleMinProductVersionSetter(object value, IPropertyBag propertyBag)
 {
     MultivaluedPropertyAccessors.UpdateMultivaluedProperty <Version>((Version)value, TransportConfigContainerSchema.TransportRuleMinProductVersion.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig]);
 }
Beispiel #12
0
 internal static object TransportRuleMinProductVersionGetter(IPropertyBag propertyBag)
 {
     return(MultivaluedPropertyAccessors.GetVersionValueFromMultivaluedProperty(TransportConfigContainerSchema.TransportRuleMinProductVersion.Name, (MultiValuedProperty <string>)propertyBag[TransportConfigContainerSchema.TransportRuleConfig], (Version)TransportConfigContainerSchema.TransportRuleMinProductVersion.DefaultValue));
 }