コード例 #1
0
        /// <summary>
        /// Returns the IsolatedStorageFile scoped to Assembly, Domain and User
        /// </summary>
        /// <remarks>Callers must lock on IsoStoreSyncRoot before calling this for thread-safety.
        /// For example:
        ///
        ///   lock (IsoStoreSyncRoot)
        ///   {
        ///       // do something with the returned IsolatedStorageFile
        ///       PackagingUtilities.DefaultIsolatedStorageFile.DeleteFile(_isolatedStorageStreamFileName);
        ///   }
        ///
        ///</remarks>
        private static ReliableIsolatedStorageFileFolder GetDefaultIsolatedStorageFile()
        {
            // Cache and re-use the same object for multiple requests - resurrect if disposed
            if (_defaultFile == null || _defaultFile.IsDisposed())
            {
                _defaultFile = new ReliableIsolatedStorageFileFolder();
            }

            return(_defaultFile);
        }
コード例 #2
0
            //------------------------------------------------------
            //
            //  Internal Methods
            //
            //------------------------------------------------------
            internal SafeIsolatedStorageFileStream(
                string path, FileMode mode, FileAccess access,
                FileShare share, ReliableIsolatedStorageFileFolder folder)
                : base(path, mode, access, share, folder.IsoFile)
            {
                if (path == null)
                {
                    throw new ArgumentNullException("path");
                }

                _path   = path;
                _folder = folder;
                _folder.AddRef();
            }
コード例 #3
0
ファイル: PackagingUtilities.cs プロジェクト: JianwenSun/cc
            //------------------------------------------------------
            //
            //  Internal Methods
            //
            //------------------------------------------------------
            internal SafeIsolatedStorageFileStream(
                string path, FileMode mode, FileAccess access,
                FileShare share, ReliableIsolatedStorageFileFolder folder)
                : base(path, mode, access, share, folder.IsoFile)
            {
                if (path == null)
                    throw new ArgumentNullException("path");

                _path = path;
                _folder = folder;
                _folder.AddRef();
            }
コード例 #4
0
ファイル: PackagingUtilities.cs プロジェクト: JianwenSun/cc
        /// <summary>
        /// Returns the IsolatedStorageFile scoped to Assembly, Domain and User
        /// </summary>  
        /// <remarks>Callers must lock on IsoStoreSyncRoot before calling this for thread-safety.
        /// For example:
        /// 
        ///   lock (IsoStoreSyncRoot)
        ///   {
        ///       // do something with the returned IsolatedStorageFile
        ///       PackagingUtilities.DefaultIsolatedStorageFile.DeleteFile(_isolatedStorageStreamFileName);
        ///   }
        /// 
        ///</remarks>
        private static ReliableIsolatedStorageFileFolder GetDefaultIsolatedStorageFile()
        {
            // Cache and re-use the same object for multiple requests - resurrect if disposed
            if (_defaultFile == null || _defaultFile.IsDisposed())
            {
                _defaultFile = new ReliableIsolatedStorageFileFolder();
            }

            return _defaultFile;
        }