用于保存文件/项目/工作单元状态的 C# 设计模式

发布于 2024-10-07 08:35:10 字数 223 浏览 0 评论 0原文

大家早上好。

我们有一个基于项目的应用程序,因此用户打开并创建一个项目,然后他们在该项目中执行的许多操作可能需要也可能不需要保存状态。

我一直在四处寻找是否有一个可接受的模式。我认为描述它的最好方法是考虑 Visual Studio,我正在寻找一种模式,旨在识别其中一个类何时发生更改(将小星放在选项卡上),并为保存例程提供一种方法知道需要保存什么/是否需要保存任何内容。

提前致谢。

Morning Everyone.

We have an application that is project based, so the user opens, create a project then there are many things that they do within that project that may or maynot need their state saving.

I have been looking around trying to find if there was an accepted pattern for this. I think the best way to describe it is to think of Visual Studio, what I am looking for is a pattern designed to recognise when one of the classes changes (putting the little star on the tab) and provides a way for the save routine to know what it needs to save / if anything needs to be saved.

Thanks in advance.

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

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

发布评论

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

评论(1

顾挽 2024-10-14 08:35:10

看起来最适合纪念品模式

Looks best fit for Memento pattern.

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