Windows资源管理器的后退和前进按钮 [英] Back and Forward button for windows explorer

查看:759
本文介绍了Windows资源管理器的后退和前进按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想通过C#模拟Windows资源管理器并编写代码,并知道我想添加后退和前进按钮,项目查看路径但我不知道怎么回来或转发?

谢谢你的帮助

Baharan20

解决方案

你必须保持历史(无论你想要展示什么)。如果这类似于文件管理器,那么可能只是导航历史记录。实际上,像这样的管理者可以有几个历史记录,例如命令历史,位置(导航)等。历史记录是列表中当前索引的一些对象(主要是字符串,如果是位置或命令)的列表,或者引用链接列表的当前元素。列表应该增长到一定的长度,然后应该删除太旧的数据。因此,适当的数据结构可以是双重链表。 (如果你只需要返回,它会更简单:字符串堆栈。)



在按钮上,你得到下一个/上一个数据元素,移动当前以相应的方式,在那里导航(发出命令等),并刷新按钮的启用/禁用状态(因为,根据可用的数据和位置,应该禁用后退,前进或两个动作。



设计一切并添加到您的代码中。



-SA

Hi

I want to simulate Windows Explorer by C# and I write the code,and know I want to add Back and Forward button,the project see the path but I do not know how to Back or Forward?
thanks for your help
Baharan20

解决方案

You have to keep the History (of whatever you want to show). If this is something like file manager, if could be just navigation history. Actually, managers like that can have several histories, such as history of commands, locations (navigation), etc. The history is a list of some objects (mostly strings, in case of locations or commands) with the current index in list, or reference to a current element, for a linked list. The list should grow to certain length and then too old data should be removed. Therefore, the adequate data structure could be a doubly linked list. (If you only needed "Back", it would be much simpler: the Stack of strings.)

On buttons, you get next/previous data element, move current in a correspondent way, navigate there (issue command, etc), and refresh enabled/disabled status of the buttons (because, depending in available data and location, "Back", "Forward" or both actions should be disabled.

Design it all and add to you code.

—SA


这篇关于Windows资源管理器的后退和前进按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