IVsExpansionManager, interface

Représente le gestionnaire de développement, capable de rechercher et afficher des listes d'extraits de code pour un langage particulier de programmation.

Espace de noms :  Microsoft.VisualStudio.TextManager.Interop
Assembly :  Microsoft.VisualStudio.TextManager.Interop.8.0 (dans Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Syntaxe

'Déclaration
<GuidAttribute("CA09E5EA-FEE7-4B52-AFE6-8EA2EC53F681")> _
<InterfaceTypeAttribute()> _
Public Interface IVsExpansionManager
[GuidAttribute("CA09E5EA-FEE7-4B52-AFE6-8EA2EC53F681")]
[InterfaceTypeAttribute()]
public interface IVsExpansionManager
[GuidAttribute(L"CA09E5EA-FEE7-4B52-AFE6-8EA2EC53F681")]
[InterfaceTypeAttribute()]
public interface class IVsExpansionManager
[<GuidAttribute("CA09E5EA-FEE7-4B52-AFE6-8EA2EC53F681")>]
[<InterfaceTypeAttribute()>]
type IVsExpansionManager =  interface end
public interface IVsExpansionManager

Le type IVsExpansionManager expose les membres suivants.

Méthodes

  Nom Description
Méthode publique EnumerateExpansions Extrait une liste d'extraits de code pour le langage spécifié de programmation.
Méthode publique GetExpansionByShortcut Extrait le titre et le chemin d'accès à un extrait de code donné son nom de raccourci.
Méthode publique GetSnippetShortCutKeybindingState Infrastructure. Détermine si une clé a été liée « appellent l'extrait de code à la commande de raccourci ».
Méthode publique GetTokenPath Retourne le chemin d'accès à l'emplacement spécifié.
Méthode publique InvokeInsertionUI Montre une liste d'Intellisense d'extraits de code qui peuvent être insérés dans la source via l'objet fourni d'IVsExpansionClient.

Début

Notes

Le gestionnaire d'expansion est une interface d'assistance qui fournit l'accès aux informations sur des extraits de code. Cette interface peut également présenter une liste d'extraits de code à insérer à un emplacement particulier dans un document.

Remarques à l'attention des implémenteurs

Cette interface est implémentée par Visual Studio.

Remarques à l'attention des appelants

Cette interface est obtenue en appelant la méthode d'GetExpansionManager dans l'interface d'IVsTextManager2.

Exemples

Cet exemple montre comment extraire l'interface d'IVsExpansionManager donnée un fournisseur de services.

using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.TextManager.Interop;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;

namespace MyPackage
{
    public class MyClass
    {
        public object GetService(IOleServiceProvider serviceProvider,
                                 Guid serviceGuid,
                                 Guid interfaceGuid)
        {
            IntPtr pUnknown = IntPtr.Zero;
            object unknown = null;
            int hr = serviceProvider.QueryService(ref serviceGuid,
                                    ref interfaceGuid,
                                    out pUnknown);
            if (ErrorHandler.Succeeded(hr))
            {
                unknown = Marshal.GetObjectForIUnknown(pUnknown);
            }
            return unknown;
        }


        private IVsExpansionManager GetExpansionManager(IOleServiceProvider serviceProvider)
        {
            IVsExpansionManager expansionManager = null;
            IVsTextManager textManager;
            textmanager = (IVsTextManager)this.GetService(serviceProvider,
                                                          typeof(SVsTextManager).GUID,
                                                          typeof(IVsTextManager).GUID);
            if (textManager != null)
            {
                IVsTextManager2 textManager2 = (IVsTextManager2)textManager;
                if (textManager2 != null)
                {
                    textManager2.GetExpansionManager(out expansionManager);
                }
            }
        }
        return expansionManager;
    }
}

Voir aussi

Référence

Microsoft.VisualStudio.TextManager.Interop, espace de noms