コード例 #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            TimelineModel timelineModel1 = new TimelineModel();
            this.timelineControl1 = new TimelineControl();
            this.SuspendLayout();
            // 
            // timelineControl1
            // 
            this.timelineControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.timelineControl1.Location = new System.Drawing.Point(0, 0);
            this.timelineControl1.Model = timelineModel1;
            this.timelineControl1.Name = "timelineControl1";
            this.timelineControl1.Size = new System.Drawing.Size(284, 261);
            this.timelineControl1.TabIndex = 0;
            this.timelineControl1.Text = "timelineControl1";
            this.timelineControl1.TimeOffset = 0F;
            this.timelineControl1.TimeScale = 1F;
            // 
            // TimelineForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 261);
            this.Controls.Add(this.timelineControl1);
            this.Name = "TimelineForm";
            this.Text = "TimelineForm";
            this.ResumeLayout(false);

        }
コード例 #2
0
        // Рисует диаграмму указанных статусов для типа события по одному компоненту
        public ActionResult ForEventType(Guid id, Guid eventTypeId, DateTime?fromDate, DateTime?toDate, bool?hideUptime)
        {
            var eDate = toDate ?? DateTime.Now;
            var sDate = fromDate ?? eDate.AddHours(-24);

            var eventType       = GetEventTypeById(eventTypeId);
            var eventRepository = CurrentAccountDbContext.GetEventRepository();

            var states = eventRepository.GetTimelineStates(id, eventTypeId, sDate, eDate);
            var items  = this.GetTimelineItemsByStates(states, sDate, eDate);
            var okTime = eventRepository.GetTimelineOkTime(states, sDate, eDate);

            var model = new TimelineModel()
            {
                Category    = eventType.Category,
                OwnerId     = id,
                DateFrom    = sDate,
                DateTo      = eDate,
                Items       = items,
                OkTime      = okTime,
                EventTypeId = eventTypeId,
                HideUptime  = hideUptime ?? false
            };

            return(PartialView("TimelinePartial", model));
        }
コード例 #3
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="timelineModel">遷移元のTimelineModel</param>
        /// <param name="id">ツイートID</param>
        public ShowStatus(TimelineModel timelineModel, long id)
        {
            this.InitializeComponent();

            this.ShowStatusViewModel = new ShowStatusViewModel(timelineModel, id);
            this.DataContext         = this.ShowStatusViewModel;
        }
コード例 #4
0
        public TimelineModel LoadKnowledgeTimeline(int page, int pageSize)
        {
            var items = _dbContext.KnoledgeEntries
                        .Include(x => x.Documents)
                        .ToList();

            var count  = items.Count();
            var result = items
                         .OrderByDescending(x => x.Date)
                         .Skip(page * pageSize)
                         .Take(pageSize)
                         .Select(x => new TimelineItemModel
            {
                Id        = x.Id,
                Content   = x.Content,
                Date      = x.Date,
                User      = x.User,
                Link      = ToLinkModel(x.Link),
                Documents = ToDocumentModels(x.Documents)
            });

            var model = new TimelineModel
            {
                PageNumber    = page,
                PageSize      = pageSize,
                Items         = result,
                OverallLength = count
            };

            return(model);
        }
コード例 #5
0
        public GetUserInformationQueryResult Execute(GetUserInformationQuery query)
        {
            var list = _userInformationRepository.GetAll();

            var userModelList = new List <UserModel>();

            foreach (var item in list)
            {
                var timelineModel = new TimelineModel()
                {
                    TimelineDecision             = item.TimelineDecision,
                    NumberOfGeneratedUrls        = item.NumberOfGeneratedUrls,
                    NumberOfRetweetsFromTimeline = item.NumberOfRetweetsFromTimeline,
                    NumberOfTweetsFromTimeline   = item.NumberOfTweetsFromTimeline,
                    RetweetsCounter             = item.RetweetsCounter,
                    CollectedTweetsFromTimeline = item.CollectedTweetsFromTimeline
                };

                var user = new UserModel()
                {
                    AccountActivity   = item.AccountActivity,
                    AccountAnonimity  = item.AccountAnonimity,
                    DaysActiveAccount = item.DaysActiveAccount,
                    ScreenName        = item.TweetUsername,
                    NumberOfTweets    = item.NumberOfTweets,
                    IsBot             = item.IsBot,
                    TimelineModel     = timelineModel
                };

                userModelList.Add(user);
            }

            return(new GetUserInformationQueryResult(userModelList));
        }
