コード例 #1
0
 /// <summary>
 /// Gets the last activity of a certain type.
 /// If exact parameter is set to <c>true</c> only the exact type will be considered.
 /// </summary>
 /// <typeparam name="TActivity">Type of the activity</typeparam>
 /// <param name="process">Extended instance of <see cref="IProcess"/></param>
 /// <param name="exact">If <c>true</c> only the exact type will be considered.</param>
 public static IActivity LastActivity <TActivity>(this IProcess process, bool exact) where TActivity : IActivity
 {
     return(process.GetActivity(ActivitySelectionType.LastOrDefault, a => !exact && a is TActivity || exact && a.GetType() == typeof(TActivity)));
 }
コード例 #2
0
 /// <summary>
 /// Get last activity of a certain type
 /// </summary>
 public static IActivity LastActivity(this IProcess process, string typeName)
 {
     return(process.GetActivity(ActivitySelectionType.LastOrDefault, a => a.GetType().Name == typeName));
 }
コード例 #3
0
 /// <summary>
 /// Current running activity
 /// </summary>
 public static IActivity CurrentActivity(this IProcess process)
 {
     return(process.GetActivity(ActivitySelectionType.LastOrDefault, activity => activity.Tracing?.Started != null && activity.Result == null));
 }
コード例 #4
0
 /// <summary>
 /// Get last completed activity
 /// </summary>
 public static IActivity LastActivity(this IProcess process)
 {
     return(process.GetActivity(ActivitySelectionType.LastOrDefault, a => a.Result != null));
 }
コード例 #5
0
 /// <summary>
 /// Prepared activity that will be dispatched as soon as a ready to work was send.
 /// </summary>
 public static IActivity NextActivity(this IProcess process)
 {
     return(process.GetActivity(ActivitySelectionType.LastOrDefault, activity => activity.Tracing?.Started == null));
 }