示例#1
0
        private void removeFromSelection(GoObject obj)
        {
            GoObject primary = Primary;

            myObjTable.Remove(obj);
            base.Remove(obj);
            GoView view = View;

            if (view == null)
            {
                return;
            }
            if (obj.IsInDocument)
            {
                obj.OnLostSelection(this);
            }
            view.RaiseObjectLostSelection(obj);
            if (primary == obj && primary.IsInDocument)
            {
                primary = Primary;
                if (primary != null)
                {
                    primary.OnLostSelection(this);
                    view.RaiseObjectLostSelection(primary);
                    primary.OnGotSelection(this);
                    view.RaiseObjectGotSelection(primary);
                }
            }
        }
示例#2
0
        private void addToSelection(GoObject obj)
        {
            GoObject primary = Primary;

            base.Add(obj);
            myObjTable[obj] = true;
            GoView view = View;

            if (view != null)
            {
                if (obj.IsInDocument)
                {
                    obj.OnGotSelection(this);
                }
                view.RaiseObjectGotSelection(obj);
                if (primary != null && Primary != primary && primary.IsInDocument)
                {
                    primary.OnLostSelection(this);
                    view.RaiseObjectLostSelection(primary);
                    primary.OnGotSelection(this);
                    view.RaiseObjectGotSelection(primary);
                }
            }
        }