data structure used to implement UNDO and REDO option

前端 未结 5 812
天命终不由人
天命终不由人 2020-12-02 05:19

I want to implement UNDO and REDO option(as we see in MS word etc). Can you suggest me a data structure for it, and how can i implement it.?

5条回答
  •  余生分开走
    2020-12-02 06:01

    You can use Command Pattern to achive Undo/Redo

    Check these samples:

    http://www.codeproject.com/csharp/undoredobuffer.asp

    http://www.dofactory.com/Patterns/PatternCommand.aspx

提交回复
热议问题