コード例 #6
0
        public IHttpActionResult Get(string id, string itemId)
        {
            List <ITimeLine> timeLine = repository.GetUserTimeLine(id, itemId);
            TimelineModel    model    = ConstructTimelineModel(id, timeLine);

            return(Ok(model));
        }
コード例 #7
0
        public IHttpActionResult Get(string id, int skip, int take, TimeLineEntry type)
        {
            List <ITimeLine> timeLine = repository.GetUserTimeLine(id, skip, take, type);
            TimelineModel    model    = ConstructTimelineModel(id, timeLine);

            return(Ok(model));
        }
        public GetUserInformationByUsernameQueryResult Execute(GetUserInformationByUsernameQuery query)
        {
            var user = _userInformationRepository.GetByUsername(query.Username);

            if (user != null)
            {
                var timelineModel = new TimelineModel()
                {
                    TimelineDecision             = user.TimelineDecision,
                    NumberOfGeneratedUrls        = user.NumberOfGeneratedUrls,
                    NumberOfRetweetsFromTimeline = user.NumberOfRetweetsFromTimeline,
                    NumberOfTweetsFromTimeline   = user.NumberOfTweetsFromTimeline,
                    RetweetsCounter             = user.RetweetsCounter,
                    CollectedTweetsFromTimeline = user.CollectedTweetsFromTimeline
                };

                var usermodel = new UserModel()
                {
                    AccountActivity   = user.AccountActivity,
                    AccountAnonimity  = user.AccountAnonimity,
                    DaysActiveAccount = user.DaysActiveAccount,
                    ScreenName        = user.TweetUsername,
                    NumberOfTweets    = user.NumberOfTweets,
                    IsBot             = user.IsBot,
                    TimelineModel     = timelineModel
                };

                return(new GetUserInformationByUsernameQueryResult(usermodel));
            }

            return(null);
        }
コード例 #9
0
        public IHttpActionResult GetFull(string id, int skip, int take, TimeLineEntry type)
        {
            TimelineModel model = new TimelineModel
            {
                User            = repository.GetUser(id, true),
                TimelineEntries = new List <TimelineEntryModel>()
            };

            //
            List <string> userIds = new List <string> {
                id
            };

            userIds.AddRange(model.User.FollowingIds.Select(x => x.Id));

            foreach (string userId in userIds)
            {
                List <ITimeLine> timeLine = repository.GetUserTimeLine(userId, skip, take, type);
                foreach (ITimeLine entry in timeLine)
                {
                    var timelineEntryModel = GetTimelineEntryModel(entry);

                    // Add to time line model
                    model.TimelineEntries.Add(timelineEntryModel);
                }
            }

            // Order by date descending
            model.TimelineEntries = model.TimelineEntries.OrderByDescending(x => x.DateOfEntry).ToList();
            return(Ok(model));
        }
コード例 #10
0
        public void ShouldGetIfAnElementIsLinkedToOther()
        {
            var elementA = GetElementA();
            var elementB = GetElementB();
            var elementC = GetElementC();
            var model    = new TimelineModel();

            model.Tracks.Add(new Track {
                TrackType = TrackType.Visual
            });

            model.Tracks[0].Shots.Add(elementA);
            model.Tracks[0].Shots.Add(elementB);
            model.Tracks[0].Shots.Add(elementC);

            // B -> C
            model.LinkNextElement(elementB, elementC);

            var result = model.IsElementLinkedTo(elementB, elementC);

            Assert.IsTrue(result);

            result = model.IsElementLinkedTo(elementA, elementC);

            Assert.IsFalse(result);
        }
コード例 #11
0
        public static void ShowTimeline(
            TimelineModel timelineModel)
        {
            if (!TimelineSettings.Instance.Enabled ||
                !TimelineSettings.Instance.OverlayVisible)
            {
                return;
            }

            // 有効な表示データが含まれていない?
            if (!timelineModel.ExistsActivities())
            {
                return;
            }

            WPFHelper.Invoke(() =>
            {
                if (TimelineView == null)
                {
                    TimelineView = new TimelineOverlay();
                    TimelineView.Show();
                }

                TimelineView.Model = timelineModel;

                ChangeClickthrough(TimelineSettings.Instance.Clickthrough);

                TimelineView.OverlayVisible = true;
            });
        }
