public bool MoveNext()
{
IsolatedStorageFile isf;
IsolatedStorageScope scope;
bool fDomain;
TwoPaths tp;
Stream domain, assem, app;
String domainName, assemName, appName;
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;
fDomain = false;
#if _DEBUG
if (s_fDebug)
{
Console.Write(tp.Path1 + " ");
Console.WriteLine(tp.Path2);
}
#endif
if (IsolatedStorageFile.NotAssemFilesDir(tp.Path2) &&
IsolatedStorageFile.NotAppFilesDir(tp.Path2))
fDomain = true;
// Create Roaming Store
domain = null;
assem = null;
app = null;
if (fDomain)
{
if (!GetIDStream(tp.Path1, out domain))
continue;
if (!GetIDStream(tp.Path1 + s_SepExternal + tp.Path2,
out assem))
continue;
domain.Position = 0;
if (IsolatedStorage.IsRoaming(m_Scope))
scope = IsolatedStorage.c_DomainRoaming;
else if (IsolatedStorage.IsMachine(m_Scope))
scope = IsolatedStorage.c_MachineDomain;
else
scope = IsolatedStorage.c_Domain;
domainName = tp.Path1;
assemName = tp.Path2;
appName = null;
}
else
{
if (IsolatedStorageFile.NotAppFilesDir(tp.Path2))
{
// Assembly
if (!GetIDStream(tp.Path1, out assem))
continue;
if (IsolatedStorage.IsRoaming(m_Scope))
scope = IsolatedStorage.c_AssemblyRoaming;
else if(IsolatedStorage.IsMachine(m_Scope))
scope = IsolatedStorage.c_MachineAssembly;
else
scope = IsolatedStorage.c_Assembly;
domainName = null;
assemName = tp.Path1;
appName = null;
assem.Position = 0;
}
else
{
// Application
if (!GetIDStream(tp.Path1, out app))
continue;
if (IsolatedStorage.IsRoaming(m_Scope))
scope = IsolatedStorage.c_AppUserRoaming;
else if(IsolatedStorage.IsMachine(m_Scope))
scope = IsolatedStorage.c_AppMachine;
else
scope = IsolatedStorage.c_AppUser;
domainName = null;
assemName = null;
appName = tp.Path1;
app.Position = 0;
}
}
if (!isf.InitStore(scope, domain, assem, app, domainName, assemName, appName))
continue;
if (!isf.InitExistingStore(scope))
continue;
m_Current = isf;
return true;
} while (true);
return false;
}