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>();
        }
Ejemplo n.º 4
0
        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));
            }
        }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
        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;
            }
        }
Ejemplo n.º 7
0
        public static bool IsSystem(Type type)
        {
            if (!type.IsConcreteTypeOf<ISystem>())
            {
                return false;
            }

            try
            {
                return type.IsConcreteWithDefaultCtor();
            }
            catch(Exception)
            {
                return false;
            }
        }
Ejemplo n.º 8
0
 public static bool IsValidationRegistration(Type type)
 {
     return type.IsConcreteWithDefaultCtor() && type.CanBeCastTo<IValidationRegistration>();
 }
 public static bool IsAccessorRule(Type type)
 {
     return type.IsConcreteWithDefaultCtor() && type.CanBeCastTo<IAccessorRulesRegistration>();
 }
Ejemplo n.º 10
0
 public static bool IsSystemTypeCandidate(Type type)
 {
     return type.CanBeCastTo<ISystem>() && type.IsConcreteWithDefaultCtor() &&
            !type.IsOpenGeneric();
 }
Ejemplo n.º 11
0
        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;
        }