本文整理汇总了C#中System.IO.IsolatedStorage.IsolatedStorageFile.InitStore方法的典型用法代码示例。如果您正苦于以下问题:C# IsolatedStorageFile.InitStore方法的具体用法?C# IsolatedStorageFile.InitStore怎么用?C# IsolatedStorageFile.InitStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.IsolatedStorage.IsolatedStorageFile
的用法示例。
在下文中一共展示了IsolatedStorageFile.InitStore方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStore
/// <include file='doc\IsolatedStorageFile.uex' path='docs/doc[@for="IsolatedStorageFile.GetStore2"]/*' />
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope,
Evidence domainEvidence, Type domainEvidenceType,
Evidence assemblyEvidence, Type assemblyEvidenceType)
{
// Verify input params.
if (IsDomain(scope) && (domainEvidence == null))
throw new ArgumentNullException("domainEvidence");
if (assemblyEvidence == null)
throw new ArgumentNullException("assemblyEvidence");
DemandAdminPermission();
IsolatedStorageFile sf = new IsolatedStorageFile();
sf.InitStore(scope, domainEvidence, domainEvidenceType,
assemblyEvidence, assemblyEvidenceType);
sf.Init(scope);
return sf;
}
示例2: MoveNext
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;
}
示例3: GetUserStoreForApplication
public static IsolatedStorageFile GetUserStoreForApplication ()
{
IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Application;
IsolatedStorageFile storageFile = new IsolatedStorageFile (scope);
storageFile.InitStore (scope, null);
storageFile._fullEvidences = Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile.PostInit ();
return storageFile;
}
示例4: GetStore
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope,
Object applicationIdentity)
{
if (applicationIdentity == null)
throw new ArgumentNullException("applicationIdentity");
Contract.EndContractBlock();
DemandAdminPermission();
IsolatedStorageFile sf = new IsolatedStorageFile();
sf.InitStore(scope, null, null, applicationIdentity);
sf.Init(scope);
return sf;
}
示例5: GetStore
public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Evidence domainEvidence, Type domainEvidenceType, Evidence assemblyEvidence, Type assemblyEvidenceType)
{
if (assemblyEvidence == null)
{
throw new ArgumentNullException("assemblyEvidence");
}
if (System.IO.IsolatedStorage.IsolatedStorage.IsDomain(scope) && (domainEvidence == null))
{
throw new ArgumentNullException("domainEvidence");
}
DemandAdminPermission();
IsolatedStorageFile file = new IsolatedStorageFile();
file.InitStore(scope, domainEvidence, domainEvidenceType, assemblyEvidence, assemblyEvidenceType, null, null);
file.Init(scope);
return file;
}
示例6: GetStore
public static IsolatedStorageFile GetStore (IsolatedStorageScope scope, Type applicationEvidenceType)
{
Demand (scope);
IsolatedStorageFile storageFile = new IsolatedStorageFile (scope);
storageFile.InitStore (scope, applicationEvidenceType);
storageFile._fullEvidences = Assembly.GetCallingAssembly ().UnprotectedGetEvidence ();
storageFile.PostInit ();
return storageFile;
}
示例7: MoveNext
//.........这里部分代码省略.........
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;
}
示例8: MoveNext
public bool MoveNext()
{
IsolatedStorageScope scope;
string str;
string str2;
string str3;
this.m_fiop.Assert();
this.m_fReset = false;
Label_0012:
if (!this.m_fileEnum.MoveNext())
{
this.m_fEnd = true;
return false;
}
IsolatedStorageFile file = new IsolatedStorageFile();
TwoPaths current = (TwoPaths) this.m_fileEnum.Current;
bool flag = false;
if (IsolatedStorageFile.NotAssemFilesDir(current.Path2) && IsolatedStorageFile.NotAppFilesDir(current.Path2))
{
flag = true;
}
Stream s = null;
Stream stream2 = null;
Stream stream3 = null;
if (flag)
{
if (!this.GetIDStream(current.Path1, out s) || !this.GetIDStream(current.Path1 + '\\' + current.Path2, out stream2))
{
goto Label_0012;
}
s.Position = 0L;
if (System.IO.IsolatedStorage.IsolatedStorage.IsRoaming(this.m_Scope))
{
scope = IsolatedStorageScope.Roaming | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain | IsolatedStorageScope.User;
}
else if (System.IO.IsolatedStorage.IsolatedStorage.IsMachine(this.m_Scope))
{
scope = IsolatedStorageScope.Machine | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain;
}
else
{
scope = IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain | IsolatedStorageScope.User;
}
str = current.Path1;
str2 = current.Path2;
str3 = null;
}
else if (IsolatedStorageFile.NotAppFilesDir(current.Path2))
{
if (!this.GetIDStream(current.Path1, out stream2))
{
goto Label_0012;
}
if (System.IO.IsolatedStorage.IsolatedStorage.IsRoaming(this.m_Scope))
{
scope = IsolatedStorageScope.Roaming | IsolatedStorageScope.Assembly | IsolatedStorageScope.User;
}
else if (System.IO.IsolatedStorage.IsolatedStorage.IsMachine(this.m_Scope))
{
scope = IsolatedStorageScope.Machine | IsolatedStorageScope.Assembly;
}
else
{
scope = IsolatedStorageScope.Assembly | IsolatedStorageScope.User;
}
str = null;
str2 = current.Path1;
str3 = null;
stream2.Position = 0L;
}
else
{
if (!this.GetIDStream(current.Path1, out stream3))
{
goto Label_0012;
}
if (System.IO.IsolatedStorage.IsolatedStorage.IsRoaming(this.m_Scope))
{
scope = IsolatedStorageScope.Application | IsolatedStorageScope.Roaming | IsolatedStorageScope.User;
}
else if (System.IO.IsolatedStorage.IsolatedStorage.IsMachine(this.m_Scope))
{
scope = IsolatedStorageScope.Application | IsolatedStorageScope.Machine;
}
else
{
scope = IsolatedStorageScope.Application | IsolatedStorageScope.User;
}
str = null;
str2 = null;
str3 = current.Path1;
stream3.Position = 0L;
}
if (!file.InitStore(scope, s, stream2, stream3, str, str2, str3) || !file.InitExistingStore(scope))
{
goto Label_0012;
}
this.m_Current = file;
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:100,代码来源:IsolatedStorageFileEnumerator.cs