コード例 #1
0
 public static Decimal AdjustAndGetSumOfValuesBaseOnConfig <TModel, TConfig>(
     TModel model,
     TConfig config)
 {
     return(((IEnumerable <PropertyInfo>)config.GetType().GetProperties()).Sum <PropertyInfo>((Func <PropertyInfo, Decimal>)(configProperty => ReflectionExtensions.GetValueFromConfigProperty <TModel, TConfig>(model, config, configProperty))));
 }
コード例 #2
0
 public static IEnumerable <Type> GetAllImplementTypesOfGeneric(
     this Type type,
     string projectNamespacePrefix)
 {
     return(ReflectionExtensions.GetProjectLoadedAssemblies(projectNamespacePrefix).SelectMany <Assembly, Type>((Func <Assembly, IEnumerable <Type> >)(s => (IEnumerable <Type>)s.GetTypes())).Where <Type>((Func <Type, bool>)(t => ((IEnumerable <Type>)t.GetInterfaces()).Any <Type>((Func <Type, bool>)(i => i.IsGenericType && i.GetGenericTypeDefinition() == type)))));
 }
コード例 #3
0
 public static Assembly GetAssembly(string name) => ReflectionExtensions.GetLoadedAssemblies().FirstOrDefault <Assembly>((Func <Assembly, bool>)(i => i.FullName.StartsWith(name)));
コード例 #4
0
 public static List <AssemblyName> GetLoadedAndReferencedAssemblies(string prefix) => ReflectionExtensions.GetLoadedAssemblies().SelectMany <Assembly, AssemblyName>((Func <Assembly, IEnumerable <AssemblyName> >)(i => (IEnumerable <AssemblyName>)i.GetReferencedAssemblies())).Where <AssemblyName>((Func <AssemblyName, bool>)(i => i.FullName.Contains(prefix))).Distinct <AssemblyName>().ToList <AssemblyName>();
コード例 #5
0
 public static IEnumerable <Assembly> GetLoadedAssemblies(string prefix) => ReflectionExtensions.GetLoadedAssemblies().Where <Assembly>((Func <Assembly, bool>)(a => a.FullName.StartsWith(prefix)));
コード例 #6
0
 public static IEnumerable <Assembly> GetProjectLoadedAssemblies(
     string projectNamespacePrefix)
 {
     return(ReflectionExtensions.GetLoadedAssemblies(projectNamespacePrefix));
 }