Example #1
0
        /// <summary>
        /// Adds follower's as a listener when Start.
        /// </summary>
        /// <param name="follower"></param>
        /// <remarks>To avoid recursion, followe <see cref="DetachOnStart(this Generator source, Generator)"/> the calling generator. </remarks>
        public static void AttachOnBegin(this ComponentGenerator source, ComponentGenerator follower)
        {
            //avoid recursion
            follower.DetachOnBegin(source);

            source.OnBeginEventHandler += (e, a) => follower.Begin();
        }
Example #2
0
 /// <summary>
 /// Removes following's StartGenerating from Start event list.
 /// </summary>
 /// <param name="follower"></param>
 public static void DetachOnBegin(this ComponentGenerator source, ComponentGenerator follower)
 {
     source.OnBeginEventHandler -= (e, a) => follower.Begin();
 }