public override void OnClick() { //IProjectService projectService = _context.Container.GetSingleton<IProjectService>(); //projectService.TryClose(); frmCreateDB frm = new frmCreateDB(); if (_context.View.ShowChildView(frm, true)) { string projectFile = Path.Combine(frm.ProjectFile, frm.ProjectName, frm.ProjectName + ".vgproj"); XmlProject project = ReProjectHelper.CreateReProject(_context, frm.ProjectName, frm.ProjectFile, frm.EpsGCode); using (var writer = new StreamWriter(projectFile)) { writer.Write(project.Serialize()); writer.Flush(); } //((ISecureContext) _context).VastProject = project; IProjectService projectService = _context.Container.GetSingleton <IProjectService>(); projectService.Open(projectFile, false); } }
private string SerializeMapState(string filename) { var project = new XmlProject(_context as ISecureContext, filename); return(project.Serialize(false)); }