Ejemplo n.º 1
0
        private void InitCustomValidatorItems(DataRow root)
        {
            DataRow folderRow = null;

            foreach (var node in GetTypeAttributes(_modelType, IsCustomValidator).Select(CreateNode).Where(x => x != null))
            {
                if (folderRow == null)
                {
                    folderRow = AddRow(root, new FolderNode(UserMessages.FolderName_Validator));
                }
                AddRow(folderRow, node);
            }

            bool IsCustomValidator(AttributeData attribute)
            {
                return(Compilation.GetKnownType(KnownTypes.CustomValidatorAttribute).Equals(attribute.AttributeClass));
            }

            Node CreateNode((INamedTypeSymbol Type, AttributeData Attribute) info)
            {
                return(AttributeNode.CreateCustomValidator(this, info));
            }
        }