IsRoaming() static private method

static private IsRoaming ( IsolatedStorageScope scope ) : bool
scope IsolatedStorageScope
return bool
Example #1
0
        public void Close()
        {
            if (Helper.IsRoaming(Scope))
            {
                return;
            }

            lock (_internalLock)
            {
                if (!_closed)
                {
                    _closed = true;
                    GC.SuppressFinalize(this);
                }
            }
        }
Example #2
0
        private bool ContainsUnknownFiles(string directory)
        {
            string[] dirs, files;

            try
            {
                files = Directory.GetFiles(directory);
                dirs  = Directory.GetDirectories(directory);
            }
            catch
            {
                throw new IsolatedStorageException(SR.IsolatedStorage_DeleteDirectories);
            }

            if (dirs.Length > 1 || (dirs.Length > 0 && !IsMatchingScopeDirectory(dirs[0])))
            {
                // Unknown folder present
                return(true);
            }

            if (files.Length == 0)
            {
                return(false);
            }

            // Check if we have unknown files

            // Note that we don't generate these files in CoreFX, but we want to match
            // NetFX removal semantics as NetFX will generate these.

            if (Helper.IsRoaming(Scope))
            {
                return((files.Length > 1) || !IsIdFile(files[0]));
            }

            return(files.Length > 2 ||
                   (
                       (!IsIdFile(files[0]) && !IsInfoFile(files[0]))) ||
                   (files.Length == 2 && !IsIdFile(files[1]) && !IsInfoFile(files[1]))
                   );
        }