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


C# Microsoft.Save方法代码示例

本文整理汇总了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();
            }
        }
开发者ID:LogoFX,项目名称:tools,代码行数:26,代码来源:SolutionWizard.cs

示例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();
            }
        }
开发者ID:LogoFX,项目名称:tools,代码行数:39,代码来源:SolutionWizard.cs

示例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);
        }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:15,代码来源:ProjectUtilities.cs

示例4: Application_MailMergeAfterMerge

 void Application_MailMergeAfterMerge(Microsoft.Office.Interop.Word.Document Doc, Microsoft.Office.Interop.Word.Document DocResult)
 {
     DocResult.Save();
 }
开发者ID:xwiki-contrib,项目名称:xwiki-office,代码行数:4,代码来源:AddinActions.cs


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