本文整理汇总了C#中Microsoft.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Save方法的具体用法?C# Microsoft.Save怎么用?C# Microsoft.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft
的用法示例。
在下文中一共展示了Microsoft.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveCondition
private void RemoveCondition(Microsoft.Build.Evaluation.Project buildProject, SolutionDataViewModel solutionData)
{
var allGroups = buildProject.Xml.PropertyGroups;
var toRemove = new List<ProjectPropertyGroupElement>();
if (!solutionData.CreateFakes)
{
toRemove.AddRange(allGroups.Where(x => x.Condition.Contains("Fake")));
}
if (!solutionData.CreateFakes)
{
toRemove.AddRange(allGroups.Where(x => x.Condition.Contains("Tests")));
}
if (toRemove.Count > 0)
{
foreach (var pg in toRemove.Distinct())
{
buildProject.Xml.RemoveChild(pg);
}
buildProject.Save();
}
}
示例2: RemoveSamples
private void RemoveSamples(Microsoft.Build.Evaluation.Project buildProject, SolutionDataViewModel solutionData)
{
var items = buildProject.Items.ToArray();
var toRemove = new List<ProjectItem>();
foreach (var item in items)
{
var name = item.EvaluatedInclude;
var index = name.IndexOf(Path.DirectorySeparatorChar);
if (index < 0)
{
continue;
}
var folder = name.Substring(0, index);
switch (folder)
{
case "Views":
case "ViewModels":
case "Resources":
var itemName = Path.GetFileNameWithoutExtension(name);
if (itemName == "ShellViewModel")
{
var body = CreateEmptyShell(buildProject);
var itemFileName = Path.GetDirectoryName(item.Xml.IncludeLocation.File);
itemFileName = Path.Combine(itemFileName, name);
File.WriteAllText(itemFileName, body);
continue;
}
toRemove.Add(item);
break;
}
}
if (toRemove.Count > 0)
{
buildProject.RemoveItems(toRemove);
buildProject.Save();
}
}
示例3: SetBuildIntegrationInProject
/// <summary>
/// Sets build integration setting in project.
/// </summary>
/// <param name="project">The MSBuild project.</param>
/// <param name="buildIntegration">The build integration setting.</param>
internal static void SetBuildIntegrationInProject(Microsoft.Build.BuildEngine.Project project, BuildIntegration buildIntegration)
{
Param.AssertNotNull(project, "project");
Param.AssertNotNull(buildIntegration, "buildIntegration");
SetBuildIntegrationInProject(project, buildIntegration != BuildIntegration.None);
SetTreatLevel(project, buildIntegration);
project.Save(project.FullFileName);
}
示例4: Application_MailMergeAfterMerge
void Application_MailMergeAfterMerge(Microsoft.Office.Interop.Word.Document Doc, Microsoft.Office.Interop.Word.Document DocResult)
{
DocResult.Save();
}