写一个类,在每个文档里new 一个,然后名字用子文档名字,
解决方案 »
- 在一台电脑上安装了VS2005,再安装VS2008可以吗?会不会有冲突?
- .net Redirect 安全问题(大家如何解决的??)
- 求助C#方法将TXT格式转换为RAW格式
- 请问如何把string(非数字) 转换成 uint
- 为什么不把webservice层去掉,客户端直接访问数据库?
- 我用listview读取数据时怎样改变显示编码!
- 请教一个合并两个xml文件的问题?谢谢
- 关于存储过程!请高手指点!
- C#的SOCKET是否已经内置了IOCP?
- C#添加带参数的表,及字段
- 高分寻大学自考助学班,学校最好名气好的.有消息再开贴酬谢~~
- 程序检入后再捡出,自定义控件都看不见了,是怎么回事?谢谢!
{
public delegate void ActUndoEventHandler(object sender,ActUndoEventArgs e); public class ActUndoEventArgs:EventArgs
{
public ActUndoEventArgs(object document,object action)
{
this.Document=document;
this.Action=action;
}
public object Document=0;
public object Action=0;
} public event ActUndoEventHandler ActUndo=null; protected virtual void OnActUndo(ActUndoEventArgs e)
{
if(this.ActUndo!=null)
this.ActUndo(this,e);
}
private Hashtable _buff=new Hashtable(); private ArrayList GetActions(object document)
{
if(!this._buff.ContainsKey(document))
{
this._buff.Add(document,new ArrayList());
}
return this._buff[document] as ArrayList;
}
public virtual void Save(object document)
{
if(this._buff.ContainsKey(document))
{
this._buff.Remove(document);
}
}
public virtual void Load(object document)
{
//.... ....
}
public int Do(object document,object action)
{
return this.GetActions(document).Add(action);
}
public void Undo(object document,int step)
{
this.Load(document);
ArrayList actions=this.GetActions(document);
int i=0;
for(i=0;i<step && i<actions.Count;i++)
{
this.OnActUndo(new ActUndoEventArgs(document,actions[i]));
}
for(int k=i;k<actions.Count;k++)
{
actions.RemoveAt(i);
}
}
}
当当当~~~
你把所有的多文档页面建在同一页,然后挨个隐藏显示~~
复杂一点的就是把你的页面对象serialize串行化后存在Buffer(很久没研究CS了:(,可能不是Buffer)里,到时候挨个反串行化就Ok了!!
不知道你听明白没有???厚厚~~~