Esempio n. 1
0
        /// <summary>
        /// Append a span of dates in the form of <see cref="DateTime"/> objects to the array.
        /// </summary>
        /// <remarks>
        /// The value of <see cref="DateTime.Kind"/> on any of the inputs does not have any effect on the behaviour of
        /// this method.
        /// </remarks>
        /// <param name="span">Span of dates to add.</param>
        /// <returns>Returns the builder (for fluent-style composition).</returns>
        public TBuilder Append(ReadOnlySpan <DateTime> span)
        {
            InnerBuilder.Reserve(span.Length);
            foreach (var item in span)
            {
                InnerBuilder.Append(Convert(item));
            }

            return(this as TBuilder);
        }
Esempio n. 2
0
        public IApplicationBuilder Use(Func <RequestDelegate, RequestDelegate> middleware)
        {
            var middlewareName = string.Empty; // UseMiddleware doesn't work with null params.

            if (Properties.TryGetValue(NextMiddlewareName, out var middlewareNameObj) && middlewareNameObj != null)
            {
                middlewareName = middlewareNameObj.ToString();
                Properties.Remove(NextMiddlewareName);
            }

            return(InnerBuilder.UseMiddleware <AnalysisMiddleware>(middlewareName)
                   .Use(middleware));
        }
Esempio n. 3
0
 public IApplicationBuilder New()
 {
     return(new AnalysisBuilder(InnerBuilder.New()));
 }
Esempio n. 4
0
 public RequestDelegate Build()
 {
     // Add one maker at the end before the default 404 middleware (or any fancy Join middleware).
     return(InnerBuilder.UseMiddleware <AnalysisMiddleware>("EndOfPipeline")
            .Build());
 }
Esempio n. 5
0
 public override string ToString()
 {
     return(InnerBuilder.ToString());
 }
Esempio n. 6
0
 /// <summary>
 /// Append a date from a <see cref="DateTimeOffset"/> object to the array.
 /// </summary>
 /// <remarks>
 /// Note that to convert the supplied <paramref name="value"/> parameter to a date, it is first converted to
 /// UTC and the date then taken from the UTC date/time.  Depending on the value of its
 /// <see cref="DateTimeOffset.Offset"/> property, this may not necessarily be the same as the date obtained by
 /// calling its <see cref="DateTimeOffset.Date"/> property.
 /// </remarks>
 /// <param name="value">Date to add.</param>
 /// <returns>Returns the builder (for fluent-style composition).</returns>
 public TBuilder Append(DateTimeOffset value)
 {
     InnerBuilder.Append(Convert(value));
     return(this as TBuilder);
 }
Esempio n. 7
0
 /// <summary>
 /// Swap the values of the dates at the specified indices.
 /// </summary>
 /// <param name="i">First index.</param>
 /// <param name="j">Second index.</param>
 /// <returns>Returns the builder (for fluent-style composition).</returns>
 public TBuilder Swap(int i, int j)
 {
     InnerBuilder.Swap(i, j);
     return(this as TBuilder);
 }
Esempio n. 8
0
 /// <summary>
 /// Set the value of a date in the form of a <see cref="DateTimeOffset"/> object at the specified index.
 /// </summary>
 /// <remarks>
 /// Note that to convert the supplied <paramref name="value"/> parameter to a date, it is first converted to
 /// UTC and the date then taken from the UTC date/time.  Depending on the value of its
 /// <see cref="DateTimeOffset.Offset"/> property, this may not necessarily be the same as the date obtained by
 /// calling its <see cref="DateTimeOffset.Date"/> property.
 /// </remarks>
 /// <param name="index">Index at which to set value.</param>
 /// <param name="value">Date to set.</param>
 /// <returns>Returns the builder (for fluent-style composition).</returns>
 public TBuilder Set(int index, DateTimeOffset value)
 {
     InnerBuilder.Set(index, Convert(value));
     return(this as TBuilder);
 }
Esempio n. 9
0
 /// <summary>
 /// Append a collection of dates in the form of <see cref="DateTimeOffset"/> objects to the array.
 /// </summary>
 /// <remarks>
 /// Note that to convert the <see cref="DateTimeOffset"/> objects in the <paramref name="values"/> parameter to
 /// dates, they are first converted to UTC and the date then taken from the UTC date/times.  Depending on the
 /// value of each <see cref="DateTimeOffset.Offset"/> property, this may not necessarily be the same as the
 /// date obtained by calling the <see cref="DateTimeOffset.Date"/> property.
 /// </remarks>
 /// <param name="values">Collection of dates to add.</param>
 /// <returns>Returns the builder (for fluent-style composition).</returns>
 public TBuilder AppendRange(IEnumerable <DateTimeOffset> values)
 {
     InnerBuilder.AppendRange(values.Select(Convert));
     return(this as TBuilder);
 }
Esempio n. 10
0
 /// <summary>
 /// Append a null date to the array.
 /// </summary>
 /// <returns>Returns the builder (for fluent-style composition).</returns>
 public TBuilder AppendNull()
 {
     InnerBuilder.AppendNull();
     return(this as TBuilder);
 }