private void DoChnageTimePointAction(DateTime timePoint, Action <UserRecentDataCategory> action) { UserRecentDataCategory recentTimes = UserRecentData.LoadSettings(DeluxeIdentity.CurrentUser.ID, "recentTimepoints"); action(recentTimes); using (TransactionScope scope = TransactionScopeFactory.Create()) { recentTimes.SaveChanges(DeluxeIdentity.CurrentUser.ID); ChangeAndSaveTimePoint(timePoint); scope.Complete(); } this.OnTimePointChanged(EventArgs.Empty); }
private void RefreshTimeShuttle() { this.timemark.InnerText = TimePointContext.Current.UseCurrentTime ? "现在" : TimePointContext.Current.SimulatedTime.ToString("yyyy-MM-dd HH:mm:ss"); IUser curUser = DeluxeIdentity.CurrentUser; this.userLogonName.InnerText = curUser.DisplayName; //this.userPresence.UserID = curUser.ID; //this.userPresence.UserIconUrl = "~/Handlers/UserPhoto.ashx?id=" + Server.UrlEncode(curUser.ID) + "&time=now"; UserRecentDataCategory category = UserRecentData.GetSettings(curUser.ID, "recentTimepoints"); var recentTimePoints = category.Items; this.recentList.DataSource = this.GetRecentTimeView(recentTimePoints, category.DefaultSize); this.recentList.DataBind(); }
private static UserRecentDataCategory GetDefaultCategorySettings(string category) { category.CheckStringIsNullOrEmpty("category"); UserRecentDataCategory settings = new UserRecentDataCategory(); settings.InitFromConfiguration(UserRecentDataConfigurationSection.GetConfig().Categories[category]); return settings; }