本文整理汇总了C#中Microsoft.Cci.ModuleIdentity类的典型用法代码示例。如果您正苦于以下问题:C# ModuleIdentity类的具体用法?C# ModuleIdentity怎么用?C# ModuleIdentity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleIdentity类属于Microsoft.Cci命名空间,在下文中一共展示了ModuleIdentity类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetModuleStore
ModuleStore GetModuleStore(ModuleIdentity moduleIdentity) {
Contract.Requires(moduleIdentity != null);
Contract.Ensures(Contract.Result<ModuleStore>() != null);
IName moduleName = moduleIdentity.Name;
foreach (ModuleStore mStore in this.ModuleHashtable.GetValuesFor((uint)moduleName.UniqueKey)) {
if (moduleIdentity.Equals(mStore.ModuleIdentitity)) return mStore;
}
uint value;
if (moduleIdentity.ContainingAssembly != null) {
AssemblyStore assemblyStore = this.GetAssemblyStore(moduleIdentity.ContainingAssembly);
assemblyStore.InternedIdWithCount++;
value = assemblyStore.InternedIdWithCount;
} else {
value = this.CurrentModuleInternValue++;
}
ModuleStore mStore1 = new ModuleStore(moduleIdentity, value, this.CurrentNamespaceInternValue++);
this.ModuleHashtable.Add((uint)moduleName.UniqueKey, mStore1);
return mStore1;
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:20,代码来源:Core.cs
示例2: ResolvingModuleReference
/// <summary>
/// This method is called when the module reference is being resolved and its not already loaded by the Read/Write host.
/// </summary>
/// <param name="referringUnit">The unit that is referencing the module.</param>
/// <param name="referencedModule">Module identity for the assembly being referenced.</param>
public virtual void ResolvingModuleReference(IUnit referringUnit, ModuleIdentity referencedModule) {
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:7,代码来源:Core.cs
示例3: ModuleStore
internal ModuleStore(
ModuleIdentity moduleIdentitity,
uint internedId,
uint rootNamespaceInternedId
) {
this.ModuleIdentitity = moduleIdentitity;
this.InternedId = internedId;
this.RootNamespaceInternedId = rootNamespaceInternedId;
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:9,代码来源:Core.cs
示例4: ModuleReference
/// <summary>
/// Allocates a reference to a .NET module.
/// </summary>
/// <param name="host">Provides a standard abstraction over the applications that host components that provide or consume objects from the metadata model.</param>
/// <param name="moduleIdentity"></param>
public ModuleReference(IMetadataHost host, ModuleIdentity moduleIdentity)
{
this.host = host;
this.moduleIdentity = moduleIdentity;
}
开发者ID:harib,项目名称:Afterthought,代码行数:10,代码来源:PlatformTypes.cs
示例5: ProbeModuleReference
public ModuleIdentity ProbeModuleReference(IUnit referringUnit, ModuleIdentity referencedModule) {
throw new NotImplementedException();
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:3,代码来源:Core.cs
示例6: LoadModule
/// <summary>
/// The module that matches the given reference, or a dummy module if no matching module can be found.
/// </summary>
public virtual IModule LoadModule(ModuleIdentity moduleIdentity) {
IUnit/*?*/ unit;
lock (GlobalLock.LockingObject) {
this.unitCache.TryGetValue(moduleIdentity, out unit);
}
IModule/*?*/ result;
if (unit != null)
result = unit as IModule;
else {
if (moduleIdentity.Location == "" || moduleIdentity.Location == "unknown://location") {
result = Dummy.Module;
lock (GlobalLock.LockingObject) {
this.unitCache.Add(moduleIdentity, result);
}
} else {
unit = this.LoadUnitFrom(moduleIdentity.Location);
result = unit as IModule;
if (result != null)
lock (GlobalLock.LockingObject) {
this.unitCache.Add(moduleIdentity, result);
this.coreIdentities.Add(result.CoreAssemblySymbolicIdentity);
}
}
}
if (result == null) result = Dummy.Module;
return result;
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:30,代码来源:Core.cs
示例7: GetModuleInternedKey
public uint GetModuleInternedKey(ModuleIdentity moduleIdentity) {
return 0;
}
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:3,代码来源:DummyObjects.cs
示例8: OpenModule
/// <summary>
/// Method to open the module in the MetadataReader. This method loads the module and returns the object corresponding to the opened module.
/// Also returns the ModuleIDentifier corresponding to the module as the out parameter. Modules are opened as if they are not contained in any assembly.
/// </summary>
/// <param name="binaryDocument">The binary document that needes to be opened as an module.</param>
/// <param name="moduleIdentity">Contains the module identity of the binary document in case it is an module.</param>
/// <returns>Module that is loaded or Dummy.Module in case module could not be loaded.</returns>
public IModule OpenModule(
IBinaryDocument binaryDocument,
out ModuleIdentity/*?*/ moduleIdentity
) {
moduleIdentity = null;
lock (GlobalLock.LockingObject) {
IBinaryDocumentMemoryBlock/*?*/ binaryDocumentMemoryBlock = this.metadataReaderHost.OpenBinaryDocument(binaryDocument);
if (binaryDocumentMemoryBlock == null) {
// Error...
return Dummy.Module;
}
PEFileReader peFileReader = new PEFileReader(this, binaryDocumentMemoryBlock);
if (peFileReader.ReaderState < ReaderState.Metadata) {
// Error...
return Dummy.Module;
}
//^ assert peFileReader.ReaderState >= ReaderState.Metadata;
if (peFileReader.IsAssembly) {
AssemblyIdentity assemblyIdentity = this.GetAssemblyIdentifier(peFileReader);
moduleIdentity = assemblyIdentity;
Assembly/*?*/ lookupAssembly = this.LookupAssembly(null, assemblyIdentity);
if (lookupAssembly != null) {
return lookupAssembly;
}
} else {
moduleIdentity = this.GetModuleIdentifier(peFileReader);
Module/*?*/ lookupModule = this.LookupModule(null, moduleIdentity);
if (lookupModule != null) {
return lookupModule;
}
}
try {
PEFileToObjectModel peFileToObjectModel = new PEFileToObjectModel(this, peFileReader, moduleIdentity, null, this.metadataReaderHost.PointerSize);
this.LoadedModule(peFileToObjectModel.Module);
Assembly/*?*/ assembly = peFileToObjectModel.Module as Assembly;
if (assembly != null) {
this.OpenMemberModules(binaryDocument, assembly);
}
return peFileToObjectModel.Module;
} catch (MetadataReaderException) {
// Error...
}
}
return Dummy.Module;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:52,代码来源:ModuleReadWriteFactory.cs
示例9: LoadModule
public IModule LoadModule(ModuleIdentity moduleIdentity) {
return Dummy.Module;
}
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:3,代码来源:DummyObjects.cs
示例10: ProbeModuleReference
public ModuleIdentity ProbeModuleReference(IUnit unit, ModuleIdentity referedModuleIdentity) {
return referedModuleIdentity;
}
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:3,代码来源:DummyObjects.cs
示例11: GetModuleInternedKey
public uint GetModuleInternedKey(ModuleIdentity moduleIdentity)
{
return m_factory.GetModuleInternedKey(moduleIdentity);
}
开发者ID:xornand,项目名称:cci,代码行数:4,代码来源:CachingInternFactory.cs
示例12: NotImplementedException
ModuleIdentity IMetadataHost.ProbeModuleReference(IUnit referringUnit, ModuleIdentity referencedModule)
{
throw new NotImplementedException();
}
开发者ID:mestriga,项目名称:Microsoft.CciSamples,代码行数:4,代码来源:ICcsHost.cs
示例13: lock
uint IInternFactory.GetModuleInternedKey(ModuleIdentity moduleIdentity) {
lock (GlobalLock.LockingObject) {
ModuleStore moduleStore = this.GetModuleStore(moduleIdentity);
return moduleStore.InternedId;
}
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:6,代码来源:Core.cs
示例14: LookupModule
/// <summary>
/// Does a look up in the loaded modules if the given module identified by moduleIdentifier is loaded. This also gives a chance to MetadataReaderHost to
/// delay load the module if needed.
/// </summary>
/// <param name="referringModule"></param>
/// <param name="moduleIdentity"></param>
/// <returns></returns>
internal Module/*?*/ LookupModule(IModule/*?*/ referringModule, ModuleIdentity moduleIdentity) {
lock (GlobalLock.LockingObject) {
uint internedModuleId = (uint)this.metadataReaderHost.InternFactory.GetModuleInternedKey(moduleIdentity);
Module/*?*/ module = this.InternedIdToModuleMap.Find(internedModuleId);
if (module == null && referringModule != null) {
this.metadataReaderHost.ResolvingModuleReference(referringModule, moduleIdentity);
module = this.InternedIdToModuleMap.Find(internedModuleId);
}
return module;
}
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:18,代码来源:ModuleReadWriteFactory.cs
示例15: FindModule
/// <summary>
/// Finds the module that matches the given identifier among the already loaded set of modules,
/// or a dummy module if no matching module can be found.
/// </summary>
public IModule FindModule(ModuleIdentity moduleIdentity) {
IUnit/*?*/ unit;
lock (GlobalLock.LockingObject) {
this.unitCache.TryGetValue(moduleIdentity, out unit);
}
IModule/*?*/ result = unit as IModule;
if (result != null)
return result;
return Dummy.Module;
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:14,代码来源:Core.cs
示例16: FindModule
/// <summary>
/// Returns the module corresponding to passed moduleIdentifier if it was loaded.
/// </summary>
/// <param name="moduleIdentity"></param>
/// <returns></returns>
public IModule/*?*/ FindModule(ModuleIdentity moduleIdentity) {
return this.LookupModule(null, moduleIdentity);
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:8,代码来源:ModuleReadWriteFactory.cs
示例17: LoadModule
/// <summary>
/// The module that matches the given reference, or a dummy module if no matching module can be found.
/// </summary>
public virtual IModule LoadModule(ModuleIdentity moduleIdentity) {
if (moduleIdentity.Location == null) return Dummy.Module;
IUnit/*?*/ unit;
lock (GlobalLock.LockingObject) {
this.unitCache.TryGetValue(moduleIdentity, out unit);
}
if (unit == null) {
if (moduleIdentity.Location == "" || moduleIdentity.Location == "unknown://location") {
unit = Dummy.Module;
this.unitCache.Add(moduleIdentity, unit);
} else
unit = this.LoadUnitFrom(moduleIdentity.Location);
}
IModule/*?*/ result = unit as IModule;
if (result == null) result = Dummy.Module;
return result;
}
开发者ID:modulexcite,项目名称:IL2JS,代码行数:20,代码来源:Core.cs
示例18: ModuleOpened
public void ModuleOpened(IModule module, ModuleIdentity moduleIdentity, uint size)
{
ModuleOpened(module.Name.Value, moduleIdentity == null ? "" : moduleIdentity.Location, module.GetHashCode(), (int) size);
}
开发者ID:xornand,项目名称:cci,代码行数:4,代码来源:CCIEventSource.cs
注:本文中的Microsoft.Cci.ModuleIdentity类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论