本文整理汇总了C#中IAssemblyDefinition.GetPublicKeyToken方法的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyDefinition.GetPublicKeyToken方法的具体用法?C# IAssemblyDefinition.GetPublicKeyToken怎么用?C# IAssemblyDefinition.GetPublicKeyToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAssemblyDefinition
的用法示例。
在下文中一共展示了IAssemblyDefinition.GetPublicKeyToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsFriendAssemblyTo
public bool IsFriendAssemblyTo (IAssemblyDefinition assembly)
{
if (internals_visible_to == null)
return false;
AssemblyName is_visible = null;
if (internals_visible_to_cache == null) {
internals_visible_to_cache = new Dictionary<IAssemblyDefinition, AssemblyName> ();
} else {
if (internals_visible_to_cache.TryGetValue (assembly, out is_visible))
return is_visible != null;
}
var token = assembly.GetPublicKeyToken ();
if (token != null && token.Length == 0)
token = null;
foreach (var internals in internals_visible_to) {
if (internals.Name != assembly.Name)
continue;
if (token == null && assembly is AssemblyDefinition) {
is_visible = internals;
break;
}
if (!ArrayComparer.IsEqual (token, internals.GetPublicKeyToken ()))
continue;
is_visible = internals;
break;
}
internals_visible_to_cache.Add (assembly, is_visible);
return is_visible != null;
}