SCSF:保存和加载应用程序布局

发布于 2024-08-25 01:20:14 字数 104 浏览 1 评论 0原文

我正在使用 SCSF 框架和 SCSF contrib 在我的应用程序中添加对接支持。

我想保存打开的视图的布局,以便我可以在应用程序启动时恢复它们。

我该怎么做

i am using SCSF framework and SCSF contrib to add docking support in my application.

i want to save the layout of opened views so that i can restore them on application start.

how can i do this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亢潮 2024-09-01 01:20:14

我们使用 SandDock 作为我们的对接布局引擎。它有一个简单的方法来获取布局,我们用它来保存到 XML。

        using (StreamWriter sw = new StreamWriter(fs))
        {
            string layout = _sandDockManager.GetLayout();
            sw.Write(layout);
        }

然后,稍后,我们可以从反序列化的 XML 文件中检索布局并应用它。为了清楚起见,删除了错误检查代码:

        this._sandDockManager.SetLayout(sanddockXmlLayout);

We us SandDock as our docking layout engine. That has a simple method to get the layout, which we use to persist to XML.

        using (StreamWriter sw = new StreamWriter(fs))
        {
            string layout = _sandDockManager.GetLayout();
            sw.Write(layout);
        }

Then, later, we can retrieve back the layout from the deserialized XML file and apply it. Error checking code is removed for clarity:

        this._sandDockManager.SetLayout(sanddockXmlLayout);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文