Example #1
0
        public TimeLineControl()
        {
            InitializeComponent();

            viewModel   = new TimeLineViewModel();
            DataContext = viewModel;

            #region 注册依赖属性
            this.SetBinding(
                DependencyProperty.RegisterAttached("VerticalOffset",
                                                    typeof(double),
                                                    this.GetType(),
                                                    new PropertyMetadata((d, e) =>
            {
                if (verticalScrollChanged != null)
                {
                    verticalScrollChanged(this, EventArgs.Empty);
                }
            })
                                                    ),
                new Binding("VerticalOffset")
            {
                Source = this.sv_Main
            });
            #endregion

            Loaded += TimeLineControl_Loaded;
        }
Example #2
0
        private TimeLineViewModel BuildTimeLineViewModel(IssueTimeLine timeline)
        {
            var model = new TimeLineViewModel
            {
                TimelineType = timeline.TimelineType,
                HTMLContent  = timeline.HTMLContent,
            };

            var title = "";

            if (model.TimelineType == TimeLineType.Past)
            {
                title = "What has happened?";
            }
            if (model.TimelineType == TimeLineType.Present)
            {
                title = "What's happening now?";
            }
            if (model.TimelineType == TimeLineType.Future)
            {
                title = "What's about to happen?";
            }

            model.Title = title;

            return(model);
        }
        public async Task <IActionResult> PersonalNewsFeedByUser(string userName, int id = 1)
        {
            var loggedUser = await this.userManager.GetUserAsync(this.User);

            var user = await this.userManager.FindByNameAsync(userName);

            var model = new TimeLineViewModel
            {
                PostsPerPage = PostPerPage,
                PageNumber   = id,
                UserName     = user.UserName,
                AllPosts     = this.newsFeedService.GetAllSocialPostsByUser <TimeLineAllPostsViewModel>(user.Id, id, PostPerPage),
                PostsCount   = this.newsFeedService.GetPostsCountByUser(user.Id),
                NewsComments = await this.newsFeedService.GetAllCommentsAsync(),
                IsFried      = await this.friendService.AreTwoUsersFriendsAsync(loggedUser.Id, user.Id),
            };

            model.FirstName         = user.FirstName;
            model.LastName          = user.LastName;
            model.Description       = user.Description;
            model.Town              = user.Town;
            model.BirthDay          = user.BirthDay.ToString("d", CultureInfo.InvariantCulture);
            model.ProfilePictureUrl = await this.newsFeedService.LastProfilePictureAsync(user.Id);

            model.CoverPictureUrl = await this.newsFeedService.LastCoverPictureAsync(user.Id);

            return(this.View(model));
        }
        public IActionResult TimeLine()
        {
            TimeLineViewModel timeLineView = new TimeLineViewModel();

            timeLineView.Posts = _postLogic.GetPosts(_friendLogic.GetFriendIds(Convert.ToInt16(CookieClaims.GetCookieID(User))));
            return(View(timeLineView));
        }
Example #5
0
 public PlayTimeLineMessage(TimeLineViewModel playerOneTimeLineViewModels,
                            TimeLineViewModel playerTwoTimeItemViewModels,
                            int repeatAmount)
 {
     PlayerOneTimeLineItemViewModels = playerOneTimeLineViewModels;
     PlayerTwoTimeLineItemViewModels = playerTwoTimeItemViewModels;
     RepeatAmount = repeatAmount;
 }
 public PlayTimeLineMessage(TimeLineViewModel playerOneTimeLineViewModels,
     TimeLineViewModel playerTwoTimeItemViewModels,
     int repeatAmount)
 {
     PlayerOneTimeLineItemViewModels = playerOneTimeLineViewModels;
     PlayerTwoTimeLineItemViewModels = playerTwoTimeItemViewModels;
     RepeatAmount = repeatAmount;
 }
