本文整理汇总了C#中IAssemblyName.GetVersion方法的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyName.GetVersion方法的具体用法?C# IAssemblyName.GetVersion怎么用?C# IAssemblyName.GetVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAssemblyName
的用法示例。
在下文中一共展示了IAssemblyName.GetVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVersion
internal static unsafe Version GetVersion(IAssemblyName nameObject)
{
uint hi, lo;
int hr = nameObject.GetVersion(out hi, out lo);
if (hr != 0)
{
Debug.Assert(hr == FUSION_E_INVALID_NAME);
return null;
}
return new Version((int)(hi >> 16), (int)(hi & 0xffff), (int)(lo >> 16), (int)(lo & 0xffff));
}
示例2: GetVersion
/// <summary>
/// Gets the version.
/// </summary>
/// <param name="name">The name.</param>
/// <returns></returns>
public static Version GetVersion(IAssemblyName name)
{
uint major;
uint minor;
name.GetVersion(out major, out minor);
return new Version((int) major >> 16, (int) major & 0xFFFF, (int) minor >> 16, (int) minor & 0xFFFF);
}
示例3: GetVersion
private static Version GetVersion(IAssemblyName name)
{
uint majorOut;
uint minorOut;
name.GetVersion(out majorOut, out minorOut);
int major = (int)majorOut >> 16;
int minor = (int)majorOut & 0xFFFF;
int build = (int)minorOut >> 16;
int revision = (int)minorOut & 0xFFFF;
if(major < 0)
{
major = major * -1;
}
if(minor < 0)
{
minor = minor * -1;
}
if(build < 0)
{
build = build * -1;
}
if(revision < 0)
{
revision = revision * -1;
}
return new Version(major, minor, build, revision);
}