System.IO.IsolatedStorage.TwoLevelFileEnumerator.MoveNext C# (CSharp) Méthode

MoveNext() public méthode

public MoveNext ( ) : bool
Résultat bool
        public bool MoveNext()
        {
            lock (this)
            {
                // Sepecial case the Reset State
                if (m_fReset)
                {
                    m_fReset = false;
                    return AdvanceRootDir();
                }
        
                // Don't move anything if RootDir is empty
                if (m_RootDir.Length == 0)
                    return false;
    
    
                // Get Next SubDir
    
                ++m_nSubDir;
        
                if (m_nSubDir >= m_SubDir.Length)
                {
                    m_nSubDir = m_SubDir.Length;    // to avoid wrap aournd.
                    return AdvanceRootDir();
                }
    
                UpdateCurrent();
            }
    
            return true;
        }
    

Usage Example

Exemple #1
0
        public bool MoveNext()
        {
            IsolatedStorageFile  isf;
            IsolatedStorageScope scope;
            bool     fApp;
            TwoPaths tp;
            Stream   app, assem;
            String   appName, assemName;

            m_fiop.Assert();

            m_fReset = false;

            do
            {
                if (m_fileEnum.MoveNext() == false)
                {
                    m_fEnd = true;
                    break;
                }

                // Create the store
                isf = new IsolatedStorageFile();

                tp   = (TwoPaths)m_fileEnum.Current;
                fApp = false;

#if _DEBUG
                if (s_fDebug)
                {
                    Console.Write(tp.Path1 + " ");
                    Console.WriteLine(tp.Path2);
                }
#endif

                if (IsolatedStorageFile.NotAssemFilesDir(tp.Path2))
                {
                    fApp = true;
                }

                // Create Roaming Store
                app   = null;
                assem = null;

                if (fApp)
                {
                    if (!GetIDStream(tp.Path1, out app))
                    {
                        continue;
                    }

                    if (!GetIDStream(tp.Path1 + s_SepExternal + tp.Path2,
                                     out assem))
                    {
                        continue;
                    }

                    app.Position = 0;

                    if (IsolatedStorage.IsRoaming(m_Scope))
                    {
                        scope = IsolatedStorage.c_AppRoaming;
                    }
                    else
                    {
                        scope = IsolatedStorage.c_App;
                    }

                    appName   = tp.Path1;
                    assemName = tp.Path2;
                }
                else
                {
                    if (!GetIDStream(tp.Path1, out assem))
                    {
                        continue;
                    }

                    if (IsolatedStorage.IsRoaming(m_Scope))
                    {
                        scope = IsolatedStorage.c_AssemblyRoaming;
                    }
                    else
                    {
                        scope = IsolatedStorage.c_Assembly;
                    }

                    appName   = null;
                    assemName = tp.Path1;
                }

                assem.Position = 0;

                if (!isf.InitStore(scope, app, assem, appName, assemName))
                {
                    continue;
                }

                if (!isf.InitExistingStore(scope))
                {
                    continue;
                }

                m_Current = isf;

                return(true);
            } while (true);

            return(false);
        }