本文整理汇总了C#中IAssembly.ToAssemblyRef方法的典型用法代码示例。如果您正苦于以下问题:C# IAssembly.ToAssemblyRef方法的具体用法?C# IAssembly.ToAssemblyRef怎么用?C# IAssembly.ToAssemblyRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAssembly
的用法示例。
在下文中一共展示了IAssembly.ToAssemblyRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarkFailed
public void MarkFailed(IAssembly asm) {
// Use ToAssemblyRef() to prevent storing a reference to an AssemblyDef
var asmKey = asm.ToAssemblyRef();
lock (lockObj) {
if (failedAsms.Count == 0)
lastTime = DateTime.UtcNow;
failedAsms.Add(asmKey);
}
}
示例2: InitType
TypeDef InitType(IAssembly assembly, string ns, string name) {
return typeResolver.ResolveThrow(new TypeRefUser(module, ns, name, assembly.ToAssemblyRef()));
}
示例3: NamespaceReference
/// <summary>
/// Constructor
/// </summary>
/// <param name="assembly">Target assembly</param>
/// <param name="namespace">Namespace</param>
public NamespaceReference(IAssembly assembly, string @namespace) {
if (assembly == null)
throw new ArgumentNullException(nameof(assembly));
Assembly = assembly.ToAssemblyRef();
Namespace = @namespace;
}
示例4: BreakOnLoadAssembly
public void BreakOnLoadAssembly(IAssembly assembly, Action<IDebuggerAssembly> action, AssemblyNameComparerFlags flags) {
if (assembly == null)
throw new ArgumentNullException(nameof(assembly));
assembly = assembly.ToAssemblyRef();// Prevent storing AssemblyDef refs
// Use the LoadModule event since without a module, we won't know the full assembly name
CreateBreakpoint(DebugEventKind.LoadModule, (bp, ctx) => {
var c = (ModuleEventContext)ctx;
var comparer = new AssemblyNameComparer(flags);
var asm = c.Module.Assembly;
if (!comparer.Equals(assembly, new AssemblyNameInfo(asm.FullName)))
return false;
bp.Remove();
action?.Invoke(asm);
return true;
});
}