當前位置: 首頁>>代碼示例>>C#>>正文


C# AtomicUndoOperation類代碼示例

本文整理匯總了C#中AtomicUndoOperation的典型用法代碼示例。如果您正苦於以下問題:C# AtomicUndoOperation類的具體用法?C# AtomicUndoOperation怎麽用?C# AtomicUndoOperation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AtomicUndoOperation類屬於命名空間,在下文中一共展示了AtomicUndoOperation類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EndAtomicUndo

		internal void EndAtomicUndo ()
		{
			if (atomicUndoLevel <= 0)
				throw new InvalidOperationException ("There is no atomic undo operation running.");
			atomicUndoLevel--;
			Debug.Assert (atomicUndoLevel >= 0); 
			
			if (atomicUndoLevel == 0 && currentAtomicOperation != null) {
				if (currentAtomicOperation.Operations.Count > 1) {
					undoStack.Push (currentAtomicOperation);
					OnEndUndo (new UndoOperationEventArgs (currentAtomicOperation));
				} else {
					if (currentAtomicOperation.Operations.Count > 0) {
						undoStack.Push (currentAtomicOperation.Operations [0]);
						OnEndUndo (new UndoOperationEventArgs (currentAtomicOperation.Operations [0]));
					} else {
						OnEndUndo (null);
					}
				}
				currentAtomicOperation = null;
			}
			currentAtomicUndoOperationType.Pop ();
		}
開發者ID:telebovich,項目名稱:monodevelop,代碼行數:23,代碼來源:TextDocument.cs

示例2: BeginAtomicUndo

		internal void BeginAtomicUndo (OperationType operationType = OperationType.Undefined)
		{
			currentAtomicUndoOperationType.Push (operationType);
			if (atomicUndoLevel == 0) {
				if (this.syntaxMode != null && !SuppressHighlightUpdate)
					Mono.TextEditor.Highlighting.SyntaxModeService.WaitUpdate (this);
			}
			if (currentAtomicOperation == null) {
				Debug.Assert (atomicUndoLevel == 0); 
				currentAtomicOperation = new AtomicUndoOperation (operationType);
				OnBeginUndo ();
			}
			atomicUndoLevel++;
		}
開發者ID:telebovich,項目名稱:monodevelop,代碼行數:14,代碼來源:TextDocument.cs

示例3: MergeUndoOperations

		public void MergeUndoOperations (int number)
		{
			number = System.Math.Min (number, undoStack.Count);
			var atomicUndo = new AtomicUndoOperation ();
			while (number-- > 0) {
				atomicUndo.Insert (0, undoStack.Pop ());
			}
			undoStack.Push (atomicUndo);
		}
開發者ID:telebovich,項目名稱:monodevelop,代碼行數:9,代碼來源:TextDocument.cs

示例4: StackUndoToDepth

		public void StackUndoToDepth (int depth)
		{
			if (undoStack.Count == depth)
				return;
			var atomicUndo = new AtomicUndoOperation ();
			while (undoStack.Count > depth) {
				atomicUndo.Operations.Insert (0, undoStack.Pop ());
			}
			undoStack.Push (atomicUndo);
		}
開發者ID:telebovich,項目名稱:monodevelop,代碼行數:10,代碼來源:TextDocument.cs

示例5: BeginAtomicUndo

		public void BeginAtomicUndo ()
		{
			if (atomicUndoLevel == 0) {
				if (this.syntaxMode != null && !SuppressHighlightUpdate)
					Mono.TextEditor.Highlighting.SyntaxModeService.WaitUpdate (this);
			}
			if (currentAtomicOperation == null) {
				Debug.Assert (atomicUndoLevel == 0); 
				currentAtomicOperation = new AtomicUndoOperation ();
				OnBeginUndo ();
			}
			atomicUndoLevel++;
		}
開發者ID:kangaroo,項目名稱:monodevelop,代碼行數:13,代碼來源:Document.cs

示例6: BeginAtomicUndo

		internal void BeginAtomicUndo (OperationType operationType = OperationType.Undefined)
		{
			currentAtomicUndoOperationType.Push (operationType);
 			if (currentAtomicOperation == null) {
				Debug.Assert (atomicUndoLevel == 0); 
				currentAtomicOperation = new AtomicUndoOperation (operationType);
				OnBeginUndo ();
			}
			atomicUndoLevel++;
		}
開發者ID:FreeBSD-DotNet,項目名稱:monodevelop,代碼行數:10,代碼來源:TextDocument.cs


注:本文中的AtomicUndoOperation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。