CK.WindowManager.Model.BindingExtensions.AllDescendants C# (CSharp) Method

AllDescendants() public static method

Enumerates through all descendant with the ability to filter them.
public static AllDescendants ( this me, BindingPosition excludes = BindingPosition.None ) : IEnumerable
me this
excludes BindingPosition
return IEnumerable
        public static IEnumerable<ISpatialBinding> AllDescendants( this ISpatialBinding me, BindingPosition excludes = BindingPosition.None )
        {
            //List<IWindowElement> toExclude = new List<IWindowElement>();

            //if( excludes.HasFlag( BindingPosition.Top ) )
            //    foreach( var e in me.Top.Descendants( me.Window ) ) toExclude.Add( e );
            //if( excludes.HasFlag( BindingPosition.Bottom ) )
            //{
            //    foreach( var e in me.Bottom.Descendants( me.Window ) ) toExclude.Add( e );
            //}
            //if( excludes.HasFlag( BindingPosition.Left ) )
            //    foreach( var e in me.Left.Descendants( me.Window ) ) toExclude.Add( e );
            //if( excludes.HasFlag( BindingPosition.Right ) )
            //    foreach( var e in me.Right.Descendants( me.Window ) ) toExclude.Add( e );

            //return me.AllDescendants().Except( toExclude );

            var v = new List<ISpatialBinding>();
            BrowseExclude( me, v, excludes );
            return v.Except( new[] { me } );
        }