public LayerPropertiesViewModel(IProfileEditorService profileEditorService, ICoreService coreService, ISettingsService settingsService, ILayerPropertyVmFactory layerPropertyVmFactory, DataBindingsViewModel dataBindingsViewModel) { _layerPropertyVmFactory = layerPropertyVmFactory; ProfileEditorService = profileEditorService; CoreService = coreService; SettingsService = settingsService; PropertyChanged += HandlePropertyTreeIndexChanged; // Left side TreeViewModel = _layerPropertyVmFactory.TreeViewModel(this, Items); TreeViewModel.ConductWith(this); EffectsViewModel = _layerPropertyVmFactory.EffectsViewModel(this); EffectsViewModel.ConductWith(this); // Right side StartTimelineSegmentViewModel = _layerPropertyVmFactory.TimelineSegmentViewModel(SegmentViewModelType.Start, Items); StartTimelineSegmentViewModel.ConductWith(this); MainTimelineSegmentViewModel = _layerPropertyVmFactory.TimelineSegmentViewModel(SegmentViewModelType.Main, Items); MainTimelineSegmentViewModel.ConductWith(this); EndTimelineSegmentViewModel = _layerPropertyVmFactory.TimelineSegmentViewModel(SegmentViewModelType.End, Items); EndTimelineSegmentViewModel.ConductWith(this); TimelineViewModel = _layerPropertyVmFactory.TimelineViewModel(this, Items); TimelineViewModel.ConductWith(this); DataBindingsViewModel = dataBindingsViewModel; DataBindingsViewModel.ConductWith(this); }
private void ReloadPage() { TimelineViewModel bind; if (SelectedDate == DateTime.MinValue) { bind = new TimelineViewModel(NumberOfItems, DateTime.Now); } else { bind = new TimelineViewModel(NumberOfItems, SelectedDate); } BindingContext = bind; //проверяется студент или преподаватель if (App.Current.Properties.TryGetValue("isTeacher", out object isTeacher)) { if ((bool)isTeacher) { couplesList.ItemsSource = bind.ItemsForTeacher; } else { couplesList.ItemsSource = bind.ItemsForStudents; } } }
public async Task <IActionResult> Index() { if (User.Identity.IsAuthenticated) { var model = new TimelineViewModel(); var userId = this.userManager.GetUserId(this.HttpContext.User); var tweets = await this.userService.GetTimeline(userId); var timelineTweets = this.mappingProvider.ProjectTo <TweetApiDto, TweetViewModel>(tweets).ToList(); var downladedTweets = await this.userService.GetAllDownloadTweetsByUser(userId); foreach (var tweet in downladedTweets) { for (int i = 0; i < timelineTweets.Count(); i++) { if (tweet.Id == timelineTweets[i].Id) { timelineTweets[i].IsDownloaded = true; } } } model.Tweets = timelineTweets; return(this.View(model)); } return(RedirectToAction("LandingPage")); }
public async Task <IActionResult> Index(TwitterAccountViewModel model) { var timelineViewModel = new TimelineViewModel(); var userTimeline = await twitterService.GetUsersTimeline(model.Id); Guard.WhenArgument(userTimeline, "User Timeline").IsNull().Throw(); var twitterAccountTimeline = this.mappingProvider.ProjectTo <TweetApiDto, TweetViewModel>(userTimeline).ToList(); var userId = this.userManager.GetUserId(this.HttpContext.User); var downloadedTweets = await this.userService.GetAllDownloadTweetsByUser(userId); foreach (var tweet in downloadedTweets) { for (int i = 0; i < twitterAccountTimeline.Count(); i++) { if (tweet.Id == twitterAccountTimeline[i].Id) { twitterAccountTimeline[i].IsDownloaded = true; } } } timelineViewModel.Tweets = twitterAccountTimeline; timelineViewModel.TwiitterAccountInfo = model; return(View(timelineViewModel)); }
/// <summary> /// Gets a the timeline for a patient /// </summary> public async Task <ActionResult> Index(Guid personId, Guid recordId, DateTime?startDate, DateTime?endDate) { if (startDate == null) { return(View()); } var timeline = await GetTimeline(personId, recordId, startDate.Value, endDate); var timelineEntries = new List <TimelineEntryViewModel>(); foreach (var task in timeline.Tasks) { timelineEntries.AddRange(ConvertToTimelineEntryViewModels(task)); } var groupedTimelineEntries = timelineEntries.OrderBy(t => t.LocalDateTime).ThenByDescending(t => t.ScheduleType).GroupBy(st => st.LocalDateTime.Date); var model = new TimelineViewModel { StartDate = startDate, EndDate = endDate, TimelineEntries = groupedTimelineEntries }; return(View(model)); }
// GET: api/values public async void insertTimeline([FromBody] TimelineViewModel timeline) { var database = DBHelper.ConnectMongoAWS(); var collection = database.GetCollection <TimelineViewModel>("newTimeline"); TimelineViewModel time = timeline; try { time._id = ObjectId.GenerateNewId(); time.createdOn = DateTime.Now; time.modifiedOn = DateTime.Now; time.doRetell = false; foreach (MomentViewModel item in time.momentList) { item._id = ObjectId.GenerateNewId(); item.createdOn = DateTime.Now; item.modifiedOn = DateTime.Now; } await collection.InsertOneAsync(time); } catch (Exception ex) { } }
public async Task <List <DynamicHyperTagViewModel> > Timeline_Children( string missionInstanceId, string workflowInstanceId, string parentId) { var timeline = new TimelineViewModel(); var filter = new TagPageFilterModel() { ServerUri = ServerUri, //RealmId = realmId, MissionInstanceId = missionInstanceId, WorkflowInstanceId = workflowInstanceId, Children = true, GroupAndOrganize = true, ParentId = parentId }; var utility = new TimelineUtility(_netStore); var tags = await utility.GetTag(filter); tags = tags.OrderByDescending(it => it.RealWorldContentTimeUTC).ToList(); return(tags); }
public Statistics_Timeline() { InitializeComponent(); _vm = new TimelineViewModel(); this.DataContext = _vm; }
public static TimelineView Create(TimelineViewModel viewModel) { TimelineView view = Nib.Instantiate(null, null)[0] as TimelineView; view.SetViewModel(viewModel); return(view); }
public IActionResult Timeline() { var groups = context.Events.Where(x => x.User.Id == GetCurrentUserId()) .GroupBy(x => x.Date); var days = new List <DayTimeline>(); foreach (IGrouping <DateTime, Event> group in groups) { var eventTitles = new List <string>(); foreach (Event e in group) { eventTitles.Add(e.Title); } string monthName = calendarService.GetMonthName(group.Key).Substring(0, 3); days.Add(new DayTimeline { Date = group.Key, EventTitles = eventTitles, MonthNameShort = monthName }); } //days.OrderBy(x => x.Date); var model = new TimelineViewModel { Days = days }; return(View(model)); }
public void LoadTimeline(TimelineViewModel timelineViewModel = null) { // If no viewmodel is given, create a new viewmodel if (timelineViewModel == null) { timelineViewModel = new TimelineViewModel(); timelineViewModel.SetViewModel(new TimelineModel() { Title = "New Timeline", ThemeID = 3 }); } if (this.model != null) { this.model = null; } this.model = timelineViewModel; // Set the XAML DataContext this.DataContext = model; // Create the Window this.CreateRenderWindow(); // Set the Zoom this.ResetZoom(); }
public ActionResult Create(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Referee referee = refereeService.GetById((int)id); if (referee == null) { return(HttpNotFound()); } var timelineItem = new Timeline() { RefereeId = (int)id }; TimelineViewModel _timelineViewModel = new TimelineViewModel() { TimelineItem = timelineItem, CategoryList = GetCategoryList(referee.TournamentId), LevelList = GetLevelList() }; return(View(_timelineViewModel)); }
public IActionResult Timeline(string metric, string option) { TimelineViewModel model = _covidService.GetTimeline(metric, option); ViewData["Metric"] = metric; ViewData["Method"] = System.Reflection.MethodBase.GetCurrentMethod().Name; return(View(model)); }
//Выбор определенной даты private void DatePicker_DateSelected(object sender, DateChangedEventArgs e) { DateTime now = DateTime.Now; if (now.Month < 9) { if (e.NewDate.Year == now.Year && e.NewDate.Month < 9) { TimelineViewModel bind = new TimelineViewModel(NumberOfItems, e.NewDate); BindingContext = bind; //проверяется студент или преподаватель if (App.Current.Properties.TryGetValue("isTeacher", out object isTeacher)) { if ((bool)isTeacher) { couplesList.ItemsSource = bind.ItemsForTeacher; } else { couplesList.ItemsSource = bind.ItemsForStudents; } } } else { DisplayAlert("Ошибка", "Можно просматривать только текущий учебный год.", "ОK"); } } else { if ((e.NewDate.Year == now.Year && e.NewDate.Month >= 9) || (e.NewDate.Year == now.Year + 1 && e.NewDate.Month < 9)) { TimelineViewModel bind = new TimelineViewModel(NumberOfItems, e.NewDate); BindingContext = bind; //проверяется студент или преподаватель if (App.Current.Properties.TryGetValue("isTeacher", out object isTeacher)) { if ((bool)isTeacher) { couplesList.ItemsSource = bind.ItemsForTeacher; } else { couplesList.ItemsSource = bind.ItemsForStudents; } } } else { DisplayAlert("Ошибка", "Можно просматривать только текущий учебный год.", "ОK"); } } SelectedDate = e.NewDate; }
private void SetViewModel(TimelineViewModel viewModel) { this.viewModel = viewModel; var source = new TimelineSource(this, this.tableTimeline); source.CellCaption = "加载中..."; source.ItemsSource = this.viewModel.TimelineItems; source.OnGetMore += Source_OnGetMore; this.tableTimeline.Source = source; }
public ActionResult Create([Bind(Include = "TimelineItem")] TimelineViewModel _timelineViewModel) { if (ModelState.IsValid) { timelineService.Create(_timelineViewModel.TimelineItem); return(RedirectToAction("Details", "Referees", new { id = _timelineViewModel.TimelineItem.RefereeId, active = "Timeline" })); } _timelineViewModel.CategoryList = GetCategoryList(_timelineViewModel.TimelineItem.Referee.TournamentId); _timelineViewModel.LevelList = GetLevelList(); return(View(_timelineViewModel)); }
public TimelineViewModel CreateTimeline() { var sRepo = new SchoolsRepository(_context); var timeline = new TimelineViewModel() { TimelineId = Guid.NewGuid().ToString(), Schools = sRepo.GetSchools() }; return(timeline); }
// GET: Timelines/Edit/<ID> public ActionResult Edit(string id) { var timeline = _repo.GetTimelineWithEvents(id); var vm = new TimelineViewModel { Title = timeline.Title, Id = timeline.Id }; return(PartialView(vm)); }
private void GroupCleanAsync( TimelineViewModel timeline, bool group, CancellationToken cancellationToken = default(CancellationToken)) { if (timeline == null) { throw new ArgumentException(nameof(timeline)); } timeline.Tags = GroupTagsByTime(timeline); timeline.Tags = timeline.Tags.Where(it => it.WallClockTime != null).Select(it => it).ToList(); timeline.Tags.Sort((x, y) => x.WallClockTime.CompareTo(y.WallClockTime)); timeline.TagAssetIds = timeline.Tags .Where(it => !string.IsNullOrWhiteSpace(it.AssetGuid)) .Select(it => it.AssetGuid).Distinct().ToList(); if (group) { foreach (var tag in timeline.Tags) { //NOTE clean children when tags come from cache tag.Children = new List <DynamicHyperTagViewModel>(); } timeline.Groups = TagGroupHelper.GetTagsByAssetGroups(timeline.Tags, "group"); TagGroupHelper.OrganizeParentChildTags(timeline.Groups); timeline.Json = TagGroupHelper.ExportingToJsonString(timeline.Groups); } if (string.IsNullOrWhiteSpace(timeline.Json)) { timeline.Json = ""; var index = 0; foreach (var tag in timeline.Tags) { if (index == 0) { timeline.Json += tag.ToSimpleJSON(""); } else { timeline.Json += "," + tag.ToSimpleJSON(""); } index++; } timeline.Json = "[" + timeline.Json + "]"; } }
public TimelineView() { _timeLineViewModel = App.Locator.TimelineViewModel; InitializeComponent(); BindingContext = _timeLineViewModel; StackContainer.Children.Add(new CollapsableControl() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Fill, Title = "1. Project", Views = ProjectList, }); }
public void OpenFile() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"; if (openFileDialog.ShowDialog() == true) { string json = File.ReadAllText(openFileDialog.FileName); TimelineViewModel timelineViewModel = new TimelineViewModel(); timelineViewModel.SetViewModel(JsonConvert.DeserializeObject <TimelineModel>(json)); this.LoadTimeline(timelineViewModel); } }
public ActionResult Timeline(int start = 0) { var lastUsers = this.retwis.GetLastUsers(); var posts = this.retwis.Timeline(start, 50).ToList(); var model = new TimelineViewModel { LastUsers = lastUsers, Posts = posts, Prev = start - 50, Next = posts.Count() >= 50 ? start + 50 : 0 }; return(View(model)); }
public ActionResult TimelineAjax(Guid id) { var user = _userService.FindById(id); if (user == null) { return(HttpNotFound()); } var watcherUserId = this.CurrentUserSessionContext().UserId; TimelineViewModel timelineViewModel = _messagesViewModelService.CreateProfileTimelineViewModel(user.Id, watcherUserId); return(PartialView("_UserMessageTimelinePartial", timelineViewModel)); }
public TimelineWindow() { InitializeComponent(); Loaded += (s, e) => { if (_Model != null) { return; } _Model = new TimelineViewModel(); DataContext = _Model; _Model.DownloadGeneratedEvents(); }; }
public async Task <ActionResult> Edit(string id, [Bind("Title")] TimelineViewModel vm) { if (ModelState.IsValid) { Timeline timeline = _repo.GetTimelineWithEvents(id); timeline.Title = vm.Title; await _repo.UpdateTimelineAsync(timeline); _flash.Message("Timeline has been edited!"); return(Ok("OK " + id)); } return(PartialView(vm)); }
public async Task <IActionResult> Put(string id, [FromBody] TimelineViewModel value) { var timeline = _repo.GetTimelineWithEvents(id); timeline.Title = value.Title; await _repo.UpdateTimelineAsync(timeline); return(Ok(new TimelineViewModel { Id = timeline.Id, Title = timeline.Title, CreationTimeStamp = timeline.CreationTimeStamp, IsDeleted = timeline.IsDeleted })); }
private void UserControl_Loaded_1(object sender, RoutedEventArgs e) { if (_timelineViewModel == null) { _timelineViewModel = new TimelineViewModel(this) { TimeSpanSelect = _timespanEnum, StartDateTime = _startDateTime, DataSource = _dataSource, DataCellWidth = _dataCellWidth, EventModelManager = _eventModelManager, }; } _timelineViewModel.Initialize(); }
public async Task <ActionResult> Create([Bind("Title")] TimelineViewModel vm) { if (ModelState.IsValid) { var timeline = await _repo.CreateTimelineAsync(vm.Title); _flash.Message("Timeline created!"); // On success we return OK followed by the ID of the timeline just created. return(Ok("OK " + timeline.Id)); } // Error - return view with validation errors showing. return(PartialView(vm)); }
public TimelinePage() { InitializeComponent(); BindingContext = new TimelineViewModel(); if (Device.OS == TargetPlatform.Windows) { var toolbarItem = new ToolbarItem { Icon = "refresh.png", Command = ViewModel.RefreshCommand }; ToolbarItems.Add(toolbarItem); } }
public async Task <IActionResult> Index() { var model = new TimelineViewModel(); var userId = this.userManager.GetUserId(HttpContext.User); var tweets = await this.userService.GetAllDownloadTweetsByUser(userId); var downloadedTweets = this.mappingProvider.ProjectTo <TweetApiDto, TweetViewModel>(tweets).ToList(); for (int i = 0; i < downloadedTweets.Count(); i++) { downloadedTweets[i].CanBeDeleted = true; } model.Tweets = downloadedTweets; return(View(model)); }
public MainViewModel() { Timeline = new TimelineViewModel(); if (Application.Current.Properties.Contains("ArbitraryArgName")) { Timeline.LoadFile(((Uri)Application.Current.Properties["ArbitraryArgName"]).AbsolutePath); } MediaPlayer = new MediaPlayerViewModel(Timeline); ExitCommand = new DelegateCommand(o => Application.Current.Shutdown()); ImportCommand = new DelegateCommand(o => { IModalService service = GetService<IModalService>(); TimelineModel model = service.OpenImporter(); if (model != null) { Timeline.Import(model); } }); }
public MediaPlayerViewModel(TimelineViewModel parent) { _timer = new Timer(25); _timer.Elapsed += UpdateCurrentTime; _parent = parent; _parent.PropertyChanged += delegate(object sender, PropertyChangedEventArgs args) { switch (args.PropertyName) { case "CurrentTime": case "MaxTime": case "MediaSource": OnPropertyChanged(args.PropertyName); break; } }; PlayPauseCommand = new DelegateCommand(PlayPause); StopCommand = new DelegateCommand(Stop); LoadCommand = new DelegateCommand(Load); }
private void SelectTimeline_Click(object sender, RoutedEventArgs e) { CurrentTimeline = ((Button)sender).DataContext as TimelineViewModel; twitterPanel1.DataContext = CurrentTimeline; }
private void SetTimelines() { var settings = IsolatedStorageSettings.ApplicationSettings; var oauth_token = settings["oauth_token"].ToString(); var oauth_token_secret = settings["oauth_token_secret"].ToString(); OAuthHelper helper = new OAuthHelper(); //helper.ConsumerKey = CONSUMER_KEY; //helper.ConsumerSecret = CONSUMER_SECRET; //helper.Token = oauth_token; //helper.TokenSecret = oauth_token_secret; var defaulttimeline = new MainTimelineViewModel(helper); AddTimeline(defaulttimeline); helper = new OAuthHelper(); //helper.ConsumerKey = CONSUMER_KEY; //helper.ConsumerSecret = CONSUMER_SECRET; //helper.Token = oauth_token; //helper.TokenSecret = oauth_token_secret; //AddTimeline(new UserTimelineViewModel("jimlynn",helper)); timelines.ItemsSource = timelineList; twitterPanel1.DataContext = defaulttimeline; CurrentTimeline = defaulttimeline; maketweet.OAuthHelper = new OAuthHelper(); foreach (var tl in timelineList) { tl.MakeTweet += new EventHandler<MakeTweetEventArgs>(tl_MakeTweet); } }
private void AddTimeline(TimelineViewModel vm) { timelineList.Add(vm); vm.StatusChanged += new EventHandler<StatusChangedEventArgs>(vm_StatusChanged); }
public FilterScriptTemplateServiceViewModel(TimelineViewModel tl) { _model = FilterScriptTemplateService.Instance; _tl = tl; }
public MainViewModel() { TimelineModel = new TimelineViewModel(); ExitCommand = new ExitCommand(this); }
public HeaderFactory(int start, int end, TimelineViewModel.ViewLevel level) { children = new VisualCollection(this); MyVisual = new DrawingVisual(); children.Add(MyVisual); var currentTime = new TimeSpan(0, 0, 0, 0, start); const int everyXLine100 = 10; double currentX = 0; var currentLine = start/5; double distanceBetweenLines = 5; TimeSpan timeStep = new TimeSpan(0, 0, 0, 0, (int)level); int majorEveryXLine = 100; var grayBrush = new SolidColorBrush(Color.FromRgb(192, 192, 192)); grayBrush.Freeze(); var grayPen = new Pen(grayBrush, 2); var whitePen = new Pen(Brushes.White, 2); grayPen.Freeze(); whitePen.Freeze(); using (var dc = MyVisual.RenderOpen()) { while (currentX < (end - start)) { if (((currentLine % majorEveryXLine) == 0) && currentLine != 0) { dc.DrawLine(whitePen, new Point(currentX, 30), new Point(currentX, 15)); FormattedText text = null; double tempX = currentX; switch (level) { case TimelineViewModel.ViewLevel.Level1: text = new FormattedText( currentTime.ToString(@"hh\:mm\:ss\.fff"), CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Tahoma"), 8, grayBrush); break; case TimelineViewModel.ViewLevel.Level2: case TimelineViewModel.ViewLevel.Level3: case TimelineViewModel.ViewLevel.Level4: case TimelineViewModel.ViewLevel.Level5: text = new FormattedText( currentTime.ToString(@"hh\:mm\:ss\.f"), CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Tahoma"), 8, grayBrush); tempX = tempX + 4; break; } dc.DrawText(text, new Point((tempX - 22), 0)); } else if ((((currentLine % everyXLine100) == 0) && currentLine != 0) && (currentLine % majorEveryXLine) != 0) { dc.DrawLine(grayPen, new Point(currentX, 30), new Point(currentX, 20)); FormattedText text = null; switch (level) { case TimelineViewModel.ViewLevel.Level1: text = new FormattedText( string.Format(".{0}", currentTime.Milliseconds), CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Tahoma"), 8, grayBrush); break; case TimelineViewModel.ViewLevel.Level2: case TimelineViewModel.ViewLevel.Level3: case TimelineViewModel.ViewLevel.Level4: case TimelineViewModel.ViewLevel.Level5: text = new FormattedText( string.Format("{0}", currentTime.ToString(@"ss\.f")), CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Tahoma"), 8, grayBrush); break; } dc.DrawText(text, new Point((currentX - 8), 8)); } else { dc.DrawLine(grayPen, new Point(currentX, 30), new Point(currentX, 25)); } currentX += distanceBetweenLines; currentLine++; currentTime += timeStep; } } }
public FilterScriptTemplateViewModel(FilterScriptTemplate model, TimelineViewModel tl) { _model = model; _tl = tl; }