Example #1
0
        internal override void Validate(IConfigSchema schema)
        {
            if (base.Restriction == null)
            {
                throw new ConfigurationSettingsRestrictionExpectedException(base.GetType().Name);
            }
            if (!string.IsNullOrEmpty(base.Restriction.SubType))
            {
                throw new ConfigurationSettingsRestrictionExtraProperty(base.GetType().Name, "SubType");
            }
            bool flag = false;

            if (!string.IsNullOrEmpty(base.Restriction.MinVersion))
            {
                SettingsScopeRestriction.ValidateAsServerVersion(base.Restriction.MinVersion);
                flag = true;
            }
            if (!string.IsNullOrEmpty(base.Restriction.MaxVersion))
            {
                SettingsScopeRestriction.ValidateAsServerVersion(base.Restriction.MaxVersion);
                flag = true;
            }
            if (!string.IsNullOrEmpty(base.Restriction.NameMatch))
            {
                SettingsScopeRestriction.ValidateNameMatch(base.Restriction.NameMatch);
                flag = true;
            }
            if (base.Restriction.GuidMatch != null)
            {
                flag = true;
            }
            if (!flag)
            {
                throw new ConfigurationSettingsRestrictionExpectedException(base.GetType().Name);
            }
        }
 public static void ValidateAsServerVersion(int version)
 {
     SettingsScopeRestriction.ValidateAsServerVersion(new ServerVersion(version));
 }
 public static void ValidateAsServerVersion(string version)
 {
     SettingsScopeRestriction.ValidateAsServerVersion(SettingsScopeRestriction.ParseServerVersion(version));
 }