public EventInfo(StEvent e, int userId, int discussionId, DateTime timestamp, int topicId, DeviceType devType) { this.e = e; this.userId = userId; this.discussionId = discussionId; this.timestamp = timestamp; this.topicId = topicId; this.devType = devType; }
public void Read(BinaryReader r) { e = (StEvent) r.ReadInt32(); userId = r.ReadInt32(); discussionId = r.ReadInt32(); topicId = r.ReadInt32(); devType = (DeviceType) r.ReadInt32(); StickHeight = r.ReadDouble(); Span = TimeSpan.FromSeconds(r.ReadDouble()); }
public static void ReportMediaOpened(StEvent ev, Attachment a) { if (a == null || a.ArgPoint == null) { return; } UISharedRTClient.Instance.clienRt.SendStatsEvent(ev, SessionInfo.Get().person.Id, a.ArgPoint.Topic.Discussion.Id, a.ArgPoint.Topic.Id, DeviceType.Wpf); }
public void SendStatsEvent(StEvent e, int userId, int discussionId, int topicId, DeviceType devType) { if (peer == null || peer.PeerState != PeerStateValue.Connected) { return; } if (e == StEvent.LocalIgnorableEvent) { return; } var par = Serializers.WriteStatEventParams(e, userId, discussionId, topicId, devType); peer.OpCustom((byte)DiscussionOpCode.StatsEvent, par, true); }
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; }
public static bool Log(DiscCtx ctx, StEvent e, int userId, int discussionId, int topicId, DeviceType devType) { var pers = ctx.Person.FirstOrDefault(p0 => p0.Id == userId); if (pers == null && userId != -1) return false; var disc = ctx.Discussion.FirstOrDefault(d0 => d0.Id == discussionId); if (disc == null) return false; var topic = ctx.Topic.FirstOrDefault(t0 => t0.Id == topicId); if (topic == null) return false; if (!topic.Running && e != StEvent.RecordingStarted && e != StEvent.RecordingStopped) { return false; } var s = new StatsEvent { DiscussionId = discussionId, DiscussionName = disc.Subject, TopicId = topicId, TopicName = topic.Name, UserId = userId }; if (pers != null) s.UserName = pers.Name; else s.UserName = "******"; s.Event = (int) e; s.Time = DateTime.Now; s.DeviceType = (int) devType; ctx.AddToStatsEvent(s); ctx.SaveChanges(); return true; }
public static bool LogAndBroadcast(DiscCtx ctx, DiscussionRoom room, StEvent ev, int usrId, int topicId) { var res = EventLogger.Log(ctx, ev, usrId, room.DiscId, topicId, DeviceType.Wpf); if (res) { room.BroadcastReliableToRoom((byte)DiscussionEventCode.StatsEvent, Serializers.WriteStatEventParams(ev, usrId, room.DiscId, topicId, DeviceType.Wpf) ); } return(res); }
public static bool LogAndBroadcast(DiscCtx ctx, DiscussionRoom room, StEvent ev, int usrId, int topicId) { var res = EventLogger.Log(ctx, ev, usrId, room.DiscId, topicId, DeviceType.Wpf); if (res) { room.BroadcastReliableToRoom((byte) DiscussionEventCode.StatsEvent, Serializers.WriteStatEventParams(ev, usrId, room.DiscId, topicId, DeviceType.Wpf) ); } return res; }
public void CountEvent(StEvent ev, int eventId) { if (countedEventIds.Contains(eventId)) return; countedEventIds.Add(eventId); switch (ev) { case StEvent.RecordingStarted: TotalRecordingStarted++; break; case StEvent.RecordingStopped: TotalRecordingStopped++; break; case StEvent.BadgeCreated: TotalBadgeCreated++; break; case StEvent.BadgeEdited: TotalBadgeEdited++; break; case StEvent.BadgeMoved: TotalBadgeMoved++; break; case StEvent.BadgeZoomIn: TotalBadgeZoomIn++; break; case StEvent.ClusterCreated: TotalClusterCreated++; break; case StEvent.ClusterDeleted: TotalClusterDeleted++; break; case StEvent.ClusterIn: TotalClusterIn++; break; case StEvent.ClusterOut: TotalClusterOut++; break; case StEvent.ClusterMoved: TotalClusterMoved++; break; case StEvent.ClusterTitleAdded: TotalClusterTitlesAdded++; break; case StEvent.ClusterTitleEdited: TotalClusterTitlesEdited++; break; case StEvent.ClusterTitleRemoved: TotalClusterTitlesRemoved++; break; case StEvent.LinkCreated: TotalLinkCreated++; break; case StEvent.LinkRemoved: TotalLinkRemoved++; break; case StEvent.FreeDrawingCreated: TotalFreeDrawingCreated++; break; case StEvent.FreeDrawingRemoved: TotalFreeDrawingRemoved++; break; case StEvent.FreeDrawingResize: TotalFreeDrawingResize++; break; case StEvent.FreeDrawingMoved: TotalFreeDrawingMoved++; break; case StEvent.SceneZoomedIn: TotalSceneZoomedIn++; break; case StEvent.SceneZoomedOut: TotalSceneZoomedOut++; break; case StEvent.ArgPointTopicChanged: TotalArgPointTopicChanged++; break; case StEvent.SourceAdded: TotalSourceAdded++; break; case StEvent.SourceRemoved: TotalSourceRemoved++; break; case StEvent.ImageAdded: TotalImageAdded++; break; case StEvent.ImageUrlAdded: TotalImageUrlAdded++; break; case StEvent.PdfAdded: TotalPdfAdded++; break; case StEvent.PdfUrlAdded: TotalPdfUrlAdded++; break; case StEvent.YoutubeAdded: TotalYoutubeAdded++; break; case StEvent.ScreenshotAdded: TotalScreenshotAdded++; break; case StEvent.MediaRemoved: TotalMediaRemoved++; break; case StEvent.CommentAdded: TotalCommentAdded++; break; case StEvent.CommentRemoved: TotalCommentRemoved++; break; case StEvent.ImageOpened: TotalImageOpened++; break; case StEvent.VideoOpened: TotalVideoOpened++; break; case StEvent.ScreenshotOpened: TotalScreenshotOpened++; break; case StEvent.PdfOpened: TotalPdfOpened++; break; case StEvent.SourceOpened: TotalSourceOpened++; break; case StEvent.LaserEnabled: TotalLaserEnabled++; break; default: throw new NotSupportedException(); } }
private void OnStatsEvent(StEvent e, int userId, int discussionId, int topicId, DeviceType devType) { RecentEvents.Add(new EventViewModel(e, userId, DateTime.Now, devType)); }
public bool EventExported(StEvent eventCode) { switch (eventCode) { case StEvent.RecordingStarted: return true; case StEvent.RecordingStopped: return true; case StEvent.BadgeCreated: return NoBadgeCreated; case StEvent.BadgeEdited: return NoBadgeEdited; case StEvent.BadgeMoved: return NoBadgeMoved; case StEvent.BadgeZoomIn: return NoBadgeZoomIn; case StEvent.ClusterCreated: return NoClusterCreated; case StEvent.ClusterDeleted: return NoClusterDeleted; case StEvent.ClusterIn: return NoClusterIn; case StEvent.ClusterOut: return NoClusterOut; case StEvent.ClusterMoved: return NoClusterMoved; case StEvent.ClusterTitleAdded: return NoClusterTitlesAdded; case StEvent.ClusterTitleEdited: return NoClusterTitlesEdited; case StEvent.ClusterTitleRemoved: return NoClusterTitlesRemoved; case StEvent.LinkCreated: return NoLinksCreated; case StEvent.LinkRemoved: return NoLinksRemoved; case StEvent.FreeDrawingCreated: return NoFreeDrawingCreated; case StEvent.FreeDrawingRemoved: return NoFreeDrawingRemoved; case StEvent.FreeDrawingResize: return NoFreeDrawingResize; case StEvent.FreeDrawingMoved: return NoFreeDrawingMoved; case StEvent.SceneZoomedIn: return NoSceneZoomIn; case StEvent.SceneZoomedOut: return NoSceneZoomOut; case StEvent.ArgPointTopicChanged: return ArgPointTopicChanged; case StEvent.SourceAdded: return NoSourcesAdded; case StEvent.SourceRemoved: return NoSourcesRemoved; case StEvent.ImageAdded: return NoImageAdded; case StEvent.ImageUrlAdded: return NoImageUrlAdded; case StEvent.PdfAdded: return NoPdfAdded; case StEvent.PdfUrlAdded: return NoPdfUrlAdded; case StEvent.YoutubeAdded: return NoVideoAdded; case StEvent.ScreenshotAdded: return NoScreenshotsAdded; case StEvent.MediaRemoved: return NoMediaRemoved; case StEvent.CommentAdded: return NoCommentsAdded; case StEvent.CommentRemoved: return NoCommentsRemoved; case StEvent.ImageOpened: return NoImageOpened; case StEvent.VideoOpened: return NoVideoOpened; case StEvent.ScreenshotOpened: return NoScreenshotsOpened; case StEvent.PdfOpened: return NoPdfOpened; case StEvent.SourceOpened: return NoSourcesOpened; case StEvent.LocalIgnorableEvent: return true; case StEvent.LaserEnabled: return NoLaserEnabled; default: throw new ArgumentOutOfRangeException("eventCode"); } }
private bool FireStatsEvent(StEvent e, int personId = -2) { if (cbxTopics.SelectedItem == null) { MessageDlg.Show("Please first select topic"); return false; } if (personId == -2) { if (lstUsers.SelectedItem == null) { MessageDlg.Show("Please first select user who initiates the event"); return false; } personId = ((Person) lstUsers.SelectedItem).Id; } else { //we use given personId } var newEvent = new TimelineEvent(e, personId, login.discussion.Id, _timelineModel, _timelineModel.CurrentTime, ((Topic) cbxTopics.SelectedItem).Id, login.devType); EventGen.timeline.CommandManager.Instance.RegisterDoneCommand(new CreateEventCommand(newEvent, true)); UpdateEventCounts(); return true; }
public static Dictionary<byte, object> WriteStatEventParams(StEvent e, int userId, int discussionId, int topicId, DeviceType deviceType) { Dictionary<byte, object> res = new Dictionary<byte, object>(); res[(byte) DiscussionParamKey.DiscussionId] = discussionId; res[(byte) DiscussionParamKey.UserId] = userId; res[(byte) DiscussionParamKey.StatsEvent] = e; res[(byte) DiscussionParamKey.ChangedTopicId] = topicId; res[(byte) DiscussionParamKey.DeviceType] = deviceType; return res; }
public EventViewModel(StEvent eventCode, int userId, DateTime stamp, DeviceType device) { dateTime = stamp.ToString(); var usr = DbCtx.Get().Person.FirstOrDefault(p0 => p0.Id == userId); if (usr != null) { userName = usr.Name; userColor = new SolidColorBrush(Utils2.IntToColor(usr.Color)); } else { userName = "******"; userColor = new SolidColorBrush(Colors.Aqua); } switch (eventCode) { case StEvent.RecordingStarted: evt = "enabled event recording"; break; case StEvent.RecordingStopped: evt = "disabled event recording"; break; case StEvent.BadgeCreated: evt = "created badge"; break; case StEvent.BadgeEdited: evt = "edited badge"; break; case StEvent.BadgeMoved: evt = "moved badge"; break; case StEvent.BadgeZoomIn: evt = "zoomed in badge"; break; case StEvent.ClusterCreated: evt = "created cluster"; break; case StEvent.ClusterDeleted: evt = "deleted cluster"; break; case StEvent.ClusterIn: evt = "cluster-in"; break; case StEvent.ClusterOut: evt = "cluster-out"; break; case StEvent.ClusterMoved: evt = "moved cluster"; break; case StEvent.ClusterTitleAdded: evt = "cluster title added"; break; case StEvent.ClusterTitleRemoved: evt = "cluster title removed"; break; case StEvent.ClusterTitleEdited: evt = "cluster title edited"; break; case StEvent.LinkCreated: evt = "created link"; break; case StEvent.LinkRemoved: evt = "removed link"; break; case StEvent.FreeDrawingCreated: evt = "created free drawing"; break; case StEvent.FreeDrawingRemoved: evt = "removed free drawing"; break; case StEvent.FreeDrawingResize: evt = "resized free drawing"; break; case StEvent.FreeDrawingMoved: evt = "moved free drawing"; break; case StEvent.SceneZoomedIn: evt = "zoomed in scene"; break; case StEvent.SceneZoomedOut: evt = "zoomed out scene"; break; case StEvent.ArgPointTopicChanged: evt = "point transfer"; break; case StEvent.SourceAdded: evt = "added source"; break; case StEvent.SourceRemoved: evt = "removed source"; break; case StEvent.ImageAdded: evt = "added image file"; break; case StEvent.ImageUrlAdded: evt = "added link to image"; break; case StEvent.PdfAdded: evt = "added PDF"; break; case StEvent.PdfUrlAdded: evt = "added link to PDF"; break; case StEvent.YoutubeAdded: evt = "added Youtube video"; break; case StEvent.ScreenshotAdded: evt = "added screenshot"; break; case StEvent.MediaRemoved: evt = "removed media"; break; case StEvent.CommentAdded: evt = "added comment"; break; case StEvent.CommentRemoved: evt = "removed comment"; break; case StEvent.ImageOpened: evt = "opened image"; break; case StEvent.VideoOpened: evt = "opened video"; break; case StEvent.ScreenshotOpened: evt = "opened screenshot"; break; case StEvent.PdfOpened: evt = "opened PDF"; break; case StEvent.SourceOpened: evt = "opened source"; break; case StEvent.LaserEnabled: evt = "laser enabled"; break; default: throw new NotSupportedException(); } switch (device) { case DeviceType.Android: devType = "App"; break; case DeviceType.Wpf: devType = "Windows"; break; case DeviceType.Sticky: devType = "Sticky"; break; default: throw new NotSupportedException(); } }
public bool EventExported(StEvent eventCode) { switch (eventCode) { case StEvent.RecordingStarted: return(true); case StEvent.RecordingStopped: return(true); case StEvent.BadgeCreated: return(NoBadgeCreated); case StEvent.BadgeEdited: return(NoBadgeEdited); case StEvent.BadgeMoved: return(NoBadgeMoved); case StEvent.BadgeZoomIn: return(NoBadgeZoomIn); case StEvent.ClusterCreated: return(NoClusterCreated); case StEvent.ClusterDeleted: return(NoClusterDeleted); case StEvent.ClusterIn: return(NoClusterIn); case StEvent.ClusterOut: return(NoClusterOut); case StEvent.ClusterMoved: return(NoClusterMoved); case StEvent.ClusterTitleAdded: return(NoClusterTitlesAdded); case StEvent.ClusterTitleEdited: return(NoClusterTitlesEdited); case StEvent.ClusterTitleRemoved: return(NoClusterTitlesRemoved); case StEvent.LinkCreated: return(NoLinksCreated); case StEvent.LinkRemoved: return(NoLinksRemoved); case StEvent.FreeDrawingCreated: return(NoFreeDrawingCreated); case StEvent.FreeDrawingRemoved: return(NoFreeDrawingRemoved); case StEvent.FreeDrawingResize: return(NoFreeDrawingResize); case StEvent.FreeDrawingMoved: return(NoFreeDrawingMoved); case StEvent.SceneZoomedIn: return(NoSceneZoomIn); case StEvent.SceneZoomedOut: return(NoSceneZoomOut); case StEvent.ArgPointTopicChanged: return(ArgPointTopicChanged); case StEvent.SourceAdded: return(NoSourcesAdded); case StEvent.SourceRemoved: return(NoSourcesRemoved); case StEvent.ImageAdded: return(NoImageAdded); case StEvent.ImageUrlAdded: return(NoImageUrlAdded); case StEvent.PdfAdded: return(NoPdfAdded); case StEvent.PdfUrlAdded: return(NoPdfUrlAdded); case StEvent.YoutubeAdded: return(NoVideoAdded); case StEvent.ScreenshotAdded: return(NoScreenshotsAdded); case StEvent.MediaRemoved: return(NoMediaRemoved); case StEvent.CommentAdded: return(NoCommentsAdded); case StEvent.CommentRemoved: return(NoCommentsRemoved); case StEvent.ImageOpened: return(NoImageOpened); case StEvent.VideoOpened: return(NoVideoOpened); case StEvent.ScreenshotOpened: return(NoScreenshotsOpened); case StEvent.PdfOpened: return(NoPdfOpened); case StEvent.SourceOpened: return(NoSourcesOpened); case StEvent.LocalIgnorableEvent: return(true); case StEvent.LaserEnabled: return(NoLaserEnabled); default: throw new ArgumentOutOfRangeException("eventCode"); } }
public void CountEvent(StEvent ev, int eventId) { if (countedEventIds.Contains(eventId)) { return; } countedEventIds.Add(eventId); switch (ev) { case StEvent.RecordingStarted: break; case StEvent.RecordingStopped: break; case StEvent.BadgeCreated: TotalBadgeCreated++; break; case StEvent.BadgeEdited: TotalBadgeEdited++; break; case StEvent.BadgeMoved: TotalBadgeMoved++; break; case StEvent.BadgeZoomIn: TotalBadgeZoomIn++; break; case StEvent.ClusterCreated: TotalClusterCreated++; break; case StEvent.ClusterDeleted: TotalClusterDeleted++; break; case StEvent.ClusterIn: TotalClusterIn++; break; case StEvent.ClusterOut: TotalClusterOut++; break; case StEvent.ClusterMoved: TotalClusterMoved++; break; case StEvent.ClusterTitleAdded: TotalClusterTitlesAdded++; break; case StEvent.ClusterTitleEdited: TotalClusterTitlesEdited++; break; case StEvent.ClusterTitleRemoved: TotalClusterTitlesRemoved++; break; case StEvent.LinkCreated: TotalLinkCreated++; break; case StEvent.LinkRemoved: TotalLinkRemoved++; break; case StEvent.FreeDrawingCreated: TotalFreeDrawingCreated++; break; case StEvent.FreeDrawingRemoved: TotalFreeDrawingRemoved++; break; case StEvent.FreeDrawingResize: TotalFreeDrawingResize++; break; case StEvent.FreeDrawingMoved: TotalFreeDrawingMoved++; break; case StEvent.SceneZoomedIn: TotalSceneZoomedIn++; break; case StEvent.SceneZoomedOut: TotalSceneZoomedOut++; break; case StEvent.ArgPointTopicChanged: TotalArgPointTopicChanged++; break; case StEvent.SourceAdded: TotalSourceAdded++; break; case StEvent.SourceRemoved: TotalSourceRemoved++; break; case StEvent.ImageAdded: TotalImageAdded++; break; case StEvent.ImageUrlAdded: TotalImageUrlAdded++; break; case StEvent.PdfAdded: TotalPdfAdded++; break; case StEvent.PdfUrlAdded: TotalPdfAdded++; break; case StEvent.YoutubeAdded: TotalYoutubeAdded++; break; case StEvent.ScreenshotAdded: TotalScreenshotAdded++; break; case StEvent.MediaRemoved: TotalMediaRemoved++; break; case StEvent.CommentAdded: TotalCommentAdded++; break; case StEvent.CommentRemoved: TotalCommentRemoved++; break; case StEvent.ImageOpened: TotalImageOpened++; break; case StEvent.VideoOpened: TotalVideoOpened++; break; case StEvent.ScreenshotOpened: TotalScreenshotOpened++; break; case StEvent.PdfOpened: TotalPdfOpened++; break; case StEvent.SourceOpened: TotalSourceOpened++; break; case StEvent.LaserEnabled: TotalLaserEnabled++; break; default: throw new NotSupportedException(); } }
public void SendStatsEvent(StEvent e, int userId, int discussionId, int topicId, DeviceType devType) { if (peer == null || peer.PeerState != PeerStateValue.Connected) return; if (e == StEvent.LocalIgnorableEvent) return; var par = Serializers.WriteStatEventParams(e, userId, discussionId, topicId, devType); peer.OpCustom((byte)DiscussionOpCode.StatsEvent, par, true); }
public static void ReadStatEventParams(Dictionary<byte, object> par, out StEvent e, out int userId, out int discussionId, out int topicId, out DeviceType deviceType) { discussionId = (int) par[(byte) DiscussionParamKey.DiscussionId]; userId = (int) par[(byte) DiscussionParamKey.UserId]; e = (StEvent) par[(byte) DiscussionParamKey.StatsEvent]; topicId = (int) par[(byte) DiscussionParamKey.ChangedTopicId]; deviceType = (DeviceType) par[(byte) DiscussionParamKey.DeviceType]; }