コード例 #12
0
        public void ShouldGetLastElementInChainOfLinks()
        {
            var elementA = GetElementA();
            var elementB = GetElementB();
            var elementC = GetElementC();
            var model    = new TimelineModel();

            model.Tracks.Add(new Track {
                TrackType = TrackType.Visual
            });

            model.Tracks[0].Shots.Add(elementA);
            model.Tracks[0].Shots.Add(elementB);
            model.Tracks[0].Shots.Add(elementC);

            // B -> C
            model.LinkNextElement(elementB, elementC);

            // A -> B
            model.LinkPreviousElement(elementB, elementA);

            var element = model.FindLastElementLinking(elementA, model.Tracks[0]);

            Assert.AreEqual(elementC, element);

            element = model.FindLastElementLinking(elementB, model.Tracks[0]);

            Assert.AreEqual(elementC, element);
        }
コード例 #13
0
        public void LinkLeftElementWrongPositionsReturnsFalse()
        {
            var elementA = GetElementA();
            var elementB = GetElementB();
            var elementC = GetElementC();
            var model    = new TimelineModel();

            model.Tracks.Add(new Track {
                TrackType = TrackType.Visual
            });

            model.Tracks[0].Shots.Add(elementA);
            model.Tracks[0].Shots.Add(elementB);
            model.Tracks[0].Shots.Add(elementC);

            var result = model.LinkPreviousElement(elementC, elementA);
            var linkA  = model.GetElementLink(elementA);
            var linkB  = model.GetElementLink(elementB);

            Assert.IsFalse(result);
            Assert.AreEqual(Guid.Empty, linkA.PreviousElementId);
            Assert.AreEqual(Guid.Empty, linkA.NextElementId);
            Assert.AreEqual(Guid.Empty, linkB.PreviousElementId);
            Assert.AreEqual(Guid.Empty, linkB.NextElementId);
        }
コード例 #14
0
        public void LinkLeftElement()
        {
            var elementA = GetElementA();
            var elementB = GetElementB();
            var model    = new TimelineModel();

            model.Tracks.Add(new Track {
                TrackType = TrackType.Visual
            });

            model.Tracks[0].Shots.Add(elementA);
            model.Tracks[0].Shots.Add(elementB);

            var result = model.LinkPreviousElement(elementB, elementA);
            var linkA  = model.GetElementLink(elementA);
            var linkB  = model.GetElementLink(elementB);

            Assert.IsTrue(result);
            Assert.IsNotNull(linkA);
            Assert.IsNotNull(linkB);
            Assert.AreEqual(elementB.Id, linkA.NextElementId);
            Assert.AreEqual(elementA.Id, linkB.PreviousElementId);
            Assert.AreEqual(Guid.Empty, linkA.PreviousElementId);
            Assert.AreEqual(Guid.Empty, linkB.NextElementId);
        }
コード例 #15
0
        public JsonResult <TimelineModel> GenerateTimeline(string locationName)
        {
            IJerniganManager        jerniganManager = new JerniganManager();
            GenerateTimelineRequest request         = new GenerateTimelineRequest()
            {
                LocationName = locationName
            };

            GenerateTimelineResponse [] response = jerniganManager.GenerateTimeline(request);
            TimelineModel model = new TimelineModel();

            model.Info = new List <Info>();
            response   = response.OrderBy(x => x.year).ToArray();

            foreach (GenerateTimelineResponse timeline in response)
            {
                if (timeline.year == null)
                {
                    model.Image = timeline.image;
                }
                else
                {
                    Info info = new Info();
                    info.Year        = timeline.year;
                    info.Description = timeline.description;
                    model.Info.Add(info);
                }
            }

            return(Json(model));
        }
コード例 #16
0
        private static void FillDeletedMessageInfo(TimelineModel timelineMessage, StickMan_Users_AudioData_UploadInformation message)
        {
            timelineMessage.Emoji = message.ReadStatus ? Emoji.Grimacing : Emoji.SmilingImp;

            timelineMessage.Arrow  = MessageArrow.None;
            timelineMessage.Status = MessageStatus.Deleted;
        }
