当前位置: 首页>>代码示例>>C#>>正文


C# Project.GetProjectTypes方法代码示例

本文整理汇总了C#中MonoDevelop.Projects.Project.GetProjectTypes方法的典型用法代码示例。如果您正苦于以下问题:C# Project.GetProjectTypes方法的具体用法?C# Project.GetProjectTypes怎么用?C# Project.GetProjectTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoDevelop.Projects.Project的用法示例。


在下文中一共展示了Project.GetProjectTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCategoryPropertyKey

 static string GetCategoryPropertyKey(Project proj)
 {
     string key = "Dialogs.NewFileDialog.LastSelectedCategory";
     if (proj != null) {
         key += "." + proj.GetProjectTypes ().First ();
         var dnp = proj as DotNetProject;
         if (dnp != null)
             key += "." + dnp.LanguageName;
     }
     return key;
 }
开发者ID:brantwedel,项目名称:monodevelop,代码行数:11,代码来源:NewFileDialog.cs

示例2: IsValidForProject

		protected virtual bool IsValidForProject (Project project, string projectPath)
        {
            // When there is no project, only single template files can be created.
            if (project == null) {
                foreach (FileDescriptionTemplate f in files)
                    if (!(f is SingleFileDescriptionTemplate))
                        return false;
            }

            // Filter on templates
            foreach (FileDescriptionTemplate f in files)
                if (!f.SupportsProject (project, projectPath))
                    return false;

            //filter on conditions
            if (project != null) {
				if (!string.IsNullOrEmpty (projecttype) && project.GetProjectTypes ().All (p => p != projecttype))
                    return false;

                foreach (FileTemplateCondition condition in conditions)
                    if (!condition.ShouldEnableFor (project, projectPath))
                        return false;
            }

            return true;
        }
开发者ID:riverans,项目名称:monodevelop,代码行数:26,代码来源:FileTemplate.cs

示例3: ShouldEnableFor

        public override bool ShouldEnableFor(Project proj, string projectPath)
        {
            if (proj == null)
                return !requireExists;

            if (projectType != null && proj.GetProjectTypes ().All (p => p != projectType))
                return false;

            //check for permitted creation paths
            if (permittedCreationPaths != null) {
                bool noMatches = true;
                foreach (string path in permittedCreationPaths) {
                    string matchPath = Path.Combine (proj.BaseDirectory, path);
                    if (Path.GetFullPath (matchPath) == Path.GetFullPath (projectPath))
                        noMatches = false;
                }
                if (noMatches)
                    return false;
            }

            //check for excluded creation paths
            if (excludedCreationPaths != null) {
                bool foundMatch = false;
                foreach (string path in excludedCreationPaths) {
                    string matchPath = Path.Combine (proj.BaseDirectory, path);
                    if (Path.GetFullPath (matchPath) == Path.GetFullPath (projectPath))
                        foundMatch = true;
                }
                if (foundMatch)
                    return false;
            }

            //check for required files
            if (requiredFiles != null) {
                bool requiredFileNotFound = true;
                foreach (string f in requiredFiles) {
                    string requiredFile = (f[0] == '/')?
                          Path.Combine (proj.BaseDirectory, f.Substring(1))
                        : Path.Combine (projectPath, f);
                    if (proj.Files.GetFile (requiredFile) != null)
                        requiredFileNotFound = true;
                }
                if (requiredFileNotFound)
                    return false;
            }

            //check for excluded files
            if (excludedFiles != null) {
                bool foundExcludedFile = false;
                foreach (string f in excludedFiles) {
                    string excludedFile = (f[0] == '/')?
                          Path.Combine (proj.BaseDirectory, f.Substring(1))
                        : Path.Combine (projectPath, f);
                    if (proj.Files.GetFile (excludedFile) != null)
                        foundExcludedFile = true;
                }
                if (foundExcludedFile)
                    return false;
            }

            return true;
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:62,代码来源:ParentProjectFileTemplateCondition.cs


注:本文中的MonoDevelop.Projects.Project.GetProjectTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。