Example #1
0
 public static string SubjectLoadMediaType(this IContext ctx, bool disposeTolerant = default)
 => SubjectLoadMediaTypeProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant);
Example #2
0
 public static Uri SubjectLoadBaseUri(this IContext ctx, bool disposeTolerant = default)
 => SubjectLoadBaseUriProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant);
Example #3
0
 public static Uri SubjectLoadSiteOrigin(this IContext ctx, bool disposeTolerant = default)
 => SubjectLoadSiteOriginProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant);
Example #4
0
 public static IFormattable DisplayName(this IContext ctx, bool disposeTolerant = default)
 => DisplayNameProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant);
Example #5
0
 public static IAsyncProgress <IFormattable> Progress(this IContext ctx, bool disposeTolerant = default)
 => ProgressProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant)?.Value;
Example #6
0
 public static IDisposeRegistry DisposeRegistry(this IContext ctx, bool disposeTolerant = default)
 => DisposeRegistryProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant)?.Value;
Example #7
0
 /// <summary>
 /// Returns the cancellation token that associated with the specified context.
 /// <para>If context (<paramref name="ctx"/>) is <see langword="null"/> then returns <see cref="CancellationToken.None"/>.</para>
 /// </summary>
 /// <param name="ctx">
 /// Context.
 /// <para>Can be null.</para>
 /// </param>
 /// <param name="disposeTolerant">
 /// Special flag indicating the specified context disposing tolerance. When flag is <see langword="true"/> and the specified context is about dispose or disposed, then <see cref="ObjectDisposedException"/> not will thrown and <see cref="CancellationToken.None"/> will returned.
 /// </param>
 /// <returns>Object <see cref="CancellationToken"/>.</returns>
 public static CancellationToken Ct(this IContext ctx, bool disposeTolerant = default)
 => ctx is null ? CancellationToken.None : CtProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant);
Example #8
0
 /// <summary>
 /// Gets dependencies for this context.
 /// </summary>
 /// <param name="ctx">
 /// Context.
 /// <para>Can't be <see langword="null"/>.</para>
 /// </param>
 /// <param name="disposeTolerant">
 /// Dispose tolerancy flag.
 /// <para><see langword="true"/> — context dispose state ignored and default value returned.</para>
 /// </param>
 public static IDependencySupport Dependencies(this IContext ctx, bool disposeTolerant = default)
 => DependenciesProp.GetValue(ctx: ctx, disposeTolerant: disposeTolerant)?.Value;