コード例 #17
0
        static void Main(string[] args)
        {
            model  = new TimelineModel();
            window = new RenderWindow(new VideoMode(model.WindowWidth, model.WindowHeight), model.WindowTitle);

            model.OffsetX = window.Size.X / 2;

            int c = 0;

            //ADD TEST EVENT
            model.AddEvent(new TimelineEvent("Test event", 2));
            model.AddEvent(new TimelineEvent("Test event 2", -5));
            model.AddEvent(new TimelineEvent("Test event 3", 6.75f));


            while (window.IsOpen)
            {
                window.DispatchEvents();

                window.Closed      += new EventHandler(OnClose);
                window.KeyPressed  += new EventHandler <KeyEventArgs>(myKeyHandler);
                window.KeyReleased += new EventHandler <KeyEventArgs>(myKeyReleasedHandler);
                window.Resized     += new EventHandler <SizeEventArgs>(myResizeHandler);

                window.Clear(Color.White);

                //PAN SCREEN
                if (KeyPressed_W)
                {
                    model.OffsetY += model.PanSpeed;
                }
                if (KeyPressed_A)
                {
                    model.OffsetX += model.PanSpeed;
                }
                if (KeyPressed_S)
                {
                    model.OffsetY -= model.PanSpeed;
                }
                if (KeyPressed_D)
                {
                    model.OffsetX -= model.PanSpeed;
                }

                //DRAW LINE
                model.DrawLine(window);

                //DRAW MARKERS
                model.DrawMarkers(window);

                //DRAW EVENTS
                model.DrawEvents(window);

                model.DrawNumber(c++, "Refreshes: ", window);


                window.Display();
            }
        }
コード例 #18
0
        public TimelineManagerView()
        {
            this.InitializeComponent();
            this.SetLocale(Settings.Default.UILocale);
            this.LoadConfigViewResources();

            if (!WPFHelper.IsDesignMode)
            {
                if (this.TimelineConfig.Enabled)
                {
                    WPFHelper.BeginInvoke(async() =>
                    {
                        try
                        {
                            await Task.Run(() => TimelineManager.Instance.LoadTimelineModels());
                        }
                        catch (Exception ex)
                        {
                            TimelineModel.ShowRazorDumpFile();

                            ModernMessageBox.ShowDialog(
                                ex.Message,
                                "Timeline Loader",
                                MessageBoxButton.OK,
                                ex.InnerException);
                        }
                    });
                }
            }

            this.StyleListView.SelectionChanged += (x, y) =>
            {
                if (this.TimelineConfig.DesignMode)
                {
                    var selectedStyle = this.StyleListView.SelectedItem as TimelineStyle;

                    TimelineOverlay.HideDesignOverlay(false);
                    TimelineOverlay.ShowDesignOverlay(selectedStyle);

                    TimelineNoticeOverlay.HideDesignOverlay();
                    TimelineNoticeOverlay.ShowDesignOverlay(selectedStyle);
                }
            };

            this.timer.Tick += (x, y) =>
            {
                if (TimelineController.CurrentController != null)
                {
                    // ついでにスタートボタンのラベルを切り替える
                    this.StartButtonLabel = TimelineController.CurrentController.IsRunning ?
                                            StopString :
                                            StartString;
                }
            };

            this.timer.Start();
        }
コード例 #19
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="timelineModel">TimelineModel</param>
        /// <param name="tab">タブ</param>
        public SearchTimelineTabProperties(TimelineModel timelineModel, SearchTimelineTab tab)
        {
            this.TimelineModel = timelineModel;
            this.Tab           = tab;

            this.TopCommand       = new RelayCommand(this.Top);
            this.LatestCommand    = new RelayCommand(this.Latest);
            this.StreamingCommand = new RelayCommand(this.Streaming);
        }
コード例 #20
0
 void TimelineChart_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (e.NewValue is TimelineModel)
     {
         this.Model = e.NewValue as TimelineModel;
         this.Model.PropertyChanged += Model_PropertyChanged;
         this.Model.AddData         += this.Populate;
     }
 }
コード例 #21
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="timelineModel">遷移元のTimelineModel</param>
        /// <param name="id">ツイートID</param>
        public ShowStatusViewModel(TimelineModel timelineModel, long id)
        {
            this.ShowStatus = new ShowStatusModel(timelineModel, id);

            this.Statuses = this.ShowStatus.Statuses;

            this.ReadMoreRepliesCommand             = new RelayCommand <long?>(this.ReadMoreReplies);
            this.ReadMoreRepliesToMainStatusCommand = new RelayCommand <SearchRepliesProperties>(this.ReadMoreRepliesToMainStatus);
        }
