internal CacheControllerBehavior() { this._userSession = new SessionInfo(); this._knownTypes = new List<EntityType>(); this._serFormat = SerializationFormat.ODataAtom; this._scopeParameters = new Dictionary<string, string>(); }
public bool LoadUserSession() { bool result = true; using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) { bool fileExist = isoFile.FileExists(SESSION_FILE_NAME); if (fileExist) { BinaryFormatter formatter = new BinaryFormatter(); using (IsolatedStorageFileStream fileStream = isoFile.OpenFile(SESSION_FILE_NAME, FileMode.Open)) { object session = formatter.Deserialize(fileStream); if (session is SessionInfo) { SessionInfo userSession = (SessionInfo)session; if (userSession != null && !string.IsNullOrEmpty(userSession.UserId)) { _userSession = userSession; result = true; } } } } } return result; }