Пример #1
0
 public void RemoveFromParent()
 {
     if (parent != null)
     {
         parent.children.Remove(this);
         parent = null;
     }
 }
Пример #2
0
        public virtual void Dispose()
        {
            disposeChilderen();
            if (parent != null)
            {
                if (parent.children != null)
                {
                    parent.children.Remove(this);
                }
                parent = null;
            }

            IsDisposed = true;
        }
Пример #3
0
        private void init(IDisposableResource parent, Dictionary <string, object> constructorParameters)
        {
            DisposableResource disposable = null;

            if (parent != null)
            {
                disposable = parent as DisposableResource;
                if (disposable == null)
                {
                    Debug.ThrowError("DisposableResource", "Parent object must be a DisposableResource class object, NOT just an interface");
                }
            }

            this.parent = disposable;
            if (this.parent != null)
            {
                this.parent.children.Add(this);
            }
            children                   = new List <DisposableResource>();
            referenceCount             = 1;
            this.constructorParameters = constructorParameters;
        }