|
|
|
@ -11,12 +11,12 @@ using System.IO; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Windows.Forms; |
|
|
|
|
|
|
|
|
|
|
|
using ClassDiagram; |
|
|
|
using ClassDiagram; |
|
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.Core; |
|
|
|
using ICSharpCode.Core; |
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Commands; |
|
|
|
using ICSharpCode.SharpDevelop.Commands; |
|
|
|
using ICSharpCode.SharpDevelop.Dom; |
|
|
|
using ICSharpCode.SharpDevelop.Dom; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
|
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
|
|
|
|
namespace ClassDiagramAddin |
|
|
|
namespace ClassDiagramAddin |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -50,15 +50,24 @@ namespace ClassDiagramAddin |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
classcanvas.AutoArrange(); |
|
|
|
classcanvas.AutoArrange(); |
|
|
|
classcanvas.WriteToXml().Save(filename); |
|
|
|
XmlDocument xmlDocument = classcanvas.WriteToXml(); |
|
|
|
FileProjectItem fpi = new FileProjectItem(p, ItemType.Content); |
|
|
|
FileUtility.ObservedSave( |
|
|
|
fpi.FileName = filename; |
|
|
|
newFileName => SaveAndOpenNewClassDiagram(p, newFileName, xmlDocument), |
|
|
|
ProjectService.AddProjectItem(p, fpi); |
|
|
|
filename, FileErrorPolicy.ProvideAlternative |
|
|
|
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView(); |
|
|
|
); |
|
|
|
p.Save(); |
|
|
|
|
|
|
|
FileService.OpenFile(filename); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SaveAndOpenNewClassDiagram(IProject p, string filename, XmlDocument xmlDocument) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
xmlDocument.Save(filename); |
|
|
|
|
|
|
|
FileProjectItem fpi = new FileProjectItem(p, ItemType.Content); |
|
|
|
|
|
|
|
fpi.FileName = filename; |
|
|
|
|
|
|
|
ProjectService.AddProjectItem(p, fpi); |
|
|
|
|
|
|
|
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView(); |
|
|
|
|
|
|
|
p.Save(); |
|
|
|
|
|
|
|
FileService.OpenFile(filename); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|