本文整理汇总了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;
}
示例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>();
}
示例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());
}
示例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();
}
示例5: SelectableProjectType
public SelectableProjectType(ProjectType projectType, bool isSelected = false)
{
ProjectType = projectType;
Name = projectType.ToString().Replace("_", ".");
IsSelected = isSelected;
}
示例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);
}