示例#1
0
        private void SaveLayout(string path)
        {
            try
            {
                CreateParentDirectories(path);

                using (var archive = new ZipArchive(File.Open(path, FileMode.Create), ZipArchiveMode.Create))
                {
                    using (var layoutstream = archive.CreateEntry("SubWindowLayout.xml").Open())
                    {
                        SaveSubWindowsLayout(layoutstream);
                    }
                    using (var placementstream = archive.CreateEntry("WindowPlacement.xml").Open())
                    {
                        WindowPlacementManager.SaveWindowPlacement(this, placementstream);
                    }
                }


                Utility.Logger.Add(2, path + " へウィンドウ レイアウトを保存しました。");
            }
            catch (Exception ex)
            {
                Utility.ErrorReporter.SendErrorReport(ex, "ウィンドウ レイアウトの保存に失敗しました。");
            }
        }
示例#2
0
        private void SaveLayout(string path)
        {
            try {
                CreateParentDirectories(path);

                using (var stream = File.Open(path, FileMode.Create))
                    using (var archive = new ZipArchive(stream, ZipArchiveMode.Create)) {
                        using (var layoutstream = archive.CreateEntry("SubWindowLayout.xml").Open()) {
                            SaveSubWindowsLayout(layoutstream);
                        }
                        using (var placementstream = archive.CreateEntry("WindowPlacement.xml").Open()) {
                            WindowPlacementManager.SaveWindowPlacement(this, placementstream);
                        }
                    }


                Utility.Logger.Add(2, string.Format(Resources.LayoutSaved, path));
            } catch (Exception ex) {
                Utility.ErrorReporter.SendErrorReport(ex, LoggerRes.FailedSaveLayout);
            }
        }