本文整理汇总了C#中System.Reflection.Assembly.GetSafeLock方法的典型用法代码示例。如果您正苦于以下问题:C# Assembly.GetSafeLock方法的具体用法?C# Assembly.GetSafeLock怎么用?C# Assembly.GetSafeLock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Assembly
的用法示例。
在下文中一共展示了Assembly.GetSafeLock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WireupDependencies
private static void WireupDependencies(Assembly asm)
{
// The stacks are used to avoid cycles among the dependency declarations.
if (!IsAssemblyWired(asm) && !__assemblies.Contains(asm))
{
__assemblies.Push(asm);
try
{
// Assemblies may have dependencies declared.
foreach (WireupDependencyAttribute d in asm.GetCustomAttributes(typeof(WireupDependencyAttribute), false))
{
Type t = d.ReliantType;
WireupDependencies(t.Assembly);
if (typeof(IWireupCommand).IsAssignableFrom(t) && !__types.Contains(t))
InvokeWireupCommand(t);
}
// Execute the wireup commands declared for the assembly...
foreach (WireupAttribute w in asm.GetCustomAttributes(typeof(WireupAttribute), false))
{
Type t = w.CommandType;
if (!__types.Contains(t))
InvokeWireupCommand(t);
}
if (!IsAssemblyWired(asm))
__asmTracking.Add(asm.GetSafeLock(), null);
}
finally
{
__assemblies.Pop();
}
}
}
示例2: IsAssemblyWired
private static bool IsAssemblyWired(Assembly asm)
{
return __asmTracking.ContainsKey(asm.GetSafeLock());
}