Smartmobili.Cocoa.NSView.RemoveSubview C# (CSharp) Method

RemoveSubview() public method

public RemoveSubview ( NSView aView ) : void
aView NSView
return void
        public virtual void RemoveSubview(NSView aView)
        {
            NSView view;
            /*
             * This must be first because it invokes -resignFirstResponder:,
             * which assumes the view is still in the view hierarchy
             */

            //FIXME (VRI) : normally _window is not null I think ...
            if (_window != null)
            {
                for (view = (NSView)_window.FirstResponder;
                     view != null && view.RespondsToSelector(new SEL(@"GetSuperview"));
                     view = view.Superview)
                {
                    if (view == aView)
                    {

                        //[_window makeFirstResponder: _window];
                        break;
                    }
                }
            }
            this.WillRemoveSubview(aView);
            aView._super_view = null;
            aView._ViewWillMoveToWindow(null);
            aView._ViewWillMoveToSuperview(null);
            aView.SetNextResponder(null);

            _sub_views.RemoveObjectIdenticalTo(aView);
            aView.SetNeedsDisplay(false);
            aView._ViewDidMoveToWindow();
            aView.ViewDidMoveToSuperview();

            if (_sub_views.Count == 0)
            {
                _rFlags.has_subviews = 0;
            }
        }
NSView