internal static NotificationAction GetScheduledNotification() { var value = CookieProperty.Get(COOKIE_KEY).GetAlreadyCompletedResult(); if (value.IsEmpty()) { return(null); } CookieProperty.Remove(COOKIE_KEY); return(JsonConvert.DeserializeObject <NotificationAction>(value)); }
internal static async Task <NotificationAction> GetScheduledNotification() { var value = await CookieProperty.Get(COOKIE_KEY); if (value.IsEmpty()) { return(null); } CookieProperty.Remove(COOKIE_KEY); return(JsonConvert.DeserializeObject <NotificationAction>(value)); }
static Dictionary <string, string> ReadAllSortExpressionSettings() { var cookie = CookieProperty.Get(LIST_CONTAINERS_SORT_EXPRESSION_COOKIE_NAME); if (cookie.IsEmpty()) { return(new Dictionary <string, string>()); } var items = cookie.Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries).Trim(); var settings = items.Select(a => a.Split('=').Trim().ToArray()).Where(x => x.Length == 2).ToArray(); return(settings.ToDictionary(a => a[0], a => a[1])); }
public IUser LoadUser(System.Security.Principal.IPrincipal principal) { var userId = ApplicationEventManager.GetCurrentUserId(principal); if (userId == null) { var cookieValue = CookieProperty.Get <string>(".ASPXAUTH", defaultValue: null); if (cookieValue.HasValue()) { userId = FormsAuthentication.Decrypt(cookieValue).Name; } } if (userId == null) { return(null); // throw new Exception("There is no current user logged in."); } return(Database.Get <IUser>(userId)); }
public static async Task <string> GetOriginalUrl() => (await CookieProperty.Get("Impersonation.Original.Url")).Or("~/");
public T Get <T>() => CookieProperty.Get <T>();