共用方式為


ViewFilter.OnSetBuffer Method

Called when the buffer of lines is being set or changed in the given view.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'宣告
Public Overridable Sub OnSetBuffer ( _
    view As IVsTextView, _
    buffer As IVsTextLines _
)
public virtual void OnSetBuffer(
    IVsTextView view,
    IVsTextLines buffer
)

Parameters

Implements

IVsTextViewEvents.OnSetBuffer(IVsTextView, IVsTextLines)

Remarks

If your language service needs to respond to a buffer being changed, then you must derive a class from the ViewFilter class and override this method.

This method is an implementation of the OnSetBuffer method on the IVsTextViewEvents interface.

The base method does nothing. In debug mode, the base method does assert that the new buffer is the same as the buffer in the Source object obtained from the CodeWindowManager object that was passed to the ViewFilter class constructor.

.NET Framework Security

See Also

Reference

ViewFilter Class

Microsoft.VisualStudio.Package Namespace