public static void DeleteFile(RemoteIsolatedStorageFileObject remoteIsoStoreFileWrapperObj, string path) { var remoteIsoStoreFile = GetRemoteIsolatedStorageFileFromWrapper(remoteIsoStoreFileWrapperObj); if (remoteIsoStoreFile != null) { remoteIsoStoreFile.DeleteFile(path); } }
public static void DeleteFile(RemoteIsolatedStorageFileObject remoteIsoStoreFileWrapperObj, string path) { var remoteIsoStoreFile = GetRemoteIsolatedStorageFileFromWrapper(remoteIsoStoreFileWrapperObj); if (remoteIsoStoreFile != null) { remoteIsoStoreFile.DeleteFile(path); } }
/// <summary> /// We need access to the actual RemoteIsolatedStorageFile object since the wrapper doesn't expost a DeleteFile method /// so get to it via reflection /// </summary> /// <param name="wrapperRemoteIsoFile"></param> /// <returns></returns> private static RemoteIsolatedStorageFile GetRemoteIsolatedStorageFileFromWrapper(RemoteIsolatedStorageFileObject wrapperRemoteIsoFile) { BindingFlags eFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; var fieldInfo = (typeof(RemoteIsolatedStorageFileObject)).GetField("mRemoteIsolatedStorageFile", eFlags); if (fieldInfo != null) return fieldInfo.GetValue(wrapperRemoteIsoFile) as RemoteIsolatedStorageFile; return null; }
/// <summary> /// We need access to the actual RemoteIsolatedStorageFile object since the wrapper doesn't expost a DeleteFile method /// so get to it via reflection /// </summary> /// <param name="wrapperRemoteIsoFile"></param> /// <returns></returns> public static RemoteIsolatedStorageFile GetRemoteIsolatedStorageFile(this RemoteIsolatedStorageFileObject wrapperRemoteIsoFile) { BindingFlags eFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; var fieldInfo = (typeof(RemoteIsolatedStorageFileObject)).GetField("mRemoteIsolatedStorageFile", eFlags); if (fieldInfo != null) { return(fieldInfo.GetValue(wrapperRemoteIsoFile) as RemoteIsolatedStorageFile); } return(null); }