src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerToolWindow.cs
/// <summary>
///     Called by derived classes to indicate that selection has changed.  Implements selection logic based
///     on attributes placed on selected objects.
/// </summary>
/// <returns>true if selection changed</returns>
Called by derived classes to indicate that selection has changed.  Implements selection logic based
on attributes placed on selected objects.
Called by derived classes to indicate that selection has changed . Implements selection logic based on attributes placed on selected objects .
protected bool DoSelectionChanged(object selection, bool force)
        {
            if (_containerControl == null)
            {
                Debug.Fail("OperationDesignerWindow must be initialized before DoSelectionChanged can be called");
                return false; 
            }
            if (!force
                && _currentSelection != null
                && _currentSelection == selection)
            {
                _containerControl.WatermarkVisible = false;
                if (_currentBrowseObject != null)
                {
                    try
                    {
                        SetSelectedComponents(new[] { _currentBrowseObject });
                    }
                    finally
                    {
                        _currentBrowseObject = null;
                    }
                }
                return false;
            }
            if (_treeControl.PopulateTree(selection))
            {
                if (_containerControl.WatermarkVisible)
                {
                    _containerControl.WatermarkVisible = false;
                }
                _currentSelection = selection;
                return true;
            }
            else
            {
                _containerControl.SetWatermarkInfo(WatermarkInfo);
                if (!_containerControl.WatermarkVisible)
                {
                    _containerControl.WatermarkVisible = true;
                    SetSelectedComponents(new object[] { }); 
                    _currentSelection = null;
                    return true;
                }
                return false;
            }
        }
protected bool DoSelectionChanged ( object selection , bool force ) { if ( _containerControl == null ) { Debug . Fail ( " " ) ; return false ; } if ( ! force && _currentSelection != null && _currentSelection == selection ) { _containerControl . WatermarkVisible = false ; if ( _currentBrowseObject != null ) { try { SetSelectedComponents ( new [ ] { _currentBrowseObject } ) ; } finally { _currentBrowseObject = null ; } } return false ; } if ( _treeControl . PopulateTree ( selection ) ) { if ( _containerControl . WatermarkVisible ) { _containerControl . WatermarkVisible = false ; } _currentSelection = selection ; return true ; } else { _containerControl . SetWatermarkInfo ( WatermarkInfo ) ; if ( ! _containerControl . WatermarkVisible ) { _containerControl . WatermarkVisible = true ; SetSelectedComponents ( new object [ ] { } ) ; _currentSelection = null ; return true ; } return false ; } }
Called by derived classes to indicate that selection has changed.
Called by derived classes to indicate that selection has changed .
// we haven't been initialized yet // Reset selection context.  We clear this on document window switches. // nothing changed // hide watermark // cache selection // otherwise set watermark for unrecognized selection // we weren't previously showing the watermark, so treat this as  // a selection change. // clear our selection context when displaying the watermark.
true if selection changed
true if selection changed
selection
object
force
bool