Example #7
0
        private void TimeLine_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            TimeLineViewModel viewModel = DataContext as TimeLineViewModel;

            if (viewModel != null)
            {
                viewModel.LoadTweetsFromTimeLine();
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeLineItemViewModel"/> class.
        /// </summary>
        /// <param name="parent">The parent <see cref="TimeLineViewModel"/>.</param>
        public TimeLineItemViewModel(TimeLineViewModel parent)
        {
            _parent = parent;

            _inputItemViewModel = new InputItemViewModel();

            InputItemViewModel.PropertyChanged += InputItemViewModel_PropertyChanged;
            _inputItemViewModel.WaitFrames = 1;
        }
Example #9
0
 public TimeLine()
 {
     InitializeComponent();
     DataContextChanged += (s, e) =>
     {
         VM = DataContext as TimeLineViewModel;
     };
     current = this;
 }
Example #10
0
        public void Setup()
        {
            DispatcherHelper.Initialize();

            _mockAuthenticationService = new Mock <INGTweetAuthenticationService>().Object;

            _mockApplicationSettingsProvider = new Mock <IApplicationSettingsProvider>().Object;

            _viewModel = new TimeLineViewModel(_mockAuthenticationService, _mockApplicationSettingsProvider);
        }
Example #11
0
        public ActionResult Index()
        {
            var result = new TimeLineViewModel()
            {
                ID       = user.userid,
                ImageUrl = ConfigurationManager.AppSettings["ImageUrl"]
            };

            return(View(result));
        }
Example #12
0
        public async Task <IActionResult> Index(int childId = 0, int sortBy = 1, int items = 0)
        {
            _progId        = childId;
            ViewBag.SortBy = sortBy;
            string userEmail = HttpContext.User.FindFirst("email")?.Value ?? _defaultUser;

            UserInfo userinfo = await _progenyHttpClient.GetUserInfo(userEmail);

            if (childId == 0 && userinfo.ViewChild > 0)
            {
                _progId = userinfo.ViewChild;
            }
            if (_progId == 0)
            {
                _progId = Constants.DefaultChildId;
            }

            Progeny progeny = await _progenyHttpClient.GetProgeny(_progId);

            List <UserAccess> accessList = await _progenyHttpClient.GetProgenyAccessList(_progId);

            int userAccessLevel = (int)AccessLevel.Public;

            if (accessList.Count != 0)
            {
                UserAccess userAccess = accessList.SingleOrDefault(u => u.UserId.ToUpper() == userEmail.ToUpper());
                if (userAccess != null)
                {
                    userAccessLevel = userAccess.AccessLevel;
                }
            }

            if (progeny.IsInAdminList(userEmail))
            {
                userAccessLevel = (int)AccessLevel.Private;
            }

            TimeLineViewModel model = new TimeLineViewModel();

            model.TimeLineItems = new List <TimeLineItem>();
            model.TimeLineItems = await _progenyHttpClient.GetTimeline(_progId, userAccessLevel); // _context.TimeLineDb.AsNoTracking().Where(t => t.ProgenyId == _progId && t.AccessLevel >= userAccessLevel && t.ProgenyTime < DateTime.UtcNow).ToListAsync();

            if (sortBy == 1)
            {
                model.TimeLineItems = model.TimeLineItems.OrderByDescending(t => t.ProgenyTime).ToList();
            }
            else
            {
                model.TimeLineItems = model.TimeLineItems.OrderBy(t => t.ProgenyTime).ToList();
            }

            ViewBag.ProgenyName = progeny.NickName;
            ViewBag.Items       = items;
            return(View(model));
        }
Example #13
0
        public ViewModelLocator()
        {
            NGTweetAuthenticationServiceClient authenticationService = new NGTweetAuthenticationServiceClient();

            NGApplicationSettingsProvider settingsProvider = new NGApplicationSettingsProvider();

            mainViewModel = new MainViewModel(authenticationService, settingsProvider);

            timeLineViewModel = new TimeLineViewModel(authenticationService, settingsProvider);

            mentionsViewModel = new MentionsViewModel(authenticationService, settingsProvider);

            tweetActionViewModel = new TweetActionViewModel(authenticationService, settingsProvider);
        }
Example #14
0
        public ViewModelLocator()
        {
            NGTweetAuthenticationServiceClient authenticationService = new NGTweetAuthenticationServiceClient();

            NGApplicationSettingsProvider settingsProvider = new NGApplicationSettingsProvider();

            mainViewModel = new MainViewModel(authenticationService, settingsProvider);

            timeLineViewModel = new TimeLineViewModel(authenticationService, settingsProvider);

            mentionsViewModel = new MentionsViewModel(authenticationService, settingsProvider);

            tweetActionViewModel = new TweetActionViewModel(authenticationService, settingsProvider);
        }
        public async Task <IActionResult> CreatePost(TimeLineViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }

            var user = await this.userManager.GetUserAsync(this.User);

            var sanitizer = new HtmlSanitizer();

            var content = sanitizer.Sanitize(model.Content);

            await this.newsFeedService.CreateAsync(content, user.Id);

            return(this.Redirect(nameof(this.NewsFeedContent)));
        }
