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


C# Assembly.Types方法代码示例

本文整理汇总了C#中System.Reflection.Assembly.Types方法的典型用法代码示例。如果您正苦于以下问题:C# Assembly.Types方法的具体用法?C# Assembly.Types怎么用?C# Assembly.Types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Reflection.Assembly的用法示例。


在下文中一共展示了Assembly.Types方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ListExtensions

 //static void Main()
 //{
 //    Console.WriteLine( AssemblyInfoWriter.ListExtensions( Assembly.GetAssembly( typeof(Flags) ) ) );
 //}
 public static string ListExtensions( Assembly assembly )
 {
     var sb = new StringBuilder();
     sb.AppendFormat( "=== Extension methods (all):{0}", Environment.NewLine );
     IList<Type> types = assembly.Types( Flags.PartialNameMatch, "Extensions" );
     types.ForEach( t => Write( sb, t, t.Methods( Flags.Static | Flags.Public ).OrderBy( m => m.Name ).ToList() ) );
     return sb.ToString();
 }
开发者ID:nintorii,项目名称:Zenject,代码行数:12,代码来源:AssemblyInfoWriter.cs

示例2: ListExtensionMethodsWithSuperfluousOverloads

 public static string ListExtensionMethodsWithSuperfluousOverloads( Assembly assembly )
 {
     var sb = new StringBuilder();
     sb.AppendFormat( "=== Extension methods that are superfluous:{0}", Environment.NewLine );
     IList<Type> types = assembly.Types( Flags.PartialNameMatch, "Extensions" );
     types.ForEach( t => Write( sb, t, t.Methods( Flags.Static | Flags.Public )
                                       	.OrderBy( m => m.Name )
                                       	.Where( m => IsSuperfluous( m, t.Methods( Flags.Static | Flags.Public, m.Name ) ) )
                                       	.ToList() ) );
     return sb.ToString();
 }
开发者ID:nintorii,项目名称:Zenject,代码行数:11,代码来源:AssemblyInfoWriter.cs

示例3: ListExtensionMethodsWhereParametersViolateConventions

 public static string ListExtensionMethodsWhereParametersViolateConventions( Assembly assembly )
 {
     var sb = new StringBuilder();
     sb.AppendFormat( "=== Extension methods with naming violations:{0}", Environment.NewLine );
     IList<Type> types = assembly.Types( Flags.PartialNameMatch, "Extensions" );
     types.ForEach( t => Write( sb, t, t.Methods( Flags.Static | Flags.Public )
                                       	.OrderBy( m => m.Name )
                                       	.Where(
                                       		m => IsParameterViolation( typeof(Flags), "bindingFlags", true, m.Parameters() ) )
                                       	.ToList() ) );
     return sb.ToString();
 }
开发者ID:nintorii,项目名称:Zenject,代码行数:12,代码来源:AssemblyInfoWriter.cs

示例4: Setup

 /// <summary>
 /// Scans the assembly for mapping modules and creates them
 /// </summary>
 /// <param name="ModuleAssembly"></param>
 public void Setup(Assembly ModuleAssembly)
 {
     IEnumerable<Type> Modules = ModuleAssembly.Types(typeof(IModule));
     List<IModule> TempModules = new List<IModule>();
     foreach (Type Module in Modules)
     {
         if (!Module.IsInterface && !Module.IsAbstract)
             TempModules.Add((IModule)Module.Assembly.CreateInstance(Module.FullName));
     }
     foreach (IModule Module in TempModules)
     {
         Module.Manager = this;
         Module.Setup();
     }
     this.Modules.Add(TempModules);
 }
开发者ID:kaytie,项目名称:Craig-s-Utility-Library,代码行数:20,代码来源:MappingManager.cs

示例5: From

 /// <summary>
 /// Returns a <see cref="TypeSelector"/> for selecting the types that are visible outside the
 /// specified <paramref name="assembly"/>.
 /// </summary>
 /// <param name="assembly">The assembly from which to select the types.</param>
 public static TypeSelector From(Assembly assembly)
 {
     return assembly.Types();
 }
开发者ID:9swampy,项目名称:fluentassertions,代码行数:9,代码来源:AllTypes.cs

示例6: Setup

 /// <summary>
 /// Sets up the mappings
 /// </summary>
 /// <param name="AssemblyUsing">Assembly using</param>
 private void Setup(Assembly AssemblyUsing)
 {
     if (Mappings == null)
         Mappings = new ListMapping<Type, IMapping>();
     IEnumerable<Type> Types = AssemblyUsing.Types(typeof(IMapping));
     foreach (Type Type in Types)
     {
         Type BaseType = Type.BaseType;
         IMapping TempObject = (IMapping)AssemblyUsing.CreateInstance(Type.FullName);
         TempObject.Manager = this;
         Mappings.Add(BaseType.GetGenericArguments()[0], TempObject);
     }
 }
开发者ID:kaytie,项目名称:Craig-s-Utility-Library,代码行数:17,代码来源:MappingManager.cs


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