本文整理汇总了C#中System.Reflection.Assembly.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Assembly.Equals方法的具体用法?C# Assembly.Equals怎么用?C# Assembly.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Assembly
的用法示例。
在下文中一共展示了Assembly.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCallingAssembly
private void SetCallingAssembly(Assembly assembly)
{
if (!assembly.Equals(Assembly.GetExecutingAssembly()))
{
_callingAssembly = assembly;
}
}
示例2: LoadModule
/// <summary>
/// Load module from an assembly
/// </summary>
/// <param name="moduleAssembly">Assembly that contains module that you want to load</param>
public EssModule LoadModule( Assembly moduleAssembly )
{
Preconditions.NotNull( moduleAssembly, "ModuleAssembly cannot be null" );
// Prevents to load uEssentials dll accidently
if ( moduleAssembly.Equals( typeof(EssCore).Assembly ) )
return null;
EssModule moduleInstance = null;
foreach ( var type in moduleAssembly.GetTypes() )
{
if ( !type.IsSubclassOf( typeof (EssModule) ) ) continue;
moduleInstance = (EssModule) Activator.CreateInstance( type );
moduleInstance.Assembly = moduleAssembly;
}
Preconditions.NotNull( moduleInstance, "Could load module from assembly " +
moduleAssembly.FullName +
$" because it does not contains any class that extends '{typeof (EssModule)}" );
LoadModule( moduleInstance );
return moduleInstance;
}
示例3: IsEntryAssembly
internal virtual bool IsEntryAssembly(Assembly assembly)
{
return assembly.Equals(Assembly.GetEntryAssembly());
}
示例4: IsInheritable
public static bool IsInheritable(Assembly assembly, FieldInfo member)
{
if (member == null)
return false;
if (member.IsPublic)
return true;
if (!member.IsPrivate && assembly.Equals(member.DeclaringType.Assembly))
return true;
return false;
}
示例5: FindAssemblyTreeNode
internal static AssemblyTreeNode FindAssemblyTreeNode(Assembly assy)
{
foreach (TreeNode node in _assyRootNode.LogicalNodes) {
if (node is AssemblyTreeNode) {
AssemblyTreeNode atNode = (AssemblyTreeNode)node;
if (assy.Equals(atNode.Assembly))
return atNode;
}
}
return null;
}