Partilhar via


LanguageService.Initialize Method

Called to initialize the language service.

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

Syntax

'Declaração
Public Overridable Sub Initialize
public virtual void Initialize()

Remarks

This method allows you to perform initialization tasks specific to your language service. If you have specific initialization that has to be accomplished, you must derive a class from the LanguageService class and implement this method. If you do not have any special initialization needs, do not implement this method on your derived class.

Note

If you implement this method, you must call the base class version of this method before doing any other initialization.

The base method creates a Windows Forms control to control background tasks such as parsing.

Examples

using Microsoft.VisualStudio.Package;

namespace MyLanguagePackage
{
    [Guid("B614A40A-80D9-4fac-A6AD-FC2868FFF7CD")]
    public class MyLanguageService : LanguageService
    {
        public Initialize()
        {
            base.Initialize();
            // Do your language-specified initialization here
        }
    }
}

.NET Framework Security

See Also

Reference

LanguageService Class

Microsoft.VisualStudio.Package Namespace