/// <summary> /// 获得本地文件CurrentXXXX.dat的对象表示 /// </summary> /// <returns></returns> static public T GetLocalCurrentdat <T>() where T : class { try { var str = IsolatedStoreHelper.GetFileToString(dictionary[typeof(T)]); return(JsonConvert.DeserializeObject <T>(str)); } catch { return(default(T)); } }
/// <summary> /// 设置对象到CurrentXXX.dat文件中 /// </summary> static public void SetObjectToLocal <T>(T item) where T : class { var str = JsonConvert.SerializeObject(item); IsolatedStoreHelper.WriteOrUpdateStringToIsoStore(dictionary[typeof(T)], str); }