Пример #1
0
 public void SetLastNodeCreated(GUID nodeId, string nodeTitle)
 {
     FlushNodeCreationEvent(NodeCreationEvent.Keep);
     Log($"Set last node created: {nodeId}");
     m_LastNodeCreation = new PendingNodeCreationEvent(nodeId, nodeTitle)
     {
         SkipNextFlush = true
     };
 }
Пример #2
0
        public void SendAllUserActionsIncludingPendingNodeCreation()
        {
            if (m_LastNodeCreation?.Action.HasValue == true)
            {
                m_UserActionEvents.Enqueue(m_LastNodeCreation.Action.Value);
                m_LastNodeCreation = null;
            }

            SendAllUserActions();
        }
Пример #3
0
        public void FlushNodeCreationEvent(NodeCreationEvent e, IEnumerable <GUID> deletedNodeIds = null)
        {
            if (m_LastNodeCreation?.Action.HasValue == true)
            {
                if (m_LastNodeCreation.SkipNextFlush)
                {
                    m_LastNodeCreation.SkipNextFlush = false;
                    return;
                }

                VSUserActions vsUserActions = m_LastNodeCreation.Action.Value;

                if (e == NodeCreationEvent.UndoOrDelete && (deletedNodeIds == null || deletedNodeIds.Contains(m_LastNodeCreation.GUID)))
                {
                    vsUserActions.SetResult(NodeCreationEvent.UndoOrDelete);
                }

                m_UserActionEvents.Enqueue(vsUserActions);
                Log($"Flush last node creation {m_LastNodeCreation.GUID} result: {vsUserActions.vsSearcherCancelled}");

                m_LastNodeCreation = null;
            }
        }