Пример #1
0
#pragma warning disable 1591 // Xml Comments
        public void Validate(Type type, IProblems problems)
        {
            var implementsInterface = type.HasInterface <ICommand>() && type.GetTypeInfo().BaseType == typeof(Object);

            if (!implementsInterface && type.GetTypeInfo().BaseType != typeof(Command))
            {
                problems.Report(ProblemTypes.CommandInheritance, CommandProblemMetaData.From(type));
            }
        }
Пример #2
0
#pragma warning disable 1591 // Xml Comments
        public void Validate(Type type, IProblems problems)
        {
            if (type == typeof(ICommand) || type == typeof(Command))
            {
                return;
            }

            if (type.GetTypeInfo().GetProperties().Length > 10)
            {
                problems.Report(ProblemTypes.TooManyProperties, CommandProblemMetaData.From(type));
            }
        }