public static void Terminate() { var entryDirectory = GetEntryDirectory(); System.IO.Directory.SetCurrentDirectory(entryDirectory); Manager.NativeManager.SaveDock("config.Dock.config"); SaveWindowConfig("config.Dock.xml"); foreach (var p in panels) { if (p != null) { p.DispatchDisposed(); } } if (effectViewer != null) { effectViewer.DispatchDisposed(); } Network.Save(); Shortcuts.SeveShortcuts(); RecentFiles.SaveRecentConfig(); Viewer.HideViewer(); NativeManager.SetCallback(null); NativeManager.Terminate(); Images.Unload(); }
public static void Terminate() { Core.SaveBackup(System.IO.Path.GetTempPath() + "/efk_quit.efkbac"); var entryDirectory = GetEntryDirectory(); System.IO.Directory.SetCurrentDirectory(entryDirectory); SaveWindowConfig(ConfigFilePath); foreach (var p in panels) { if (p != null) { p.DispatchDisposed(); } } if (effectViewer != null) { effectViewer.DispatchDisposed(); } Network.Save(); Shortcuts.SeveShortcuts(); RecentFiles.SaveRecentConfig(); Network.Dispose(); Network = null; Viewer.HideViewer(); Viewer.Dispose(); Viewer = null; if (MainViewImage != null) { MainViewImage.Dispose(); MainViewImage = null; } NativeManager.SetCallback(null); NativeManager.Terminate(); Images.Unload(); if (HardwareDevice != null) { HardwareDevice.Dispose(); HardwareDevice = null; } swig.MainWindow.Terminate(); MainWindow.Dispose(); MainWindow = null; ThumbnailManager.Terminate(); swig.IO.Terminate(); IO.Dispose(); IO = null; }
internal static void SaveConfig() { { var rf = GetRecentFiles(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); System.Xml.XmlElement project_root = doc.CreateElement("Recent"); foreach (var f in rf.Reverse()) { project_root.AppendChild(doc.CreateTextElement("File", f)); } doc.AppendChild(project_root); var dec = doc.CreateXmlDeclaration("1.0", "utf-8", null); doc.InsertBefore(dec, project_root); doc.Save(configRecentPath); } { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); System.Xml.XmlElement project_root = doc.CreateElement("GUI"); if (MainForm.WindowState == FormWindowState.Normal) { project_root.AppendChild(doc.CreateTextElement("X", MainForm.Location.X.ToString())); project_root.AppendChild(doc.CreateTextElement("Y", MainForm.Location.Y.ToString())); project_root.AppendChild(doc.CreateTextElement("Width", MainForm.Width.ToString())); project_root.AppendChild(doc.CreateTextElement("Height", MainForm.Height.ToString())); } else // 最小化、最大化中はその前の位置とサイズを保存 { project_root.AppendChild(doc.CreateTextElement("X", MainForm.BeforeResizeLocation.X.ToString())); project_root.AppendChild(doc.CreateTextElement("Y", MainForm.BeforeResizeLocation.Y.ToString())); project_root.AppendChild(doc.CreateTextElement("Width", MainForm.BeforeResizeWidth.ToString())); project_root.AppendChild(doc.CreateTextElement("Height", MainForm.BeforeResizeHeight.ToString())); } doc.AppendChild(project_root); var dec = doc.CreateXmlDeclaration("1.0", "utf-8", null); doc.InsertBefore(dec, project_root); doc.Save(configGuiPath); } MainForm.Panel.SaveAsXml(configGuiPanelPath, Encoding.UTF8); Network.Save(configNetworkPath); }
public static void Terminate() { var entryDirectory = GetEntryDirectory(); System.IO.Directory.SetCurrentDirectory(entryDirectory); SaveWindowConfig(ConfigFilePath); foreach (var p in panels) { if (p != null) { p.DispatchDisposed(); } } if (effectViewer != null) { effectViewer.DispatchDisposed(); } Network.Save(); Shortcuts.SeveShortcuts(); RecentFiles.SaveRecentConfig(); Viewer.HideViewer(); NativeManager.SetCallback(null); NativeManager.Terminate(); Images.Unload(); swig.MainWindow.Terminate(); MainWindow.Dispose(); MainWindow = null; ThumbnailManager.Terminate(); swig.IO.Terminate(); IO.Dispose(); IO = null; }