本文整理汇总了C#中Solution.WriteConfigurationData方法的典型用法代码示例。如果您正苦于以下问题:C# Solution.WriteConfigurationData方法的具体用法?C# Solution.WriteConfigurationData怎么用?C# Solution.WriteConfigurationData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solution
的用法示例。
在下文中一共展示了Solution.WriteConfigurationData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteFileInternal
internal void WriteFileInternal (SlnFile sln, Solution solution, ProgressMonitor monitor)
{
SolutionFolder c = solution.RootFolder;
// Delete data for projects that have been removed from the solution
var currentProjects = new HashSet<string> (solution.GetAllItems<SolutionFolderItem> ().Select (it => it.ItemId));
var removedProjects = new HashSet<string> ();
if (solution.LoadedProjects != null)
removedProjects.UnionWith (solution.LoadedProjects.Except (currentProjects));
var unknownProjects = new HashSet<string> (sln.Projects.Select (p => p.Id).Except (removedProjects).Except (currentProjects));
foreach (var p in removedProjects) {
var ps = sln.Projects.GetProject (p);
if (ps != null)
sln.Projects.Remove (ps);
var pc = sln.ProjectConfigurationsSection.GetPropertySet (p, true);
if (pc != null)
sln.ProjectConfigurationsSection.Remove (pc);
}
var secNested = sln.Sections.GetSection ("NestedProjects");
if (secNested != null) {
foreach (var np in secNested.Properties.ToArray ()) {
if (removedProjects.Contains (np.Key) || removedProjects.Contains (np.Value))
secNested.Properties.Remove (np.Key);
}
}
solution.LoadedProjects = currentProjects;
//Write the projects
using (monitor.BeginTask (GettextCatalog.GetString ("Saving projects"), 1)) {
monitor.BeginStep ();
WriteProjects (c, sln, monitor, unknownProjects);
}
//FIXME: SolutionConfigurations?
var pset = sln.SolutionConfigurationsSection;
foreach (SolutionConfiguration config in solution.Configurations) {
var cid = ToSlnConfigurationId (config);
pset.SetValue (cid, cid);
}
WriteProjectConfigurations (solution, sln);
//Write Nested Projects
ICollection<SolutionFolder> folders = solution.RootFolder.GetAllItems<SolutionFolder> ().ToList ();
if (folders.Count > 1) {
// If folders ==1, that's the root folder
var sec = sln.Sections.GetOrCreateSection ("NestedProjects", SlnSectionType.PreProcess);
foreach (SolutionFolder folder in folders) {
if (folder.IsRoot)
continue;
WriteNestedProjects (folder, solution.RootFolder, sec);
}
// Remove items which don't have a parent folder
var toRemove = solution.GetAllItems<SolutionFolderItem> ().Where (it => it.ParentFolder == solution.RootFolder);
foreach (var it in toRemove)
sec.Properties.Remove (it.ItemId);
}
// Write custom properties for configurations
foreach (SolutionConfiguration conf in solution.Configurations) {
string secId = "MonoDevelopProperties." + conf.Id;
var sec = sln.Sections.GetOrCreateSection (secId, SlnSectionType.PreProcess);
solution.WriteConfigurationData (monitor, sec.Properties, conf);
if (sec.IsEmpty)
sln.Sections.Remove (sec);
}
}