/// <summary>
        /// Function:Add a message info to TimeSliceGroup items
        /// Author:Jerry Xu
        /// Date:2008-7-7
        /// </summary>
        /// <param name="message">inserted position:MessageAdpaterInfo</param>
        /// <param name="newMessage">Inserted message:MessageAdpaterInfo</param>
        /// <returns>bool:Insert flag</returns>
        public bool Add(MessageAdapterInfo message, MessageAdapterInfo newMessage)
        {
            if (newMessage == null || newMessage.IsEmpty)
            {
                return(false);
            }

            if (message == null)
            {
                _items.AddFirst(newMessage);
            }
            else
            {
                //Find the message info in TimeSliceGroup items
                _node = _items.Find(message);
                if (_node != null)
                {
                    _items.AddBefore(_node, newMessage);
                }
                else
                {
                    _items.AddLast(newMessage);
                }
            }
            return(true);
        }
Exemple #2
0
        public override LibraryAdapter Copy()
        {
            MessageAdapterInfo clone = new MessageAdapterInfo();

            clone.FromTo(this);
            return(clone);
            //return base.Copy();
        }
 /// <summary>
 /// Function:Delete a message info from TimeSliceGroup items
 /// Author:Jerry Xu
 /// Date:2008-7-7
 /// </summary>
 /// <param name="message">Deleted message info:MessageInfo</param>
 /// <returns>bool:Deleted flag</returns>
 public bool Delete(MessageAdapterInfo message)
 {
     if (message != null && message.IsEmpty)
     {
         _items.Remove(message);
     }
     return(true);
 }
 /// <summary>
 /// Function:Add a message info to TimeSliceGroup items
 /// Author:Jerry Xu
 /// Date:2008-7-13
 /// </summary>
 /// <param name="message">inserted MessageInfo</param>
 /// <returns>bool:Insert flag</returns>
 public bool Add(MessageAdapterInfo message)
 {
     if (message == null)
     {
         return(false);
     }
     _items.AddLast(message);
     return(true);
 }
        /// <summary>
        /// Function:Set next MessageAdapterInfo by current MessageAdapterInfo name
        /// Author:Jerry Xu
        /// Date:2008-11-27
        /// </summary>
        public void SetCurrentMessageAdapter()
        {
            if (Target == null)
            {
                _currentMessageAdapterName = string.Empty;
                return;
            }
            MessageAdapterInfo adapter = TimeSliceGroup.GetCurrentMessageAdapter(_currentMessageAdapterName);

            if (adapter != null)
            {
                _currentMessageAdapterName = adapter.Name;
            }
            else
            {
                _currentMessageAdapterName = string.Empty;
            }
        }