Пример #1
0
 /// <summary>
 /// 옵저버에 등록된 구독자들에게 ObserverAction 을 전달
 /// 전달은 받은 구독자들은 ObserverAction 에 따라서 적절한 행동을 한다.
 /// </summary>
 public void Notify(ObserverAction aAction)
 {
     foreach (IObserver item in this.mListener)
     {
         item.OnNext(aAction);
     }
 }
Пример #2
0
        /// <summary>
        /// 수신된 ObserverAction 에 따라서 처리 한다.
        /// </summary>
        public void OnNext(ObserverAction aAction)
        {
            switch (aAction)
            {
            case ObserverAction.Command: SetToolStripMenu(); return;

            case ObserverAction.Invalidate: SetToolStripMenu(); return;

            case ObserverAction.Select: SetToolStripMenu(); return;
            }
        }
Пример #3
0
        /// <summary>
        /// 수신된 ObserverAction 에 따라서 처리 한다.
        /// </summary>
        public void OnNext(ObserverAction action)
        {
            switch (action)
            {
            case ObserverAction.Invalidate: this.Invalidate(false); return;

            case ObserverAction.FileLoad: this.Invalidate(false); return;

            case ObserverAction.New: this.Invalidate(false); return;
            }
        }
Пример #4
0
        /// <summary>
        /// 수신된 ObserverAction 에 따라서 처리 한다.
        /// </summary>
        public void OnNext(ObserverAction action)
        {
            switch (action)
            {
            case ObserverAction.Command: this.SetUndoRedoButton(); return;

            case ObserverAction.Invalidate: this.SetToolBarButtonState("Select"); return;

            case ObserverAction.Ellipse: this.SetToolBarButtonState("Ellipse"); return;

            case ObserverAction.Line: this.SetToolBarButtonState("Line"); return;

            case ObserverAction.Pencil: this.SetToolBarButtonState("Pencil"); return;

            case ObserverAction.Rectangle: this.SetToolBarButtonState("Rectangle"); return;

            case ObserverAction.Select: this.SetToolBarButtonState("Select"); return;

            case ObserverAction.FileLoad: this.SetToolBarButtonState("Select"); this.SetUndoRedoButton(); return;

            case ObserverAction.New: this.SetToolBarButtonState("Select"); this.SetUndoRedoButton(); return;
            }
        }
Пример #5
0
 public void RemoveAction(ObserverAction <ActionType> action)
 {
     _actions -= action;
 }
Пример #6
0
 public void AddAction(ObserverAction <ActionType> action)
 {
     _actions += action;
 }