Пример #1
0
        public static void DeleteFile(RemoteIsolatedStorageFileObject remoteIsoStoreFileWrapperObj, string path)
        {
            var remoteIsoStoreFile = GetRemoteIsolatedStorageFileFromWrapper(remoteIsoStoreFileWrapperObj);

            if (remoteIsoStoreFile != null)
            {
                remoteIsoStoreFile.DeleteFile(path);
            }
        }
Пример #2
0
        public static void DeleteFile(RemoteIsolatedStorageFileObject remoteIsoStoreFileWrapperObj, string path)
        {
            var remoteIsoStoreFile = GetRemoteIsolatedStorageFileFromWrapper(remoteIsoStoreFileWrapperObj);

            if (remoteIsoStoreFile != null)
            {
                remoteIsoStoreFile.DeleteFile(path);
            }
        }
Пример #3
0
        /// <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;
        }
Пример #4
0
        /// <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);
        }