Example #16
0
        public async Task <IActionResult> Index()
        {
            var viewModel = new TimeLineViewModel();
            var user      = AccountService.GetAccountByUsername(User.Identity.Name);
            var response  = await httpClient.GetAsync("api/post");

            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                var content = await response.Content.ReadAsStringAsync();

                var posts = JsonConvert.DeserializeObject <List <Post> >(content);

                viewModel.Posts        = posts;
                viewModel.UserLoggedIn = user;
            }
            return(View(viewModel));
        }
        public TimeLineViewModel GetModelForTimeline(TimelineGetDTO dto)
        {
            var model = new TimeLineViewModel();

            if (dto.Date.Year < 1950)
            {
                dto.Date = DateTime.Now.Date;
            }

            model.Order = dto.OrderId > 0 ?
                          dbManager.GetById <Order>(dto.OrderId) :
                          orderManager.Get(dto.Date, dto.ShiftId, dto.OrderAreaId);
            model.Work = dto.WorkId > 0 ?
                         dbManager.GetById <Work>(dto.WorkId) :
                         new Work().SetTime(dto.StartTime, dto.StartTime.AddMinutes(10), model.Order.Shift);
            model.MachineName = dto.MoSId > 0 ? dbManager.GetById <MachineryOnShift>(dto.MoSId).Name : null;

            model.WorkTypes = GetTypes();
            model.CoalSorts = GetSorts();
            model.Areas     = dbManager.GetAll <OrderArea>().ToList().Where(x => !String.IsNullOrEmpty(x.Name)).ToList();

            var startHour = model.Order.Shift == 1 ?
                            new DateTime(1, 1, 1, 8, 0, 0) :
                            new DateTime(1, 1, 1, 20, 0, 0);
            var hours = new List <string>();

            for (int i = 0; i < 12; i++)
            {
                hours.Add(startHour.AddHours(i).ToString("HH:mm"));
            }
            hours.Add(startHour.AddHours(11).ToString("HH:59"));
            model.Hours = hours;

            var timeIntervals = new List <string>();

            for (int i = 0; i < 72; i++)
            {
                timeIntervals.Add(startHour.AddMinutes(i * 10).ToString("HH:mm"));
            }

            model.TimeIntervals = timeIntervals;

            return(model);
        }
        public async Task <IActionResult> NewsFeedContent(int id = 1)
        {
            var user = await this.userManager.GetUserAsync(this.User);

            var model = new TimeLineViewModel
            {
                PostsPerPage = PostPerPage,
                PageNumber   = id,
                AllPosts     = this.newsFeedService.GetAllSocialPosts <TimeLineAllPostsViewModel>(id, PostPerPage),
                PostsCount   = this.newsFeedService.GetPostsCount(),
                NewsComments = await this.newsFeedService.GetAllCommentsAsync(),
            };

            model.ProfilePictureUrl = await this.newsFeedService.LastProfilePictureAsync(user.Id);

            model.CoverPictureUrl = await this.newsFeedService.LastCoverPictureAsync(user.Id);

            return(this.View(model));
        }
        protected override void OnAppearing()
        {
            base.OnAppearing();

            _timeLineViewModel = (TimeLineViewModel)BindingContext;
            if (GlobalData.UserInfo == null)
            {
                _timeLineViewModel.Years         = null;
                _timeLineViewModel.RecipeRecords = null;
                _timeLineViewModel.CanRefresh    = false;
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("请先登录!"));
                return;
            }
            AddHubMessage();
            if (_isBackstage)
            {
                return;
            }
            AssignmentTimeLine();
        }
