예제 #1
0
 public DateMathExpression(Union <DateTime, string> anchor, Time range, DateMathOperation operation)
 {
     anchor.ThrowIfNull(nameof(anchor));
     range.ThrowIfNull(nameof(range));
     operation.ThrowIfNull(nameof(operation));
     this.Anchor = anchor;
     Self.Ranges.Add(Tuple.Create(operation, range));
 }
		public DateMathExpression(Union<DateTime, string> anchor, Time range, DateMathOperation operation)
		{
			anchor.ThrowIfNull(nameof(anchor));
			range.ThrowIfNull(nameof(range));
			operation.ThrowIfNull(nameof(operation));
			this.Anchor = anchor;
			Self.Ranges.Add(Tuple.Create(operation, range));
		}
예제 #3
0
        public static string GetStringValue(this DateMathOperation value)
        {
            switch (value)
            {
            case DateMathOperation.Add:
                return("+");

            case DateMathOperation.Subtract:
                return("-");

            default:
                throw new ArgumentOutOfRangeException(nameof(value), value, null);
            }
        }
예제 #4
0
 public DateMathExpression Operation(Time expression, DateMathOperation operation)
 {
     Self.Ranges.Add(Tuple.Create(operation, expression));
     return(this);
 }
		public DateMathExpression Operation(Time expression, DateMathOperation operation)
		{
			Self.Ranges.Add(Tuple.Create(operation, expression));
			return this;
		}