LanguageService.GetIVsTextMacroHelperIfRecordingOn Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns an IVsTextMacroHelper object if macro recording is turned on.
public:
Microsoft::VisualStudio::TextManager::Interop::IVsTextMacroHelper ^ GetIVsTextMacroHelperIfRecordingOn();
public:
Microsoft::VisualStudio::TextManager::Interop::IVsTextMacroHelper ^ GetIVsTextMacroHelperIfRecordingOn();
Microsoft::VisualStudio::TextManager::Interop::IVsTextMacroHelper GetIVsTextMacroHelperIfRecordingOn();
public Microsoft.VisualStudio.TextManager.Interop.IVsTextMacroHelper GetIVsTextMacroHelperIfRecordingOn ();
member this.GetIVsTextMacroHelperIfRecordingOn : unit -> Microsoft.VisualStudio.TextManager.Interop.IVsTextMacroHelper
Public Function GetIVsTextMacroHelperIfRecordingOn () As IVsTextMacroHelper
Returns
If successful, returns an IVsTextMacroHelper object; otherwise, returns a null value.
Examples
The following is an example of how this method is implemented in the base LanguageService class.
namespace Microsoft.VisualStudio.Package
{
[CLSCompliant(false), ComVisible(true)]
public abstract class LanguageService
: IDisposable
, IVsLanguageInfo
, IVsLanguageDebugInfo
, IVsProvideColorableItems
, IVsLanguageContextProvider
, IOleServiceProvider
, IObjectWithSite
, ISynchronizeInvoke
, IVsDebuggerEvents
, IVsFormatFilterProvider
{
public IVsTextMacroHelper GetIVsTextMacroHelperIfRecordingOn()
{
if (IsMacroRecordingOn()) {
IVsTextManager textmgr = (IVsTextManager)this.GetService(
typeof(SVsTextManager));
return (IVsTextMacroHelper)textmgr;
}
return null;
}
}
}
Remarks
The IVsTextMacroHelper object is obtained by calling Microsoft.VisualStudio.Package.LanguageService.GetService with the GUID of the SVsTextManager service and casting the returned object to an IVsTextMacroHelper object.