Exemplo n.º 1
0
        public T4TemplateKind GetTemplateKind(IProjectFile file)
        {
            var    properties = file?.Properties as ProjectFileProperties;
            string customTool = properties?.CustomTool;

            return(T4TemplateManagerConstants.ToTemplateKind(customTool));
        }
Exemplo n.º 2
0
        private bool IsActionResult(
            [NotNull] IProjectFile generated,
            [NotNull] IProjectFile source,
            T4TemplateKind kind
            )
        {
            if (!(source.Properties is ProjectFileProperties sourceProperties))
            {
                return(false);
            }
            var templateKind = T4TemplateManagerConstants.ToTemplateKind(sourceProperties.CustomTool);

            if (templateKind != kind)
            {
                return(false);
            }
            if (sourceProperties.CustomToolOutput != generated.Name)
            {
                return(false);
            }
            if (!IsGeneratedFrom(generated, source))
            {
                return(false);
            }
            return(true);
        }