示例#1
0
        public MessageLine(MessageGroup line)
        {
            this.InitializeComponent();

            this.MessageItem = line;

            Unloaded += MessageLine_Unloaded;
            Loaded   += MessageLine_Loaded;
            MainPage.instance.UiUpdated += Instance_UiUpdated;
        }
示例#2
0
        public void AddMessage(Message message)
        {
            if (!Config.GetBoolean(Config.ModernChat))
            {
                Grouped.Add(new MessageGroup()
                {
                    Parent = message
                });

                return;
            }

            try
            {
                var CurrentItem = Grouped.Last();

                if (CurrentItem.Parent.User == message.User && CurrentItem.Parent.Type == message.Type && CurrentItem.Parent.Date.Hour == message.Date.Hour)
                {
                    CurrentItem.Children.Add(message);
                    return;
                }

                if (CurrentItem.Parent.Type == MessageType.JoinPart && message.Type == MessageType.JoinPart)
                {
                    CurrentItem.Children.Add(message);
                    return;
                }
            } catch { }

            var group = new MessageGroup()
            {
                Parent = message
            };

            group.Children.Add(message);

            Grouped.Add(group);
        }