private object CreateProjectTemplateViewModels(IProjectElement template)
        {
            if (template is GalleryProjectSample)
            {
                return(new SampleTemplateViewModel(template as GalleryProjectSample));
            }

            return(new ProjectTemplateViewModel(template as ProjectTemplate));
        }
Esempio n. 2
0
        public bool Check(IProjectElement template)
        {
            if (string.IsNullOrEmpty(_filterName))
            {
                return(true);
            }

            return(template != null && template.Name.Contains(_filterName));
        }
        public static bool IsProjectReferencingNancy([CanBeNull] this IProjectElement projectElement)
        {
            AssemblyNameInfo referencedAssembly;

            if (!ReferencedAssembliesService.IsProjectReferencingAssemblyByName(projectElement, NancyAssemblyName, out referencedAssembly))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
        public bool Check(IProjectElement template)
        {
            var indexed = template as IProjectElementIndexed;

            if (indexed == null)
            {
                return(true);
            }

            return(indexed.Index >= (_pageNumber - 1) * _pageSize && indexed.Index < _pageNumber * _pageSize);
        }
        public IDictionary<string, List<Violation>> GetViolations(IProjectElement project, ISourceCode sourceCode)
        {
            var styleCopProject = new CodeProject(
                project.FullName.GetHashCode(), 
                this.GetProjectFolder(project), 
                this.configuration);

            this.violations.Clear();
            this.environment.AddSourceCode(styleCopProject, sourceCode.FilePath, sourceCode);
            this.styleCopConsole.Start(new List<CodeProject> { styleCopProject });
            return new Dictionary<string, List<Violation>>(this.violations);
        }
        public bool Check(IProjectElement template)
        {
            return(true);

            var projectTemplate = template as ProjectTemplate;

            if (projectTemplate == null)
            {
                return(true);
            }
            return(projectTemplate.RequiredFrameworkVersion <= _minVersion);
        }
        public IDictionary <string, List <Violation> > GetViolations(IProjectElement project, ISourceCode sourceCode)
        {
            var styleCopProject = new CodeProject(
                project.FullName.GetHashCode(),
                this.GetProjectFolder(project),
                this.configuration);

            this.violations.Clear();
            this.environment.AddSourceCode(styleCopProject, sourceCode.FilePath, sourceCode);
            this.styleCopConsole.Start(new List <CodeProject> {
                styleCopProject
            });
            return(new Dictionary <string, List <Violation> >(this.violations));
        }
        public static bool IsProjectReferencingAssembly([CanBeNull] this IProjectElement projectElement, AssemblyNameInfo assemblyNameInfo)
        {
            AssemblyNameInfo referencedAssembly;

            return(ReferencedAssembliesService.IsProjectReferencingAssemblyByName(projectElement, assemblyNameInfo, out referencedAssembly));
        }
        public static bool IsProjectReferencingNancyRazorViewEngine([CanBeNull] this IProjectElement projectElement)
        {
            AssemblyNameInfo referencedAssembly;

            return(ReferencedAssembliesService.IsProjectReferencingAssemblyByName(projectElement, NancyRazorAssemblyName, out referencedAssembly));
        }
Esempio n. 10
0
 public void deleteProjectItem(IProjectElement element)
 {
     if (CurrentProject != null && element != null)
     {
         MessageBoxResult result = System.Windows.MessageBox.Show("Do you want to also delete the file(s) from your disk", "Delete Files?", MessageBoxButton.YesNoCancel);
         if (result == MessageBoxResult.Yes)
         {
             CurrentProject.removeTemplateFromProject(element, true);
         }
         else if (result == MessageBoxResult.No)
         {
             CurrentProject.removeTemplateFromProject(element, false);
         }
     }
 }
 private string GetProjectFolder(IProjectElement project)
 {
     return(Path.GetDirectoryName(project.FilePath));
 }
 private string GetProjectFolder(IProjectElement project)
 {
     return Path.GetDirectoryName(project.FilePath);
 }
Esempio n. 13
0
 /// <nodoc/>
 public EvaluationLocation WithFileLineAndElement(string file, int?line, IProjectElement element)
 {
     return(CreateLocationForProject(this.Id, this.EvaluationPass, this.EvaluationPassDescription, file, line, element));
 }
Esempio n. 14
0
 /// <nodoc/>
 public static EvaluationLocation CreateLocationForProject(long?parentId, EvaluationPass evaluationPass, string evaluationDescription, string file,
                                                           int?line, IProjectElement element)
 {
     return(new EvaluationLocation(parentId, evaluationPass, evaluationDescription, file, line, element?.ElementName,
                                   element?.OuterElement, kind: EvaluationLocationKind.Element));
 }
 private static bool IsReferencingNancyRazor(IProjectElement projectFile)
 {
     AssemblyNameInfo nancyAssembly;
     return ReferencedAssembliesService.IsProjectReferencingAssemblyByName(projectFile, NancyViewEnginesRazor, out nancyAssembly);
 }
Esempio n. 16
0
 public bool Check(IProjectElement template)
 {
     return(template != null && template.GroupId == _groupId);
 }