当前位置: 首页>>代码示例>>C#>>正文


C# Assembly.Equals方法代码示例

本文整理汇总了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;
   }
 }
开发者ID:ArturDorochowicz,项目名称:raygun4net,代码行数:7,代码来源:RaygunClient.cs

示例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;
        }
开发者ID:gitter-badger,项目名称:uEssentials,代码行数:30,代码来源:ModuleManager.cs

示例3: IsEntryAssembly

 internal virtual bool IsEntryAssembly(Assembly assembly)
 {
     return assembly.Equals(Assembly.GetEntryAssembly());
 }
开发者ID:akrisiun,项目名称:dotnet-cli,代码行数:4,代码来源:DependencyContextLoader.cs

示例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;
        }
开发者ID:patricknharris,项目名称:njetty,代码行数:12,代码来源:IntrospectionUtil.cs

示例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;
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:11,代码来源:AssemblySupport.cs


注:本文中的System.Reflection.Assembly.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。