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


C# ProjectType.ToString方法代码示例

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


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

示例1: CreateProjectFile

        public static string CreateProjectFile(BootstrappedProject project, ProjectType projectType, IEnumerable<ProjectReferenceData> references = null, bool isSelfHost = false)
        {
            var includes = CrawlFoldersForIncludes(project.ProjectRoot);
            var compileIncludesText = string.Join("", includes.Compile.ToArray());

            var contentIncludesText = "";
            var referencesText = "";

            var selfHostReferences = isSelfHost ? Environment.NewLine + @"    <Reference Include=""System.ServiceProcess"" />" : "";
            var queueConfigurationReferences = isSelfHost ? Environment.NewLine + @"    <Reference Include=""System.Configuration"" />" : "";

            if (references != null)
            {
                var projectReferences = references.Select(CreateProjectReference);
                referencesText = Environment.NewLine + "<ItemGroup>" + string.Join("", projectReferences.ToArray()) + Environment.NewLine + "</ItemGroup>";
            }

            if (includes.Content.Any())
            {
                contentIncludesText = Environment.NewLine + "<ItemGroup>" + string.Join("", includes.Content.ToArray()) + Environment.NewLine + "</ItemGroup>";
            }

            var projectFileContent =
                ClassLibraryProject
                    .Replace("{{projectGuid}}", project.ProjectGuid.ToString())
                    .Replace("{{outputType}}", projectType.ToString())
                    .Replace("{{assemblyName}}", project.ProjectName)
                    .Replace("{{compileIncludes}}", compileIncludesText)
                    .Replace("{{contentIncludes}}", contentIncludesText)
                    .Replace("{{queueConfigurationReferences}}", queueConfigurationReferences)
                    .Replace("{{selfHostReferences}}", selfHostReferences)
                    .Replace("{{referenceIncludes}}", referencesText);

            return projectFileContent;
        }
开发者ID:ParticularLabs,项目名称:NServiceBus.Launchpad,代码行数:35,代码来源:ProjectFileTemplator.cs

示例2: GetProjectItems

        /// <summary>
        /// Gets the project items.
        /// </summary>
        /// <param name="frameworkType">Type of the framework.</param>
        /// <param name="projectType">Type of the project.</param>
        /// <returns>A list of TextTemplateInfos.</returns>
        protected IEnumerable<TextTemplateInfo> GetProjectItems(
            FrameworkType frameworkType,
            ProjectType projectType)
        {
            string uri = string.Empty;

            switch (frameworkType)
            {
                case FrameworkType.NoFramework:
                    uri = this.SettingsService.NoFrameworkProjectsUri;
                    break;

                case FrameworkType.MvvmCross:
                    uri = this.SettingsService.MvvmCrossProjectsUri;
                    break;

                case FrameworkType.XamarinForms:
                    uri = this.SettingsService.XamarinFormsProjectsUri;
                    break;

                case FrameworkType.MvvmCrossAndXamarinForms:
                    uri = this.SettingsService.MvvmCrossAndXamarinFormsProjectsUri;
                    break;
            }

            if (uri != string.Empty)
            {
                IEnumerable<ProjectTemplateInfo> projectTemplateInfos = this.GetPojectTemplateInfos(uri);

                ProjectTemplateInfo projectTemplateInfo = projectTemplateInfos.FirstOrDefault(x => x.Name == projectType.ToString());

                if (projectTemplateInfo != null)
                {
                    return projectTemplateInfo.ItemTemplates;
                }
            }

            return new List<TextTemplateInfo>();
        }
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:45,代码来源:BaseProjectFactory.cs

示例3: burnManager_BurningFailed

 private void burnManager_BurningFailed(BurnResult eBurnResult, ProjectType eProjectType)
 {
     log.Info("BurnEvent: Burning of {0} failed with result: {1}", eProjectType.ToString(), eBurnResult.ToString());
 }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:4,代码来源:EventHelper.cs

示例4: GetProjectTypeGuid

        public string GetProjectTypeGuid(ProjectType en)
        {
            Type type = en.GetType();

            MemberInfo[] memInfo = type.GetMember(en.ToString());

            if (memInfo != null && memInfo.Length > 0)
            {
                object[] attrs = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);

                if (attrs != null && attrs.Length > 0)
                {
                    return ((DescriptionAttribute)attrs[0]).Description;
                }
            }

            return en.ToString();
        }
开发者ID:mario-loza,项目名称:FullStack,代码行数:18,代码来源:MasterTemplate.cs

示例5: SelectableProjectType

 public SelectableProjectType(ProjectType projectType, bool isSelected = false)
 {
     ProjectType = projectType;
     Name = projectType.ToString().Replace("_", ".");
     IsSelected = isSelected;
 }
开发者ID:GeertvanHorrik,项目名称:Caitlyn,代码行数:6,代码来源:SelectableProjectType.cs

示例6: CheckRequiredSpaceForPath

        private bool CheckRequiredSpaceForPath(ProjectType aProjectType, string fullPathname)
        {
            int availableSpace = MediaTypeSupport.GetMaxMediaSizeMbByProjectType(aProjectType, CurrentDrive);
              int neededSpace = GetTotalMbForPath(fullPathname);

              log.Debug(
            "BurnManager: Project {0} of {1} needs a media with an estimated size of at least {2} MB - available: {3} MB",
            aProjectType.ToString(), fullPathname, Convert.ToString(neededSpace), Convert.ToString(availableSpace));
              return (availableSpace >= neededSpace);
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:10,代码来源:BurnManager.cs


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