コード例 #22
0
        private void FillUser(TimelineModel timelineMessage, StickMan_Users_AudioData_UploadInformation message, int userId)
        {
            var id = message.UserID == userId ? message.RecieverID : message.UserID;

            var user = _unitOfWork.Repository <StickMan_Users>().GetSingle(x => x.UserID == id);

            timelineMessage.UserName = user.UserName;
            timelineMessage.UserId   = id;
        }
コード例 #23
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="timelineModel">TimelineModel</param>
        /// <param name="tab">タブ</param>
        public UserTimelineTabProperties(TimelineModel timelineModel, UserTimelineTab tab = UserTimelineTab.Tweets)
        {
            this.TimelineModel = timelineModel;
            this._Tab          = tab;

            this.TweetsTabButtonCommand           = new RelayCommand(this.TweetsTabButton);
            this.TweetsAndRepliesTabButtonCommand = new RelayCommand(this.TweetsAndRepliesTabButton);
            this.MediaTabButtonCommand            = new RelayCommand(this.MediaTabButton);
            this.FavoritesTabButtonCommand        = new RelayCommand(this.FavoritesTabButton);
        }
コード例 #24
0
        public ActionResult Details()
        {
            var sessionSubmission = calendarItemRepository.GetFromType(CalendarEntryType.SessionSubmission);
            var voting            = calendarItemRepository.GetFromType(CalendarEntryType.Voting);
            var agendaPublished   = calendarItemRepository.GetFromType(CalendarEntryType.AgendaPublished);
            var registraion       = calendarItemRepository.GetFromType(CalendarEntryType.Registration);

            var sessionSubmissionOpens = new TimelineItemModel
            {
                PeriodDate   = dateTimeFormatter.FormatStartDate(sessionSubmission.StartDate),
                PeriodPassed = dateTimePassedEvaluator.HasDatePassed(sessionSubmission.EndDate.Value)
            };

            var sessionSubmissionCloses = new TimelineItemModel
            {
                PeriodDate   = dateTimeFormatter.FormatEndDate(sessionSubmission.EndDate),
                PeriodPassed = dateTimePassedEvaluator.HasDatePassed(sessionSubmission.EndDate.Value)
            };

            var votingOpens = new TimelineItemModel
            {
                PeriodDate   = dateTimeFormatter.FormatStartDate(voting.StartDate),
                PeriodPassed = dateTimePassedEvaluator.HasDatePassed(voting.EndDate.Value)
            };

            var votingCloses = new TimelineItemModel
            {
                PeriodDate   = dateTimeFormatter.FormatEndDate(voting.EndDate),
                PeriodPassed = dateTimePassedEvaluator.HasDatePassed(voting.EndDate.Value)
            };

            var agendaAnnounced = new TimelineItemModel
            {
                PeriodDate   = dateTimeFormatter.FormatStartDate(agendaPublished.StartDate),
                PeriodPassed = dateTimePassedEvaluator.HasDatePassed(registraion.StartDate)
            };

            var registrationOpens = new TimelineItemModel
            {
                PeriodDate   = dateTimeFormatter.FormatStartDate(registraion.StartDate),
                PeriodPassed = dateTimePassedEvaluator.HasDatePassed(registraion.EndDate.Value)
            };

            var model = new TimelineModel
            {
                SessionSubmissionOpens  = sessionSubmissionOpens,
                SessionSubmissionCloses = sessionSubmissionCloses,
                VotingOpens             = votingOpens,
                VotingCloses            = votingCloses,
                AgendaAnnounced         = agendaAnnounced,
                RegistrationOpens       = registrationOpens
            };

            return(PartialView("_Timeline", model));
        }
コード例 #25
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="timelineModel">TimelineModel</param>
        /// <param name="type">ロードタイプ</param>
        /// <param name="parameter">パラメーター</param>
        public LoadingProperties(TimelineModel timelineModel, LoadingType type, object parameter = null)
        {
            this.TimelineModel = timelineModel;
            this.Type          = type;
            if (parameter != null)
            {
                this.Parameter = parameter;
            }

            this.LoadCommand = new RelayCommand <object>(this.Load);
        }
