/// <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>
        protected bool DoSelectionChanged(object selection, bool force)
        {
            if (_containerControl == null)
            {
                Debug.Fail("OperationDesignerWindow must be initialized before DoSelectionChanged can be called");
                return(false); // we haven't been initialized yet
            }

            if (!force &&
                _currentSelection != null &&
                _currentSelection == selection)
            {
                _containerControl.WatermarkVisible = false;
                if (_currentBrowseObject != null)
                {
                    try
                    {
                        // Reset selection context.  We clear this on document window switches.
                        SetSelectedComponents(new[] { _currentBrowseObject });
                    }
                    finally
                    {
                        _currentBrowseObject = null;
                    }
                }

                // nothing changed
                return(false);
            }

            if (_treeControl.PopulateTree(selection))
            {
                // hide watermark
                if (_containerControl.WatermarkVisible)
                {
                    _containerControl.WatermarkVisible = false;
                }

                // cache selection
                _currentSelection = selection;

                return(true);
            }
            else
            {
                // otherwise set watermark for unrecognized selection
                _containerControl.SetWatermarkInfo(WatermarkInfo);

                // we weren't previously showing the watermark, so treat this as
                // a selection change.
                if (!_containerControl.WatermarkVisible)
                {
                    _containerControl.WatermarkVisible = true;
                    SetSelectedComponents(new object[] { }); // clear our selection context when displaying the watermark.
                    _currentSelection = null;
                    return(true);
                }

                return(false);
            }
        }