Example #20
0
        private static TimeLineViewModel GenerateTimeline()
        {
            DateTime          startDate = new DateTime(2018, 08, 27);
            TimeLineViewModel model     = new TimeLineViewModel();

            model.Items.Add(GenerateTimeLineStart(startDate, "fas fa-asterisk", "success", "The Idea", startDate.ToShortDateString(), "This is where the whole idea began. We wrote a Google Document to sketch the idea and see the big picture forming."));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2018, 09, 13), "fas fa-play", "success", "The First Commit", "Every journey starts with a first step.", "A simple README file added to start the repository."));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2018, 09, 14), "fas fa-cloud", "warning", "September 2018", "A month full of tasks", "September 2018 was a busy month for us. We setup our CI/CD pipeline and also:", new List <string>()
            {
                "Archtecture defined",
                "Menu defined",
                "Basic Register and Login working",
                "Profile page prototyped",
                "Tag Cloud"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2018, 10, 01), "fas fa-shield-alt", "info", "October 2018", "Security first", "October was a month to work on the security system. Several improvements were made on the Register and Login workflows."));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2018, 11, 01), "fas fa-cloud", "danger", "September 2018", "A really busy month!", "November was awesome for LUDUSTACK. We manage to implement several core systems that are used across the whole platform.", new List <string>()
            {
                "Forgot password, password reset, email verification",
                "Front page improvements",
                "Facebook, Google and Microsoft Authentication",
                "Game page prototyped",
                "Terms of Use and Privacy Policy added",
                "Image Upload",
                "Use user image when registering with Facebook",
                "AJAX front page",
                "Latest games component",
                "Counters component",
                "Favicons and Manifest",
                "Basic localization system implemented with Portuguese (by Daniel Gomes)  and Russian by Denis Mokhin)",
                "Dynamic taglist on the front page",
                "Basic staff roles defined",
                "Translation project integration",
                "OpenGraph implementated",
                "Like/Unlike system",
                "Comment system",
                "Progressive Web App implemented"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2018, 12, 01), "fas fa-cloud", "success", "December 2018", "To close the year.", "In December we implemented a few things needed for the launch day.", new List <string>()
            {
                "Language selection",
                "Game activity feed",
                "Content view and edit",
                "Image cropping",
                "GDPR cookies warning",
                "Facebook sharing",
                "Structured data from schema.org"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 01, 01), "fas fa-globe", "primary", "January 2019", "Happy new year! Let's work!", "We started the year by optimizing the whole platform.", new List <string>()
            {
                "Page speed improvements",
                "Search Engine Optimization (title, description, sitemap, etc",
                "Added Bosnian, Croatian and Serbian languages added by Kamal Tufekčić",
                "German language started by Thorben",
                "Featured article system implemented (staff only)",
                "Username validation",
                "Cache management"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 02, 01), "fas fa-globe", "success", "February 2019", "Some tweaks", "LuduStack is for everyone!", new List <string>()
            {
                "Image size descriptions",
                "Accessibility improvements",
                "Images on CDN"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 03, 01), "fas fa-vote-yea", "primary", "March 2019", "Democracy", "The voting system! Users can now:", new List <string>()
            {
                "Suggest ideas",
                "Vote on other people's ideas",
                "Comment on ideas",
                "Create your own brainstorm sessions"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 04, 01), "fas fa-comment", "primary", "April 2019", "Fast posting", "Like a good social network you can now:", new List <string>()
            {
                "Post directly from the front page",
                "Add a image to post",
                "Post from within your game",
                "Game like"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 05, 01), "fas fa-trophy", "success", "May 2019", "Game On!", "Climb the LuduStack Ranks to the glory", new List <string>()
            {
                "Ranking System",
                "Experience Points",
                "Badges"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 06, 01), "fas fa-connectdevelop", "info", "June 2019", "Social Interaction", "Follow games and users and connect to users to increase your social network!", new List <string>()
            {
                "Notifications!",
                "Game Follow",
                "User Follow",
                "User Connection System"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 07, 01), "fas fa-poll", "success", "July 2019", "This or that?", "Polls, preferences and more!", new List <string>()
            {
                "Basic Polls - Get opinions from your fellow devs!",
                "Better preferences - Now you can change your email, set your phone and more!",
                "Two Factor Authentication - Be more safe with this security feature",
                "Content post language selection",
                "Ranking Page",
                "Post new suggestions right from the sidebar",
                "Basic search results",
                "QR code generation"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 08, 01), "fas fa-question", "primary", "August 2019", "...", "Nothing to see here, keep scrolling!"));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 09, 01), "fas fa-trash-alt", "danger", "September 2019", "You got the power!", "Must have features!", new List <string>()
            {
                "You can now delete your own posts",
                "Share your game!",
                "Rank Levels page"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 10, 01), "fas fa-users", "info", "October 2019", "Team up!", "Join forces to make games.", new List <string>()
            {
                "Team Management",
                "Points Earned notification",
                "Brainstorm Ideas status control",
                "External Links working on profiles and games",
                "Teams can be linked to games",
                "Recruitin Teams!",
                "#hashtagging"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2019, 12, 01), "fas fa-bolt", "danger", "December 2019", "Optimizations!", "Now the whole web rendering is blazing fast!"));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 01, 01), "fas fa-briefcase", "warning", "January 2020", "It is time to work! Seriously!", "The job management is here!", new List <string>()
            {
                "Create job position",
                "List existing positions",
                "Apply to positions",
                "See who applied to your posted job positions"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 03, 01), "fas fa-heart", "danger", "March 2020", "Thank you all!", "We reached the mark of 300 users and  100 games. Thank you all for your love!", new List <string>()
            {
                "A Special Thanks page"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 04, 01), "fas fa-language", "primary", "April 2020", "Localize your games!", "The localization tool has arrived!", new List <string>()
            {
                "Ask for translation from the community",
                "Help others, translating terms to your own language",
                "Import and export files",
                "Review translations",
                "Post game content directly from home",
                "Set Game Characteristics"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 06, 01), "fas fa-rocket", "secondary", "June 2020", "New name!", "Now we are called LUDUSTACK! The one stop place for game developers."));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 07, 01), "fas fa-fw fa-ticket-alt", "success", "July 2020", "It is time for sweepstakes!", "You can now run your own giveaways!", new List <string>()
            {
                "GDPR compliant",
                "Email confirmation",
                "Tracked link sharing for more chances to win",
                "Daily entries"
            }));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 08, 01), "fas fa-dice", "primary", "August 2020", "New Ideas!", "Random Game Idea added to the front page to overcome your creative block!"));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 09, 01), "fas fa-dollar-sign", "success", "September 2020", "Calculations!", "The Rate Calculator will help you charge correctly for jobs with your skillset!"));

            // Future
            model.Items.Add(GenerateTimeLineItem(new DateTime(2020, 11, 01), "fas fa-bug", "danger", "November 2020", "Open Beta", "At this point, we hope to have a consistent beta tester base so we can polish the platform and fix every possible bug tha shows up."));

            model.Items.Add(GenerateTimeLineItem(new DateTime(2021, 01, 01), "fas fa-star", "success", "January 2021", "Launch day!", "This is the scheduled launch day. On this day, all the core features will be implemented."));

            model.Items = model.Items.OrderBy(x => x.Date).ToList();
            return(model);
        }
Example #21
0
        public IActionResult Timeline()
        {
            TimeLineViewModel model = GenerateTimeline();

            return(View(model));
        }
        public void Setup()
        {
            DispatcherHelper.Initialize();

            _mockAuthenticationService = new Mock<INGTweetAuthenticationService>().Object;

            _mockApplicationSettingsProvider = new Mock<IApplicationSettingsProvider>().Object;

            _viewModel = new TimeLineViewModel(_mockAuthenticationService, _mockApplicationSettingsProvider);
        }
        public ComboTrainerViewModel(IEventAggregator events)
        {
            _events = events;

            _timeLineViewModel = new TimeLineViewModel(events);
        }
 protected override void OnAppearing()
 {
     base.OnAppearing();
     BindingContext = new TimeLineViewModel();
 }