Ejemplo n.º 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))));
 }
Ejemplo n.º 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)))));
 }
Ejemplo n.º 3
0
 public static Assembly GetAssembly(string name) => ReflectionExtensions.GetLoadedAssemblies().FirstOrDefault <Assembly>((Func <Assembly, bool>)(i => i.FullName.StartsWith(name)));
Ejemplo n.º 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>();
Ejemplo n.º 5
0
 public static IEnumerable <Assembly> GetLoadedAssemblies(string prefix) => ReflectionExtensions.GetLoadedAssemblies().Where <Assembly>((Func <Assembly, bool>)(a => a.FullName.StartsWith(prefix)));
Ejemplo n.º 6
0
 public static IEnumerable <Assembly> GetProjectLoadedAssemblies(
     string projectNamespacePrefix)
 {
     return(ReflectionExtensions.GetLoadedAssemblies(projectNamespacePrefix));
 }