public static bool IsValidationRegistration(Type type) { // TODO -- No open generics return type.IsConcreteTypeOf<IValidationRegistration>() && type.IsConcreteWithDefaultCtor() && !type.IsOpenGeneric(); }
public static bool IsLoaderTypeCandidate(Type type) { if (!type.IsConcreteWithDefaultCtor()) return false; if (type.Closes(typeof (IApplicationSource<,>))) return true; return type.CanBeCastTo<IApplicationLoader>(); }
public static bool IsLoaderTypeCandidate(Type type) { if (type.IsOpenGeneric()) return false; if (!type.IsConcreteWithDefaultCtor()) return false; if (type.CanBeCastTo<FubuRegistry>()) return true; return type.CanBeCastTo<IApplicationLoader>(); }
public void Process(Type type, Registry registry) { if (type.CanBeCastTo<IValidationRegistration>() && type.IsConcreteWithDefaultCtor()) { var registration = (IValidationRegistration)Activator.CreateInstance(type); _registrations.Add(registration); registration.FieldSources().Each(x => registry.For<IFieldValidationSource>().Add(x)); } }
public PluginFamily Build(Type type) { if (type.Name.EndsWith("Settings") && type.IsConcreteWithDefaultCtor()) { var family = new PluginFamily(type); var instance = buildInstanceForType(type); family.SetDefault(instance); return family; } return null; }
public static bool IsFixture(Type type) { if (!type.IsConcreteTypeOf<IFixture>()) return false; if (type.IsGenericType) return false; if (!type.GetConstructors(BindingFlags.Public | BindingFlags.Instance).Any()) return false; try { return type.IsConcreteWithDefaultCtor(); } catch (Exception) { return false; } }
public static bool IsSystem(Type type) { if (!type.IsConcreteTypeOf<ISystem>()) { return false; } try { return type.IsConcreteWithDefaultCtor(); } catch(Exception) { return false; } }
public static bool IsValidationRegistration(Type type) { return type.IsConcreteWithDefaultCtor() && type.CanBeCastTo<IValidationRegistration>(); }
public static bool IsAccessorRule(Type type) { return type.IsConcreteWithDefaultCtor() && type.CanBeCastTo<IAccessorRulesRegistration>(); }
public static bool IsSystemTypeCandidate(Type type) { return type.CanBeCastTo<ISystem>() && type.IsConcreteWithDefaultCtor() && !type.IsOpenGeneric(); }
public static bool IsFixtureType(Type type) { if (!type.CanBeCastTo<Fixture>()) return false; if (type.HasAttribute<HiddenAttribute>()) return false; if (!type.IsConcreteWithDefaultCtor()) return false; if (type.IsOpenGeneric()) return false; return true; }