System.IO.IsolatedStorage.IsolatedStorageFile.GetStore C# (CSharp) Method

GetStore() public static method

public static GetStore ( System scope, System domainEvidenceType, System assemblyEvidenceType ) : System.IO.IsolatedStorage.IsolatedStorageFile
scope System
domainEvidenceType System
assemblyEvidenceType System
return System.IO.IsolatedStorage.IsolatedStorageFile
        public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type domainEvidenceType, System.Type assemblyEvidenceType) { throw null; }
        public static System.IO.IsolatedStorage.IsolatedStorageFile GetUserStoreForApplication() { throw null; }

Same methods

IsolatedStorageFile::GetStore ( IsolatedStorageScope scope ) : IsolatedStorageFile
IsolatedStorageFile::GetStore ( IsolatedStorageScope scope, Type applicationEvidenceType ) : IsolatedStorageFile
IsolatedStorageFile::GetStore ( IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType ) : IsolatedStorageFile
IsolatedStorageFile::GetStore ( IsolatedStorageScope scope, object applicationIdentity ) : IsolatedStorageFile
IsolatedStorageFile::GetStore ( IsolatedStorageScope scope, object domainIdentity, object assemblyIdentity ) : IsolatedStorageFile
IsolatedStorageFile::GetStore ( System scope, System applicationEvidenceType ) : System.IO.IsolatedStorage.IsolatedStorageFile
IsolatedStorageFile::GetStore ( System scope, object applicationIdentity ) : System.IO.IsolatedStorage.IsolatedStorageFile
IsolatedStorageFile::GetStore ( System scope, object domainIdentity, object assemblyIdentity ) : System.IO.IsolatedStorage.IsolatedStorageFile

Usage Example

Example #1
0
        private static string CreateIsolatedPath(IsolatedStorageFile isf, string path, FileMode mode)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            if (!Enum.IsDefined(typeof(FileMode), mode))
            {
                throw new ArgumentException("mode");
            }

            if (isf == null)
            {
                // we can't call GetUserStoreForDomain here because it depends on
                // Assembly.GetCallingAssembly (), which would be our constructor,
                // i.e. the result would always be mscorlib.dll. So we need to do
                // a small stack walk to find who's calling the constructor

                StackFrame sf = new StackFrame(3);                  // skip self and constructor
                isf = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly,
                                                   IsolatedStorageFile.GetDomainIdentityFromEvidence(AppDomain.CurrentDomain.Evidence),
                                                   IsolatedStorageFile.GetAssemblyIdentityFromEvidence(sf.GetMethod().ReflectedType.Assembly.UnprotectedGetEvidence()));
            }

            // ensure that the _root_ isolated storage can be (and is) created.
            FileInfo fi = new FileInfo(isf.Root);

            if (!fi.Directory.Exists)
            {
                fi.Directory.Create();
            }

            // other directories (provided by 'path') must already exists
            string file = Path.Combine(isf.Root, path);

            fi = new FileInfo(file);
            if (!fi.Directory.Exists)
            {
                // don't leak the path information for isolated storage
                string msg = Locale.GetText("Could not find a part of the path \"{0}\".");
                throw new DirectoryNotFoundException(String.Format(msg, path));
            }

            // FIXME: this is probably a good place to Assert our security
            // needs (once Mono supports imperative security stack modifiers)

            return(file);
        }
All Usage Examples Of System.IO.IsolatedStorage.IsolatedStorageFile::GetStore