本文整理汇总了C#中IAssemblyReference.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyReference.ToString方法的具体用法?C# IAssemblyReference.ToString怎么用?C# IAssemblyReference.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAssemblyReference
的用法示例。
在下文中一共展示了IAssemblyReference.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Resolve
public IAssembly Resolve(IAssemblyReference value, string localPath)
{
foreach (IAssembly ia in _assemblyManager.Assemblies)
{
if (ia.CompareTo(value) == 0)
return ia;
}
string assemblyString = value.ToString();
Assembly assembly = null;
try
{
assembly = AssemblyUtils.ResolveAssemblyFile(assemblyString, localPath);
if (assembly == null)
{
assembly = AssemblyUtils.LoadAssembly(assemblyString);
}
}
catch
{
}
if (assembly != null)
{
IAssembly ia = _assemblyManager.LoadFile(assembly.Location);
return ia;
}
return null;
}
示例2: FindMatchingAssemblyReference
public static AssemblyNameReference FindMatchingAssemblyReference(AssemblyDefinition adef, IAssemblyReference anref)
{
return adef.MainModule.AssemblyReferences.FirstOrDefault(item => item.ToString() == anref.ToString());
}
示例3: WriteAssemblyReference
public void WriteAssemblyReference(IAssemblyReference value)
{
this.formatter.Write("// Assembly Reference");
this.formatter.Write(" ");
this.formatter.WriteDeclaration(value.Name);
this.formatter.WriteLine();
this.formatter.WriteProperty("Version", value.Version.ToString());
this.formatter.WriteProperty("Name", value.ToString());
}
示例4: GetAssemblyNameReference
public AssemblyNameReference GetAssemblyNameReference(IAssemblyReference item)
{
//fix: use toString() instead of object himself (getHashcode seems to be overriden)
AssemblyNameReference result;
var key = item.ToString();
if (_assemblynamereferencecache.TryGetValue(key, out result))
return result;
result = ReflectorHelper.FindMatchingAssemblyReference(AssemblyDefinition, item);
if (result == null)
return null;
_assemblynamereferencecache.Add(key, result);
return result;
}
示例5: WriteDeclaringAssembly
private void WriteDeclaringAssembly(IAssemblyReference value, IFormatter formatter)
{
if (value != null)
{
string text = ((value.Name != null) && (value.Version != null)) ? (value.Name + ", Version=" + value.Version.ToString()) : value.ToString();
formatter.WriteProperty("Assembly", text);
}
}