public void WriteFile(FilePath file, object obj, IProgressMonitor monitor) { if (slnFileFormat.CanWriteFile(obj, this)) { slnFileFormat.WriteFile(file, obj, this, true, monitor); } else { SolutionEntityItem item = (SolutionEntityItem)obj; if (!(item.ItemHandler is MSBuildProjectHandler)) { MSBuildProjectService.InitializeItemHandler(item); } MSBuildProjectHandler handler = (MSBuildProjectHandler)item.ItemHandler; handler.SetSolutionFormat(this, false); handler.Save(monitor); } }
public void ConvertToFormat(object obj) { if (obj == null) { return; } MSBuildHandler handler; SolutionItem item = obj as SolutionItem; if (item != null) { handler = item.GetItemHandler() as MSBuildHandler; if (handler != null) { handler.SetSolutionFormat(this, true); return; } } MSBuildProjectService.InitializeItemHandler(item); handler = (MSBuildHandler)item.ItemHandler; handler.SetSolutionFormat(this, true); }