本文整理汇总了C#中IAssemblyName类的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyName类的具体用法?C# IAssemblyName怎么用?C# IAssemblyName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAssemblyName类属于命名空间,在下文中一共展示了IAssemblyName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAssemblyEnum
public static extern int CreateAssemblyEnum(
out IAssemblyEnum ppEnum,
IApplicationContext pAppCtx,
IAssemblyName pName,
uint dwFlags,
int pvReserved
);
示例2: InstallReferenceEnumerator
public InstallReferenceEnumerator(IAssemblyName assemblyName)
{
var hr = FusionImports.CreateInstallReferenceEnum(out refEnum, assemblyName, 0, IntPtr.Zero);
if (hr < 0)
{
Marshal.ThrowExceptionForHR(hr);
}
}
示例3: GetFullName
private String GetFullName(IAssemblyName fusionAsmName)
{
StringBuilder sDisplayName = new StringBuilder(1024);
int iLen = 1024;
int hr = fusionAsmName.GetDisplayName(sDisplayName, ref iLen, (int)AssemblyNameDisplayFlags.ALL);
if (hr < 0) {
Marshal.ThrowExceptionForHR(hr);
}
return sDisplayName.ToString();
}
示例4: ExecuteScriptCommand
public ExecuteScriptCommand(string script,
string[] scriptArgs,
IFileSystem fileSystem,
IScriptExecutor scriptExecutor,
IScriptPackResolver scriptPackResolver,
ILog logger,
IAssemblyName assemblyName)
{
_script = script;
ScriptArgs = scriptArgs;
_fileSystem = fileSystem;
_scriptExecutor = scriptExecutor;
_scriptPackResolver = scriptPackResolver;
_logger = logger;
_assemblyName = assemblyName;
}
示例5: ExecuteReplCommand
public ExecuteReplCommand(
IFileSystem fileSystem,
IScriptPackResolver scriptPackResolver,
IScriptEngine scriptEngine,
IFilePreProcessor filePreProcessor,
ILog logger,
IConsole console,
IAssemblyName assemblyName
)
{
_fileSystem = fileSystem;
_scriptPackResolver = scriptPackResolver;
_scriptEngine = scriptEngine;
_filePreProcessor = filePreProcessor;
_logger = logger;
_console = console;
_assemblyName = assemblyName;
}
示例6: GetDisplayName
private static string GetDisplayName(IAssemblyName native)
{
int bufferSize = 1024;
StringBuilder buffer = new StringBuilder(bufferSize);
AssemblyDisplayFlags dwDisplayFlags = AssemblyDisplayFlags.ProcessorArchitecture |
AssemblyDisplayFlags.PublicKeyToken |
AssemblyDisplayFlags.LanguageId |
AssemblyDisplayFlags.Culture |
AssemblyDisplayFlags.Version;
if (NativeMethods.SUCCESS == native.GetDisplayName(buffer, ref bufferSize, dwDisplayFlags))
{
return buffer.ToString();
}
return null;
}
示例7: AssemblyDescription
/// <summary>
/// Initializes a new instance of the <see cref="AssemblyDescription"/> class.
/// </summary>
/// <param name="assemblyName">Name of the assembly.</param>
public AssemblyDescription(IAssemblyName assemblyName)
{
// Get the qualified name.
var stringBuilder = new StringBuilder(10000);
var iLen = 10000;
var hr = assemblyName.GetDisplayName(stringBuilder, ref iLen, ASM_DISPLAY_FLAGS.ASM_DISPLAYF_VERSION
| ASM_DISPLAY_FLAGS.ASM_DISPLAYF_CULTURE
| ASM_DISPLAY_FLAGS.ASM_DISPLAYF_PUBLIC_KEY_TOKEN
| ASM_DISPLAY_FLAGS.ASM_DISPLAYF_PROCESSORARCHITECTURE);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
var displayName = stringBuilder.ToString();
// Load properties from the display name.
LoadPropertiesFromDisplayName(displayName);
// We have the assembly name, so we can use the optimised version to load the fusion properties.
lazyFusionProperties = new Lazy<AssemblyFusionProperties>(DoLoadFusionProperties);
lazyReflectionProperties = new Lazy<AssemblyReflectionProperties>(DoLoadReflectionProperties);
}
示例8: ToAssemblyName
public static AssemblyName ToAssemblyName(IAssemblyName native)
{
string displayName = GetDisplayName(native);
using (AssemblyCache cache = new AssemblyCache())
{
// according to MSKB, this is a SUPPORTED method, therefore we can use the obtained path
// in the ASSEMBLY_INFO struct to generate a fully-populated AssemblyName object.
// see: http://support.microsoft.com/kb/317540
string path = cache.QueryAssemblyPath(displayName);
if (path != null)
{
return AssemblyName.GetAssemblyName(path);
}
}
return new AssemblyName(displayName);
}
示例9: ScriptServiceRoot
public ScriptServiceRoot(
IFileSystem fileSystem,
IPackageAssemblyResolver packageAssemblyResolver,
IScriptExecutor executor,
IScriptEngine engine,
IFilePreProcessor filePreProcessor,
IScriptPackResolver scriptPackResolver,
IPackageInstaller packageInstaller,
ILog logger,
IAssemblyName assemblyName,
IConsole console = null)
{
FileSystem = fileSystem;
PackageAssemblyResolver = packageAssemblyResolver;
Executor = executor;
Engine = engine;
FilePreProcessor = filePreProcessor;
ScriptPackResolver = scriptPackResolver;
PackageInstaller = packageInstaller;
Logger = logger;
Console = console;
AssemblyName = assemblyName;
}
示例10: CreateAssemblyEnum
private static extern void CreateAssemblyEnum(out IAssemblyEnum pEnum, IntPtr pUnkReserved, IAssemblyName pName,
ASM_CACHE_FLAGS dwFlags, IntPtr pvReserved);
示例11: GetNextAssembly
/// <summary>
/// Get the next assembly name in the current enumerator or fail
/// </summary>
/// <param name="enumerator"></param>
/// <param name="name"></param>
/// <returns>0 if the enumeration is not at its end</returns>
public static int GetNextAssembly(IAssemblyEnum enumerator, out IAssemblyName name)
{
return enumerator.GetNextAssembly((IntPtr) 0, out name, 0);
}
示例12: CreateAssemblyNameObject
private static extern int CreateAssemblyNameObject(out IAssemblyName ppName, string szAssemblyName, uint dwFlags, int pvReserved);
示例13: GetShortProperty
internal UInt16 GetShortProperty(IAssemblyName name, ASM_NAME propertyName)
{
uint bufferSize = 512;
IntPtr buffer = Marshal.AllocHGlobal((int)bufferSize);
name.GetProperty(propertyName, buffer, ref bufferSize);
byte low = Marshal.ReadByte(buffer);
byte high = Marshal.ReadByte(buffer, 1);
Marshal.FreeHGlobal(buffer);
return (UInt16)(low + (high << 8));
}
示例14: GetByteArrayProperty
internal byte[] GetByteArrayProperty(IAssemblyName name, ASM_NAME propertyName)
{
uint bufferSize = 512;
IntPtr buffer = Marshal.AllocHGlobal((int)bufferSize);
name.GetProperty(propertyName, buffer, ref bufferSize);
byte[] result = new byte[bufferSize];
for (int i = 0; i < bufferSize; i++)
result[i] = Marshal.ReadByte(buffer, i);
Marshal.FreeHGlobal(buffer);
return result;
}
示例15: CreateAssemblyNameObject
internal static extern int CreateAssemblyNameObject(out IAssemblyName ppEnum, String szAssemblyName, uint dwFlags, IntPtr pvReserved);