Exemple #1
0
        /// <summary>
        /// Adds to lifetime.
        /// </summary>
        /// <param name="instanceScope">The instance scope.</param>
        public void AddToLifetime(IAmALifetime instanceScope)
        {
            instanceScope.Add(this);

            if (_successor != null)
            {
                _successor.AddToLifetime(instanceScope);
            }
        }
Exemple #2
0
        /// <summary>
        /// Adds to lifetime.
        /// </summary>
        /// <param name="instanceScope">The instance scope.</param>
        public void AddToLifetime(IAmALifetime instanceScope)
        {
            if (this is IDisposable)
            {
                instanceScope.Add(this);
            }

            if (successor != null)
            {
                successor.AddToLifetime(instanceScope);
            }
        }
Exemple #3
0
 /// <summary>
 /// Adds to lifetime.
 /// </summary>
 /// <param name="instanceScope">The instance scope.</param>
 public void AddToLifetime(IAmALifetime instanceScope)
 {
     instanceScope.Add(this);
     _successor?.AddToLifetime(instanceScope);
 }