public async void Redo() { if (m_CurTask != null) { await m_CurTask; } m_CurTask = Task.Run(() => { lock (m_UndoStack) { if (m_RedoStack.Count == 0) { return; } RedoUndoCommandBase cmm = m_RedoStack.Pop(); if (cmm.CanInvoke) { cmm.RedoInvoke(); } else { cmm.Redo(); } m_UndoStack.Push(cmm); } }); }
public async void PushCommand(RedoUndoCommandBase cmm) { if (m_CurTask != null) { await m_CurTask; } m_CurTask = Task.Run(() => { lock (m_UndoStack) { m_UndoStack.Push(cmm); m_RedoStack.Clear(); } }); }