コード例 #1
0
 /// <summary>
 /// Converts given <see cref="Type"/> to its <see cref="IProgress{T}"/> type.
 /// </summary>
 /// <param name="objectType">The type which may implement <see cref="IProgress{T}"/>.</param>
 /// <returns>The <see cref="IProgress{T}"/> from given <see cref="Type"/> object, or <c>null</c>  if no such interface was found in the given <paramref name="objectType" />.</returns>
 public static Type?FindIProgressOfT(Type objectType) => TrackerHelpers <IProgress <int> > .FindInterfaceImplementedBy(objectType);
コード例 #2
0
 /// <summary>
 /// Checks if a given <see cref="Type"/> implements <see cref="IProgress{T}"/>.
 /// </summary>
 /// <param name="objectType">The type which may implement <see cref="IProgress{T}"/>.</param>
 /// <returns>true if given <see cref="Type"/> implements <see cref="IProgress{T}"/>; otherwise, false.</returns>
 public static bool IsSupportedProgressType(Type objectType) => TrackerHelpers <IProgress <int> > .CanSerialize(objectType);
コード例 #3
0
 /// <summary>
 /// Checks if a given <see cref="Type"/> implements <see cref="IAsyncEnumerable{T}"/>.
 /// </summary>
 /// <param name="objectType">The type which may implement <see cref="IAsyncEnumerable{T}"/>.</param>
 /// <returns>true if given <see cref="Type"/> implements <see cref="IAsyncEnumerable{T}"/>; otherwise, false.</returns>
 /// <devremarks>
 /// We use <see langword="int"/> as a generic type argument in this because what we use doesn't matter, but we must use *something*.
 /// </devremarks>
 public static bool CanSerialize(Type objectType) => TrackerHelpers <IAsyncEnumerable <int> > .CanSerialize(objectType);