//-/////////////////////////////////////////////////////////////////////// //-/////////////////////////////////////////////////////////////////////// private void SaveStateForScript() { if (_scriptFileName == null) { return; } // Save layout try { _dockPanel.SaveAsXml(GetLayoutFileName(_scriptFileName), Misc.defaultXmlEncoding); } catch (IOException) { // These can leak from DockPanel.SaveAsXml. Just ignore them. // It's not exactly the end of the world. } // Save config { Config config = new Config(); config.GraphicsTransformElements = _graphicsPanel.GraphicsTransform.Elements; config.GraphicsShowGrid = _graphicsPanel.GraphicsShowGrid; config.GraphicsYIsUp = _graphicsPanel.GraphicsYIsUp; config.WindowPlacement = WindowPlacement.GetWindowPlacement(this); Misc.SaveXml(GetConfigFileName(_scriptFileName), config); } }
public void Run() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(this)); Misc.SaveXml(stateFileName, _state); }