コード例 #26
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="timelineModel">TimelineModel</param>
 /// <param name="id">ツイートID</param>
 public ReplyToStatusProperties(TimelineModel timelineModel, long id)
 {
     this.IsExist           = true;
     this._Visibility       = Visibility.Visible;
     this._TextVisibility   = Visibility.Collapsed;
     this.ToggleOpenCommand = new RelayCommand(this.ToggleOpen);
     this.SelectCommand     = new RelayCommand(this.Select);
     this.SelectIconCommand = new RelayCommand(this.SelectIcon);
     this.TimelineModel     = timelineModel;
     this.Initialize(id);
 }
コード例 #27
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="timelineModel">TimelineModel</param>
        /// <param name="id">ツイートのID</param>
        public ShowStatusModel(TimelineModel timelineModel, long id)
        {
            this.TimelineModel = timelineModel;
            this.Id            = id;

            this.Statuses = new ObservableCollection <TimelineItemProperties>();
            BindingOperations.EnableCollectionSynchronization(this.Statuses, new object());
            this.IsLoadingReplies             = false;
            this.IsLoadingRepliesToMainStatus = false;

            this.SetStatus();
        }
コード例 #28
0
        public IHttpActionResult GetComprehensive(string id, int days, int maxCount)
        {
            // Get all memes posted or reposted by the user with any activity by ANY user in the last X days
            List <ITimeLine> activityOnUserPostedMemes = repository.GetUserMemeTimeLine(id, 30000).OrderByDescending(x => x.DateOfEntry).ToList();

            TimelineGroupModel timelineGroupModel = new TimelineGroupModel
            {
                User           = repository.GetUser(id, true),
                TimelineGroups = new List <TimelineGroup>()
            };

            foreach (ITimeLine activityOnUserPostedMeme in activityOnUserPostedMemes)
            {
                AddActivitytoTimeLineGroups(ref timelineGroupModel, activityOnUserPostedMeme, maxCount);
            }

            TimelineModel model = new TimelineModel
            {
                User            = repository.GetUser(id, true),
                TimelineEntries = new List <TimelineEntryModel>()
            };

            // Get the activity of the user and all his/her followers (grouped by meme)
            List <string> userIds = new List <string> {
                id
            };

            userIds.AddRange(model.User.FollowingIds.Select(x => x.Id));

            foreach (string userId in userIds)
            {
                // Get the activity of the user for the last x number of days
                List <ITimeLine> activity = repository.GetUserTimeLine(userId, days).OrderByDescending(x => x.DateOfEntry).ToList();
                foreach (ITimeLine entry in activity)
                {
                    AddActivitytoTimeLineGroups(ref timelineGroupModel, entry, maxCount);
                }
            }

            // Ensure the timeline entries in each group are ordered descending by date of entry
            timelineGroupModel.TimelineGroups.ForEach(x =>
            {
                x.TimelineEntries = x.TimelineEntries.OrderByDescending(y => y.DateOfEntry).ToList();
            });

            // Order by date descending
            timelineGroupModel.TimelineGroups = timelineGroupModel.TimelineGroups.OrderByDescending(x => x.TimeStamp).ToList();

            return(Ok(timelineGroupModel));
        }
コード例 #29
0
        public ActionResult Timeline(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            StatisticManager manager = new StatisticManager();
            TimelineModel    model   = new TimelineModel();

            model.Data = manager.LoadTimeline(data);

            return(View("~/Views/Statistic/Timeline.cshtml", model));
        }
コード例 #30
0
        public void AddCommentInsertsLast()
        {
            var model = new TimelineModel();

            model.Duration = TimeCode.FromAbsoluteTime(30, SmpteFrameRate.Smpte30);
            model.AddComment(new Comment {
                Text = "First", MarkIn = 0
            });
            model.AddComment(new Comment {
                Text = "Second", MarkIn = 1
            });

            Assert.AreEqual("First", model.CommentElements[0].Text);
            Assert.AreEqual("Second", model.CommentElements[1].Text);
        }
コード例 #31
0
        private static void FillExistingMessageInfo(int userId, TimelineModel timelineMessage, StickMan_Users_AudioData_UploadInformation message)
        {
            timelineMessage.Emoji = message.ReadStatus ? Emoji.Grimacing : Emoji.Smile;

            if (message.UserID == userId)
            {
                timelineMessage.Arrow  = MessageArrow.Right;
                timelineMessage.Status = MessageStatus.Sent;
            }

            if (message.RecieverID == userId)
            {
                timelineMessage.Arrow  = MessageArrow.Left;
                timelineMessage.Status = MessageStatus.Received;
            }
        }