Example #1
0
        private static void AddEventRow(StringBuilder sb, StatsEvent ev)
        {
            var eventView = new EventViewModel((StEvent) ev.Event, ev.UserId, ev.Time, (DeviceType)ev.DeviceType);

            sb.Append(ev.Id);
            sb.Append(";");
            sb.Append(ev.Event);
            sb.Append(";");
            sb.Append("\"" + eventView.evt + "\"");

            sb.Append(";");
            sb.Append(ev.DiscussionId);
            sb.Append(";");
            sb.Append("\"" + ev.DiscussionName + "\"");
            sb.Append(";");
            sb.Append(ev.TopicId);
            sb.Append(";");
            sb.Append("\"" + ev.TopicName + "\"");
            sb.Append(";");
            sb.Append(ev.UserId);
            sb.Append(";");
            sb.Append("\"" + ev.UserName + "\"");
            sb.Append(";");
            sb.Append(ev.Time.ToString("dd.MM.yyyy HH:mm:ss"));
            sb.Append(";");
            sb.Append(ev.DeviceType);
            sb.Append(";");
            sb.AppendLine("\"" + eventView.devType + "\"");
        }
Example #2
0
        private TreeViewItem GetEvent(StatsEvent e, DiscCtx ctx)
        {
            var res = new TreeViewItem();
            var eventView = new EventViewModel((StEvent) e.Event, e.UserId, e.Time, (DeviceType) e.DeviceType);
            res.Header = eventView.evt;

            res.Items.Add(GetUser(ctx.Person.FirstOrDefault(p0 => p0.Id == e.UserId)));

            if (!string.IsNullOrEmpty(e.TopicName))
                res.Items.Add(e.TopicName);
            if (!string.IsNullOrEmpty(e.DiscussionName))
                res.Items.Add(e.DiscussionName);
            res.Items.Add(eventView.dateTime);
            res.Items.Add(eventView.devType);

            return res;
        }
Example #3
0
        public TimelineEvent(BinaryReader r, Timeline timeline)
        {
            this.timeline = timeline;

            Read(r);

            //update view params
            var evm = new EventViewModel(e, userId, DateTime.Now, devType);
            _userColor = evm.userColor;
            _userName = evm.userName;
            _devName = evm.devType;
            _eventName = evm.evt;
        }
Example #4
0
        public TimelineEvent(StEvent e, int userId, int discussionId, Timeline timeline, TimeSpan timespan, int topicId,
                             DeviceType devType)
        {
            this.timeline = timeline;
            this.e = e;
            this.userId = userId;
            this.discussionId = discussionId;
            this.Span = timespan;
            this.topicId = topicId;
            this.devType = devType;

            var evm = new EventViewModel(e, userId, DateTime.Now, devType);
            _userColor = evm.userColor;
            _userName = evm.userName;
            _devName = evm.devType;
            _eventName = evm.evt;
        }
Example #5
0
 // keeps size-restricted list of n recent events
 private void ShowRecentEvent(EventViewModel e)
 {
     RecentEvents.Insert(0, e);
 }