Partager via


ToolPane.GetShowToolPaneEvent - Méthode (WebPart, ToolPane.ToolPaneView)

Remarque : cette API est désormais obsolète.

Retourne une chaîne d'ECMAScript (tel que JavaScript) qui, si exécutée sur le client, entraîne un volet d'outils Ouvrir dans le mode spécifié pour le composant spécifié.

Espace de noms :  Microsoft.SharePoint.WebPartPages
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
<ObsoleteAttribute("This function is deprecated. Use GetShowToolPaneEvent(WebPart webPart, WebPartDisplayMode displayMode) instead.",  _
    False)> _
Public Shared Function GetShowToolPaneEvent ( _
    webPart As WebPart, _
    view As ToolPane.ToolPaneView _
) As String
'Utilisation
Dim webPart As WebPart
Dim view As ToolPane.ToolPaneView
Dim returnValue As String

returnValue = ToolPane.GetShowToolPaneEvent(webPart, _
    view)
[ObsoleteAttribute("This function is deprecated. Use GetShowToolPaneEvent(WebPart webPart, WebPartDisplayMode displayMode) instead.", 
    false)]
public static string GetShowToolPaneEvent(
    WebPart webPart,
    ToolPane.ToolPaneView view
)

Paramètres

  • webPart
    Type : Microsoft.SharePoint.WebPartPages.WebPart

    Le composant WebPart pour laquelle afficher le volet d'outils Propriétés. Peut être null pour les vues qui ne nécessitent pas un composant WebPart, tels que le volet de navigation.

Valeur renvoyée

Type : System.String
Chaîne de ECMAScript (tel que JavaScript) qui, si exécutée sur le client, entraîne un volet d'outils Ouvrir dans le mode spécifié pour le composant spécifié.

Exemples

La méthode substituée RenderWebPart suivante à partir d'un composant WebPart de l'exemple illustre l'utilisation de la méthode GetShowToolPaneEvent pour créer une liste de liens dans le composant WebPart à l'aide de chaque valeur de l'énumération ToolPane.ToolPaneView , disponible pour permettre à l'utilisateur d'appeler les différentes vues de volet disponibles de l'outil à partir du composant WebPart.

Dans l'exemple suivant, « navigateur de niveau inférieur » fait référence à Internet Explorer version 5.0 et versions antérieure et pour les navigateurs non Microsoft.

Protected Overrides Sub RenderWebPart(output As HtmlTextWriter)

Dim myToolPaneCall as String

myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GalleryBrowse)
output.Write("<a href=""" + myToolPaneCall + """>Browse Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GallerySearch)
output.Write("<a href=""" + myToolPaneCall + """>Search Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Import)
output.Write("<a href=""" + myToolPaneCall + """>Import Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Navigation)
output.Write("<a href=""" + myToolPaneCall + """>Settings Pane (Downlevel Browser)</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Error)
output.Write("<a href=""" + myToolPaneCall + """>Error Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.ExtensibleView)
output.Write("<a href=""" + myToolPaneCall + """>Extensible Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Properties)
output.Write("<a href==""" + myToolPaneCall + """>Properties Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.WebPart)
output.Write("<a href=""" + myToolPaneCall + """>Chrome Menu Pane (Downlevel Browser)</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Closed)
output.Write("<a href=""" + myToolPaneCall + """>Close ToolPane</a><br>")

output.Write("<br>")
End Sub
protected override void RenderWebPart(HtmlTextWriter output)
{
string myToolPaneCall;

myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GalleryBrowse);
output.Write("<a href=\"" + myToolPaneCall + "\">Browse Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GallerySearch);
output.Write("<a href=\"" + myToolPaneCall + "\">Search Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Import);
output.Write("<a href=\"" + myToolPaneCall + "\">Import Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Navigation);
output.Write("<a href=\"" + myToolPaneCall + "\">Settings Pane (Downlevel Browser)</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Error);
output.Write("<a href=\"" + myToolPaneCall + "\">Error Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.ExtensibleView);
output.Write("<a href=\"" + myToolPaneCall + "\">Extensible Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Properties);
output.Write("<a href=\"" + myToolPaneCall + "\">Properties Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.WebPart);
output.Write("<a href=\"" + myToolPaneCall + "\">Chrome Menu Pane (Downlevel Browser)</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Closed);
output.Write("<a href=\"" + myToolPaneCall + "\">Close ToolPane</a><br>");

output.Write("<br>");
}

Voir aussi

Référence

ToolPane classe

ToolPane - Membres

GetShowToolPaneEvent - Surcharge

Microsoft.SharePoint.WebPartPages - Espace de noms