src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/VirtualTreeSelection.cs
/// <summary>
///     Fires WinEvents for given selection change.
/// </summary>
Fires WinEvents for given selection change.
Fires WinEvents for given selection change .
private void FireWinEventsForSelection(bool extendFromAnchor, bool preserveSelection, ModifySelectionAction caretAction)
        {
            if (GetStateFlag(VTCStateFlags.RestoringSelection))
            {
                return; 
            }
            if (SelectionCount == 1)
            {
                if (VirtualTreeAccEvents.ShouldNotify(VirtualTreeAccEvents.eventObjectSelection, this))
                {
                    VirtualTreeAccEvents.Notify(
                        VirtualTreeAccEvents.eventObjectSelection, CurrentIndex,
                        CurrentColumn, this);
                }
            }
            else if (extendFromAnchor)
            {
                if (VirtualTreeAccEvents.ShouldNotify(VirtualTreeAccEvents.eventObjectSelectionWithin, this))
                {
                    VirtualTreeAccEvents.Notify(
                        VirtualTreeAccEvents.eventObjectSelection, CurrentIndex,
                        CurrentColumn, this);
                }
            }
            else if (preserveSelection)
            {
                switch (caretAction)
                {
                    case ModifySelectionAction.Select:
                        if (VirtualTreeAccEvents.ShouldNotify(VirtualTreeAccEvents.eventObjectSelectionAdd, this))
                        {
                            VirtualTreeAccEvents.Notify(
                                VirtualTreeAccEvents.eventObjectSelectionAdd, CurrentIndex,
                                CurrentColumn, this);
                        }
                        break;
                    case ModifySelectionAction.Clear:
                        if (VirtualTreeAccEvents.ShouldNotify(VirtualTreeAccEvents.eventObjectSelectionRemove, this))
                        {
                            VirtualTreeAccEvents.Notify(
                                VirtualTreeAccEvents.eventObjectSelectionRemove, CurrentIndex,
                                CurrentColumn, this);
                        }
                        break;
                    case ModifySelectionAction.Toggle:
                        if (IsSelected(CaretIndex))
                        {
                            goto case ModifySelectionAction.Select;
                        }
                        else
                        {
                            goto case ModifySelectionAction.Clear;
                        }
                    case ModifySelectionAction.None:
                        if (VirtualTreeAccEvents.ShouldNotify(VirtualTreeAccEvents.eventObjectSelectionWithin, this))
                        {
                            VirtualTreeAccEvents.Notify(
                                VirtualTreeAccEvents.eventObjectSelection, CurrentIndex,
                                CurrentColumn, this);
                        }
                        break;
                }
            }
        }
private void FireWinEventsForSelection ( bool extendFromAnchor , bool preserveSelection , ModifySelectionAction caretAction ) { if ( GetStateFlag ( VTCStateFlags . RestoringSelection ) ) { return ; } if ( SelectionCount == 1 ) { if ( VirtualTreeAccEvents . ShouldNotify ( VirtualTreeAccEvents . eventObjectSelection , this ) ) { VirtualTreeAccEvents . Notify ( VirtualTreeAccEvents . eventObjectSelection , CurrentIndex , CurrentColumn , this ) ; } } else if ( extendFromAnchor ) { if ( VirtualTreeAccEvents . ShouldNotify ( VirtualTreeAccEvents . eventObjectSelectionWithin , this ) ) { VirtualTreeAccEvents . Notify ( VirtualTreeAccEvents . eventObjectSelection , CurrentIndex , CurrentColumn , this ) ; } } else if ( preserveSelection ) { switch ( caretAction ) { case ModifySelectionAction . Select : if ( VirtualTreeAccEvents . ShouldNotify ( VirtualTreeAccEvents . eventObjectSelectionAdd , this ) ) { VirtualTreeAccEvents . Notify ( VirtualTreeAccEvents . eventObjectSelectionAdd , CurrentIndex , CurrentColumn , this ) ; } break ; case ModifySelectionAction . Clear : if ( VirtualTreeAccEvents . ShouldNotify ( VirtualTreeAccEvents . eventObjectSelectionRemove , this ) ) { VirtualTreeAccEvents . Notify ( VirtualTreeAccEvents . eventObjectSelectionRemove , CurrentIndex , CurrentColumn , this ) ; } break ; case ModifySelectionAction . Toggle : if ( IsSelected ( CaretIndex ) ) { goto case ModifySelectionAction . Select ; } else { goto case ModifySelectionAction . Clear ; } case ModifySelectionAction . None : if ( VirtualTreeAccEvents . ShouldNotify ( VirtualTreeAccEvents . eventObjectSelectionWithin , this ) ) { VirtualTreeAccEvents . Notify ( VirtualTreeAccEvents . eventObjectSelection , CurrentIndex , CurrentColumn , this ) ; } break ; } } }
Fires WinEvents for given selection change.
Fires WinEvents for given selection change .
// no events if we're restoring selection. // if there's currently only one thing selected, we know we should fire a regular selection event. // we extended selection from the anchor position, this constitutes a significant change in selection // state, so we fire selection within from the tree control, and let clients query us for the result. // UNDONE: querying currently won't work because we need a way to return an IEnumVariant from IAccessible::get_accSelection. // We just fire selection for the caret instead. // VirtualTreeAccEvents.Notify(VirtualTreeAccEvents.eventObjectSelectionWithin, VirtualTreeConstant.NullIndex, //								 VirtualTreeConstant.NullIndex, this); // we're preserving an original selection, which means that we fire either an add or a remove, // depending on what happened to the caret // Caret position didn't change, but selection still changed overall.  This happens, for instance, // during cross-column selection transfer.  We would ideally fire selection within here, for now // we just fire selection at the caret position anyway. //VirtualTreeAccEvents.Notify(VirtualTreeAccEvents.eventObjectSelectionWithin, VirtualTreeConstant.NullIndex, //								VirtualTreeConstant.NullIndex, this);
extendFromAnchor
bool
preserveSelection
bool
caretAction
ModifySelectionAction