Пример #1
0
 protected internal virtual void OnTimeSeparatorAdding(TimeSeparatorEventArgs e)
 {
     if (this.TimeSeparatorAdding == null)
     {
         return;
     }
     this.TimeSeparatorAdding((object)this, e);
 }
Пример #2
0
        public virtual bool ShouldAddTimeSeparator(BaseChatDataItem item, BaseChatDataItem previousItem)
        {
            if (this.TimeSeparatorInterval == TimeSpan.Zero)
            {
                return(false);
            }
            bool shouldAddSeparator = false;

            if (previousItem == null || item.Message.TimeStamp - previousItem.Message.TimeStamp >= this.timeSeparatorInterval)
            {
                shouldAddSeparator = true;
            }
            TimeSeparatorEventArgs e = new TimeSeparatorEventArgs(shouldAddSeparator, previousItem, item);

            this.ChatElement.OnTimeSeparatorAdding(e);
            return(e.ShouldAddSeparator);
        }