开发者

Visual Studio 2010 Editor UndoHistory

开发者 https://www.devze.com 2023-01-01 08:41 出处:网络
I am trying to write an extension that can access the TextUndoHistory of an VS editor. Do I have to implement ITextUndoHistory and ITextUndoTransaction myse开发者_Go百科lf or is there something that

I am trying to write an extension that can access the TextUndoHistory of an VS editor.

Do I have to implement ITextUndoHistory and ITextUndoTransaction myse开发者_Go百科lf or is there something that I can hook into using the SDK?

Thanks, Nick


You import an ITextUndoHistoryRegistry from an [Export]ed MEF component, and call TryGetHistory to retrieve the history for a given buffer. See MarginFactory.cs from my FixMixedTabs extension for an example (in that same extension, InformationBar.cs shows you how to create transactions on the undo history).

0

精彩评论

暂无评论...
验证码 换一张
取 消