Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InitializeFileStream()

static InitialiationData System.IO.IsolatedStorage.IsolatedStorageFileStream.InitializeFileStream ( string path,
FileMode mode,
FileAccess access,
FileShare share,
int bufferSize,
IsolatedStorageFile isf )
inlinestaticprivate

Definition at line 109 of file IsolatedStorageFileStream.cs.

110 {
111 if (path == null)
112 {
113 throw new ArgumentNullException("path");
114 }
115 if (path.Length == 0 || path.Equals("\\"))
116 {
118 }
119 bool flag = false;
120 if (isf == null)
121 {
122 isf = IsolatedStorageFile.GetUserStoreForDomain();
123 flag = true;
124 }
125 if (isf.Disposed)
126 {
127 throw new ObjectDisposedException(null, System.SR.IsolatedStorage_StoreNotOpen);
128 }
129 if ((uint)(mode - 1) > 5u)
130 {
132 }
133 InitialiationData initialiationData = default(InitialiationData);
134 initialiationData.FullPath = isf.GetFullPath(path);
135 initialiationData.StorageFile = isf;
136 InitialiationData result = initialiationData;
137 try
138 {
139 result.NestedStream = new FileStream(result.FullPath, mode, access, share, bufferSize, FileOptions.None);
140 return result;
141 }
142 catch (Exception rootCause)
143 {
144 try
145 {
146 if (flag)
147 {
148 result.StorageFile?.Dispose();
149 }
150 }
151 catch
152 {
153 }
154 throw IsolatedStorageFile.GetIsolatedStorageException(System.SR.IsolatedStorage_Operation_ISFS, rootCause);
155 }
156 }
FileStream(IntPtr handle, FileAccess access)
Definition FileStream.cs:71
static string IsolatedStorage_Path
Definition SR.cs:18
static string IsolatedStorage_StoreNotOpen
Definition SR.cs:14
static string IsolatedStorage_Operation_ISFS
Definition SR.cs:16
static string IsolatedStorage_FileOpenMode
Definition SR.cs:20
Definition SR.cs:7

References System.IO.FileStream.FileStream(), System.IO.IsolatedStorage.IsolatedStorageFile.Dispose(), System.IO.IsolatedStorage.IsolatedStorageFile.Disposed, System.IO.IsolatedStorage.IsolatedStorageFileStream.InitialiationData.FullPath, System.IO.IsolatedStorage.IsolatedStorageFile.GetFullPath(), System.IO.IsolatedStorage.IsolatedStorageFile.GetIsolatedStorageException(), System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForDomain(), System.SR.IsolatedStorage_FileOpenMode, System.SR.IsolatedStorage_Operation_ISFS, System.SR.IsolatedStorage_Path, System.SR.IsolatedStorage_StoreNotOpen, and System.IO.IsolatedStorage.IsolatedStorageFileStream.InitialiationData.StorageFile.