예제 #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));
 }