public override bool CanCancelWith(IOperationCache other)
 {
     //return false;
     return(other is SweetQuestionsRemovedCache &&
            ((SweetQuestionsCache)other).Document == this.Document &&
            this.HasSameQuestionsWith((SweetQuestionsCache)other));
 }
示例#2
0
 // (0.2.3)
 protected void NotifyOperation(IOperationCache operationCache)
 {
     if (operationCache is QuestionCategoryChangedCache)
     {
         this.QuestionCategoryChanged(this, EventArgs.Empty);
     }
     if (operationCache is QuestionNoChangedCache)
     {
         this.QuestionNoChanged(this, EventArgs.Empty);
     }
 }
 public override bool CanCancelWith(IOperationCache other)
 {
     if (other is QuestionNoChangedCache)
     {
         var other_cache = ((QuestionNoChangedCache)other);
         return((other_cache._question == this._question) &&
                (other_cache._previousValue == this._currentValue) &&
                (other_cache._currentValue == this._previousValue));
     }
     else
     {
         return(false);
     }
 }
        public override bool CanCancelWith(IOperationCache other)
        {
            var other_cache = other as QuestionMemoChangedCache;

            if (other_cache == null)
            {
                return(false);
            }
            else
            {
                return(other_cache._question == this._question &&
                       other_cache._previousValue == this._currentValue &&
                       other_cache._currentValue == this._previousValue);
            }
        }
 /// <summary>
 /// 操作履歴を追加します.
 /// </summary>
 /// <param name="item"></param>
 public void AddOperationHistory(IOperationCache item)
 {
     if (!_undoing && !_redoing)
     {
         operationHistory.Push(item);
         if (OperationCount >= 0)
         {
             OperationCount++;
         }
         undoHistory.Clear();
     }
 }
 public OperationUpdatedHandler(IHandler handler, IOperationCache cache)
 {
     _handler = handler;
     _cache   = cache;
 }
 public abstract bool CanCancelWith(IOperationCache other);
示例#8
0
		// (0.2.3)
		protected void NotifyOperation(IOperationCache operationCache)
		{
			if (operationCache is QuestionCategoryChangedCache)
			{
				this.QuestionCategoryChanged(this, EventArgs.Empty);
			}
			if (operationCache is QuestionNoChangedCache)
			{
				this.QuestionNoChanged(this, EventArgs.Empty);
			}
		}