private static void Validate(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("bufferMode");
            }
            Debug.Assert(value is BufferModeSettings);

            BufferModeSettings elem = (BufferModeSettings)value;

            if (!(elem.UrgentFlushThreshold <= elem.MaxBufferSize))
            {
                throw new ConfigurationErrorsException(
                          SR.GetString(SR.Invalid_attribute1_must_less_than_or_equal_attribute2,
                                       elem.UrgentFlushThreshold.ToString(CultureInfo.InvariantCulture),
                                       "urgentFlushThreshold",
                                       elem.MaxBufferSize.ToString(CultureInfo.InvariantCulture),
                                       "maxBufferSize"),
                          elem.ElementInformation.Properties["urgentFlushThreshold"].Source, elem.ElementInformation.Properties["urgentFlushThreshold"].LineNumber);
            }

            if (!(elem.MaxFlushSize <= elem.MaxBufferSize))
            {
                throw new ConfigurationErrorsException(
                          SR.GetString(SR.Invalid_attribute1_must_less_than_or_equal_attribute2,
                                       elem.MaxFlushSize.ToString(CultureInfo.InvariantCulture),
                                       "maxFlushSize",
                                       elem.MaxBufferSize.ToString(CultureInfo.InvariantCulture),
                                       "maxBufferSize"),
                          elem.ElementInformation.Properties["maxFlushSize"].Source, elem.ElementInformation.Properties["maxFlushSize"].LineNumber);
            }

            if (!(elem.UrgentFlushInterval < elem.RegularFlushInterval))
            {
                throw new ConfigurationErrorsException(
                          SR.GetString(SR.Invalid_attribute1_must_less_than_attribute2,
                                       elem.UrgentFlushInterval.ToString(),
                                       "urgentFlushInterval",
                                       elem.RegularFlushInterval.ToString(),
                                       "regularFlushInterval"),
                          elem.ElementInformation.Properties["urgentFlushInterval"].Source, elem.ElementInformation.Properties["urgentFlushInterval"].LineNumber);
            }
        }
Example #2
0
        private static void Validate(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("bufferMode");
            }
            BufferModeSettings settings = (BufferModeSettings)value;

            if (settings.UrgentFlushThreshold > settings.MaxBufferSize)
            {
                throw new ConfigurationErrorsException(System.Web.SR.GetString("Invalid_attribute1_must_less_than_or_equal_attribute2", new object[] { settings.UrgentFlushThreshold.ToString(CultureInfo.InvariantCulture), "urgentFlushThreshold", settings.MaxBufferSize.ToString(CultureInfo.InvariantCulture), "maxBufferSize" }), settings.ElementInformation.Properties["urgentFlushThreshold"].Source, settings.ElementInformation.Properties["urgentFlushThreshold"].LineNumber);
            }
            if (settings.MaxFlushSize > settings.MaxBufferSize)
            {
                throw new ConfigurationErrorsException(System.Web.SR.GetString("Invalid_attribute1_must_less_than_or_equal_attribute2", new object[] { settings.MaxFlushSize.ToString(CultureInfo.InvariantCulture), "maxFlushSize", settings.MaxBufferSize.ToString(CultureInfo.InvariantCulture), "maxBufferSize" }), settings.ElementInformation.Properties["maxFlushSize"].Source, settings.ElementInformation.Properties["maxFlushSize"].LineNumber);
            }
            if (settings.UrgentFlushInterval >= settings.RegularFlushInterval)
            {
                throw new ConfigurationErrorsException(System.Web.SR.GetString("Invalid_attribute1_must_less_than_attribute2", new object[] { settings.UrgentFlushInterval.ToString(), "urgentFlushInterval", settings.RegularFlushInterval.ToString(), "regularFlushInterval" }), settings.ElementInformation.Properties["urgentFlushInterval"].Source, settings.ElementInformation.Properties["urgentFlushInterval"].LineNumber);
            }
        }
 public void Add(BufferModeSettings bufferModeSettings)
 {
 }
Example #4
0
 public void Add(BufferModeSettings bufferModeSettings)
 {
     BaseAdd(bufferModeSettings);
 }
 public void Add(BufferModeSettings bufferModeSettings)
 {
 }
Example #6
0
		public void UrgentFlushThreshold_validationFailure ()
		{
			BufferModeSettings b = new BufferModeSettings ("hi", Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, Int32.MaxValue);

			b.UrgentFlushThreshold = 0;
		}
Example #7
0
		public void RegularFlushInterval_validationFailure ()
		{
			BufferModeSettings b = new BufferModeSettings ("hi", Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, Int32.MaxValue);

			b.RegularFlushInterval = TimeSpan.FromSeconds (-30);
		}
Example #8
0
		public void Name_validationFailure ()
		{
			BufferModeSettings b = new BufferModeSettings ("hi", Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, Int32.MaxValue);

			b.Name = "";
		}
Example #9
0
		public void MaxFlushSize_validationFailure ()
		{
			BufferModeSettings b = new BufferModeSettings ("hi", Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, Int32.MaxValue);

			b.MaxFlushSize = 0;
		}
 public void Add(BufferModeSettings bufferModeSettings)
 {
     this.BaseAdd(bufferModeSettings);
 }