public static FromUnixTime ( double unixTime ) : System.DateTime | ||
unixTime | double | The unix time. |
Результат | System.DateTime |
public FacebookSession(IDictionary <string, object> dictionary, IFacebookApplication settings) { if (dictionary == null) { throw new ArgumentNullException("dictionary"); } if (settings == null) { throw new ArgumentNullException("settings"); } _settings = settings; var data = dictionary is JsonObject ? dictionary : FacebookUtils.ToDictionary(dictionary); AccessToken = data.ContainsKey("access_token") ? (string)data["access_token"] : null; if (!data.ContainsKey("uid") && !string.IsNullOrEmpty(AccessToken)) { data.Add("uid", ParseUserIdFromAccessToken(AccessToken)); } string sUserId = data.ContainsKey("uid") && data["uid"] != null ? data["uid"].ToString() : null; long userId = 0; long.TryParse(sUserId, out userId); UserId = userId; Secret = data.ContainsKey("secret") ? (string)data["secret"] : null; SessionKey = data.ContainsKey("session_key") ? (string)data["session_key"] : null; if (data.ContainsKey("expires")) { Expires = data["expires"].ToString() == "0" ? DateTime.MaxValue : DateTimeConvertor.FromUnixTime(Convert.ToDouble(data["expires"])); } else { Expires = DateTime.MinValue; } Signature = data.ContainsKey("sig") ? (string)data["sig"] : null; BaseDomain = data.ContainsKey("base_domain") ? (string)data["base_domain"] : null; _data = data; }