コード例 #1
0
		public static void Traverse(this IActivity activity, TraverseArg traverse)
		{
			traverse.Start?.Invoke(activity);
			traverse.Action?.Invoke(activity);
			foreach (var ch in activity.EnumChildren())
				ch.Traverse(traverse);
			traverse.End?.Invoke(activity);
		}
コード例 #2
0
        public static async ValueTask TraverseAsync(this IActivity activity, Func <IActivity, ValueTask> onAction)
        {
            await onAction(activity);

            foreach (var ch in activity.EnumChildren())
            {
                await ch.TraverseAsync(onAction);
            }
        }