Esempio n. 1
0
        /// <summary>
        /// Réception du message
        /// </summary>
        /// <param name="message">message réceptionné</param>
        public void Receive(Message message)
        {
            Message reverse;
            switch (message.Type)
            {
                case ChangeType.AddControl:
                    reverse = new Message(message.Sender, ChangeType.RemoveControl, message.Arguments);
                    break;

                case ChangeType.ChangeProperty:
                    reverse = new Message(message.Sender, ChangeType.ChangeProperty, message.Arguments);
                    break;

                case ChangeType.RemoveControl:
                    reverse = new Message(message.Sender, ChangeType.AddControl, message.Arguments);
                    break;
                default:
                    return;
            }

            switch (message.Action)
            {
                case ActionType.Do:
                    ListUndo.Insert(0, reverse);
                    break;

                case ActionType.Undo:
                    ListDo.Insert(0, reverse);
                    break;
            }
        }
Esempio n. 2
0
 public void Receive(Message message)
 {            
     isDocumentChanged = (message.Type != ChangeType.SelectControl) || IsDocumentChanged;           
     Model.Receive(message);            
 }
 /// <summary>
 /// Création d'un message
 /// </summary>
 /// <param name="change">
 /// Type de message
 /// </param>
 /// <param name="infos">
 /// Arguments du message
 /// </param>
 private void CreateMessage(ChangeType change, string[] infos)
 {
     Stl.Tme.Components.Tools.Message msg = new Stl.Tme.Components.Tools.Message(this, change, infos);
     MessageEventArgs args = new MessageEventArgs(msg);
     Controller.Receive(msg);
 }
Esempio n. 4
0
 /// <summary>
 /// Constructeur
 /// </summary>
 /// <param name="message">
 /// Message permettant de construire la requête d'ajout
 /// </param>
 public MessageEventArgs(Message message)
 {
     this.Message = message;
 }