本文整理汇总了C#中System.Reflection.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Reflection.GetName方法的具体用法?C# Reflection.GetName怎么用?C# Reflection.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection
的用法示例。
在下文中一共展示了Reflection.GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportAssembly
public AssemblyNameReference ImportAssembly (SR.Assembly asm)
{
AssemblyNameReference asmRef = GetAssemblyNameReference (asm.GetName ());
if (asmRef != null)
return asmRef;
SR.AssemblyName asmName = asm.GetName ();
asmRef = new AssemblyNameReference (
asmName.Name, asmName.CultureInfo.Name, asmName.Version);
asmRef.PublicKeyToken = asmName.GetPublicKeyToken ();
asmRef.HashAlgorithm = (AssemblyHashAlgorithm) asmName.HashAlgorithm;
asmRef.Culture = asmName.CultureInfo.ToString ();
m_module.AssemblyReferences.Add (asmRef);
return asmRef;
}
示例2: ImportAssembly
public AssemblyNameReference ImportAssembly (SR.Assembly asm)
{
ImportCache ();
AssemblyNameReference asmRef = (AssemblyNameReference) m_asmCache [asm.FullName];
if (asmRef != null)
return asmRef;
SR.AssemblyName asmName = asm.GetName ();
asmRef = new AssemblyNameReference (
asmName.Name, asmName.CultureInfo.Name, asmName.Version);
asmRef.PublicKeyToken = asmName.GetPublicKeyToken ();
asmRef.HashAlgorithm = (Mono.Cecil.AssemblyHashAlgorithm) asmName.HashAlgorithm;
asmRef.Culture = asmName.CultureInfo.ToString ();
asmRef.Flags = (Mono.Cecil.AssemblyFlags) asmName.Flags;
m_module.AssemblyReferences.Add (asmRef);
m_asmCache [asm.FullName] = asmRef;
return asmRef;
}
示例3: ImportScope
AssemblyNameReference ImportScope (SR.Assembly assembly)
{
AssemblyNameReference scope;
#if !SILVERLIGHT
var name = assembly.GetName ();
if (TryGetAssemblyNameReference (name, out scope))
return scope;
scope = new AssemblyNameReference (name.Name, name.Version) {
Culture = name.CultureInfo.Name,
PublicKeyToken = name.GetPublicKeyToken (),
HashAlgorithm = (AssemblyHashAlgorithm) name.HashAlgorithm,
};
module.AssemblyReferences.Add (scope);
return scope;
#else
var name = AssemblyNameReference.Parse (assembly.FullName);
if (TryGetAssemblyNameReference (name, out scope))
return scope;
module.AssemblyReferences.Add (name);
return name;
#endif
}