示例#1
0
        public DataListUpdate(DataListUpdateAction action, int index, int count)
        {
            // Validate Parameters

            if (action != DataListUpdateAction.Add && action != DataListUpdateAction.Remove)
            {
                throw new InvalidOperationException(string.Format(ResourceHelper.GetErrorResource("Exception_InvalidOperation_ConstructorNotSupportedForAction"), action));
            }

            if (index < 0)
            {
                throw new ArgumentOutOfRangeException("count", ResourceHelper.GetErrorResource("Exception_ArgumentOutOfRange_ParameterMustBeZeroOrPositive"));
            }

            if (count <= 0)
            {
                throw new ArgumentOutOfRangeException("count", ResourceHelper.GetErrorResource("Exception_ArgumentOutOfRange_ParameterMustBePositive"));
            }

            // Set Fields

            this.action = action;
            this.index  = index;
            this.count  = count;
        }
示例#2
0
        // *** Constructors ***

        public DataListUpdate(DataListUpdateAction action)
        {
            // Validate Parameters

            if (action != DataListUpdateAction.Reset)
                throw new InvalidOperationException(string.Format(ResourceHelper.GetErrorResource("Exception_InvalidOperation_ConstructorNotSupportedForAction"), action));

            // Set Fields

            this.action = action;
            this.index = 0;
            this.count = 0;
        }
示例#3
0
        // *** Constructors ***

        public DataListUpdate(DataListUpdateAction action)
        {
            // Validate Parameters

            if (action != DataListUpdateAction.Reset)
                throw new InvalidOperationException();//string.Format(ResourceHelper.GetErrorResource("Exception_InvalidOperation_ConstructorNotSupportedForAction"), action));

            // Set Fields

            this.action = action;
            this.index = 0;
            this.count = 0;
        }
示例#4
0
        // *** Constructors ***

        public DataListUpdate(DataListUpdateAction action)
        {
            // Validate Parameters

          if (action != DataListUpdateAction.Reset)
            throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
              "The called constructor is not supported for the action '{0}'.", action));

            // Set Fields

            _action = action;
            _index = 0;
            _count = 0;
        }
示例#5
0
        public DataListUpdate(DataListUpdateAction action, int index, int count)
        {
            // Validate Parameters

            if (action != DataListUpdateAction.Add && action != DataListUpdateAction.Remove)
                throw new InvalidOperationException(string.Format(ResourceHelper.GetErrorResource("Exception_InvalidOperation_ConstructorNotSupportedForAction"), action));

            if (index < 0)
                throw new ArgumentOutOfRangeException("count", ResourceHelper.GetErrorResource("Exception_ArgumentOutOfRange_ParameterMustBeZeroOrPositive"));

            if (count <= 0)
                throw new ArgumentOutOfRangeException("count", ResourceHelper.GetErrorResource("Exception_ArgumentOutOfRange_ParameterMustBePositive"));

            // Set Fields

            this.action = action;
            this.index = index;
            this.count = count;
        }
示例#6
0
        public DataListUpdate(DataListUpdateAction action, int index, int count)
        {
            // Validate Parameters

          if (action != DataListUpdateAction.Add && action != DataListUpdateAction.Remove)
            throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
              "The called constructor is not supported for the action '{0}'.", action));

          if (index < 0)
            throw new ArgumentOutOfRangeException("count",
              string.Format(CultureInfo.InvariantCulture, "The parameter must be greater than or equal to zero."));

          if (count <= 0)
            throw new ArgumentOutOfRangeException("count",
              string.Format(CultureInfo.InvariantCulture, "The parameter must be greater than zero."));

            // Set Fields

            _action = action;
            _index = index;
            _count = count;
        }