Exemple #1
0
        // Token: 0x06002A09 RID: 10761 RVA: 0x000C1BA0 File Offset: 0x000BFDA0
        internal void DisposeElement(object node)
        {
            DependencyObject dependencyObject = node as DependencyObject;

            if (dependencyObject != null)
            {
                bool        flag            = false;
                IEnumerator logicalChildren = LogicalTreeHelper.GetLogicalChildren(dependencyObject);
                if (logicalChildren != null)
                {
                    while (logicalChildren.MoveNext())
                    {
                        flag = true;
                        object node2 = logicalChildren.Current;
                        this.DisposeElement(node2);
                    }
                }
                if (!flag)
                {
                    ContentControl contentControl = dependencyObject as ContentControl;
                    if (contentControl != null && contentControl.ContentIsNotLogical && contentControl.Content != null)
                    {
                        this.DisposeElement(contentControl.Content);
                    }
                }
            }
            IDisposable disposable = node as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }
        }