ToolPane.GetShowToolPaneEvent method (WebPart, ToolPane.ToolPaneView)
NOTE: This API is now obsolete.
傳回它,如果執行在用戶端,會使得在指定的 Web 組件指定的檢視中開啟工具窗格 (例如 JavaScript) 採用的字串。
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<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
'用途
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
)
參數
webPart
Type: Microsoft.SharePoint.WebPartPages.WebPart要顯示 [屬性] 工具窗格 [網頁組件。可為 null 不需要的網頁組件,例如瀏覽] 窗格的檢視。
view
Type: Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView其中一個 ToolPane.ToolPaneView 值,指定要開啟的檢視。
傳回值
Type: System.String
這樣,如果在用戶端上執行會造成在指定的 Web 組件指定的檢視中開啟工具窗格 (例如 JavaScript) 採用的字串。
Examples
下列的覆寫的RenderWebPart方法,從網頁組件的範例會示範如何使用GetShowToolPaneEvent方法,以在 [網頁組件,使用每個可用的值,從ToolPane.ToolPaneView列舉型別,以允許使用者叫用 [網頁組件的各種可用的工具窗格檢視中建立的連結清單。
在下列範例中,「 舊版瀏覽器 」 指的是 Internet Explorer 版本 5.0 及之前版本,以及非 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>");
}