public void Open(IOleParentUndoUnit pPUU) { #if DEBUGUNDOREDO Debug.WriteLine($@">>> ParentRecord.Open({Sequence}{_unitDescription}): Open pPUU({(pPUU as ParentRecord).Sequence}/{(pPUU as ParentRecord)._unitDescription})"); #endif OpenChildren.Add(pPUU); }
public int Close(IOleParentUndoUnit pPUU, int fCommit) { if (pPUU == null) { return(VSConstants.S_FALSE); } if (_openParent == null) { return(VSConstants.S_FALSE); } var hr = _openParent.Close(pPUU, fCommit); if (VSErrorHandler.Failed(hr)) { return(hr); } if (_openParent == pPUU) { _openParent = null; if (fCommit != 0) { _children.Add(pPUU); } return(VSConstants.S_OK); } else { throw new ArgumentException("Closing the wrong parent unit!"); } }
internal AtomicBlock(ViewModel.ViewModelController controller, string description) { Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); Controller = controller; UndoUnit = new UndoRedo.ParentRecord(controller, description); controller.UndoManager.Open(UndoUnit); }
public void Open(IOleParentUndoUnit pPUU) { if (_openParent == null) { _openParent = pPUU; } else { _openParent.Open(pPUU); } }
public int Close(IOleParentUndoUnit pPUU, int fCommit) { if (OpenChildren.Count == 0) { #if DEBUGUNDOREDO Debug.WriteLine($@">>> ParentRecord.Close({Sequence}/{_unitDescription}):) Reporting Closed"); #endif return(VSConstants.S_FALSE); } #if DEBUGUNDOREDO Debug.WriteLine($@">>> ParentRecord.Close({Sequence}/{_unitDescription}): CLosing pPUU({(pPUU as ParentRecord).Sequence}/{(pPUU as ParentRecord)._unitDescription})"); #endif int hr = OpenChildren.Last().Close(pPUU, fCommit); switch (hr) { case VSConstants.S_OK: #if DEBUGUNDOREDO Debug.WriteLine($@">>> ParentRecord.Close({Sequence}/{_unitDescription}): pPUU({(pPUU as ParentRecord).Sequence}/{(pPUU as ParentRecord)._unitDescription}) returned S_OK"); #endif return(VSConstants.S_OK); case VSConstants.S_FALSE: if (OpenChildren.Contains(pPUU)) { OpenChildren.Remove(pPUU); #if DEBUGUNDOREDO Debug.WriteLine($@">>> ParentRecord.Close({Sequence}/{_unitDescription}): pPUU({(pPUU as ParentRecord).Sequence}/{(pPUU as ParentRecord)._unitDescription}) returned S_FALSE, we're returning S_OK"); #endif return(VSConstants.S_OK); } else { #if DEBUGUNDOREDO Debug.WriteLine($@">>> ParentRecord.Close({Sequence}/{_unitDescription}): pPUU({(pPUU as ParentRecord).Sequence}/{(pPUU as ParentRecord)._unitDescription}) returned S_FALSE, we're returning E_INVALIDARG"); #endif return(VSConstants.E_INVALIDARG); } default: throw new NotImplementedException(); } }
public void Open(IOleParentUndoUnit pPUU) { _wrappedUndoManager.Open(pPUU); }
public int Close(IOleParentUndoUnit pPUU, int fCommit) { return(_wrappedUndoManager.Close(pPUU, fCommit)); }
public void Open(IOleParentUndoUnit pPUU) { if (_openParent == null) { _openParent = pPUU; } else { _openParent.Open(pPUU); } }
public int Close(IOleParentUndoUnit pPUU, int fCommit) { if (pPUU == null) { return VSConstants.S_FALSE; } if (_openParent == null) { return VSConstants.S_FALSE; } var hr = _openParent.Close(pPUU, fCommit); if (VSErrorHandler.Failed(hr)) { return hr; } if (_openParent == pPUU) { _openParent = null; if (fCommit != 0) { _children.Add(pPUU); } return VSConstants.S_OK; } else { throw new ArgumentException("Closing the wrong parent unit!"); } }
public void Open(IOleParentUndoUnit pPUU) { _wrappedUndoManager.Open(pPUU); }
public int Close(IOleParentUndoUnit pPUU, int fCommit) { return _wrappedUndoManager.Close(pPUU, fCommit); }