Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
HINWEIS: Diese API ist veraltet.
Gibt das InitEventArgs -Objekt für den Namen der Schnittstelle, die in übergeben wird.
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
<ObsoleteAttribute("Use ConnectionProvider or ConnectionConsumer attribute to create ConnectionPoint instead.")> _
Public Overridable Function GetInitEventArgs ( _
InterfaceName As String _
) As InitEventArgs
'Usage
Dim instance As WebPart
Dim InterfaceName As String
Dim returnValue As InitEventArgs
returnValue = instance.GetInitEventArgs(InterfaceName)
[ObsoleteAttribute("Use ConnectionProvider or ConnectionConsumer attribute to create ConnectionPoint instead.")]
public virtual InitEventArgs GetInitEventArgs(
string InterfaceName
)
Parameter
InterfaceName
Typ: System.StringEine Schnittstelle in der Microsoft.SharePoint.WebPartPages.Communication -Namespace, der einen Transformator verwendet.
Rückgabewert
Typ: Microsoft.SharePoint.WebPartPages.Communication.InitEventArgs
Ein InitEventArgs -Objekt wie ein CellProviderInitEventArgs -Objekt zurückgegeben, die von einem Webpart, das die ICellProvider -Schnittstelle implementiert wird.
Hinweise
Die GetInitEventArgs -Methode ist nur erforderlich, für die Schnittstellen des Microsoft.SharePoint.WebPartPages.Communication -Namespaces, die Transformatoren, wie die IRowProvider, ICellConsumer, IFilterConsumer, IParametersOutProviderund IParametersInConsumer -Schnittstellen verwenden können. Die InitEventArgs -Methode wird von der Datenverbindung webbasierte Benutzeroberfläche für alle erforderlichen zum Herstellen einer Verbindung, die einen Transformator beinhaltet Anfangsdaten authoring aufgerufen. Es ist eine virtuelle Methode für die WebPart , die vom Entwickler für die Schnittstellen, mit denen Transformatoren überschrieben werden müssen. Wenn sie nicht überschrieben wird, wird eine Fehlermeldung angezeigt.
Beispiele
Das folgende Codebeispiel zeigt eine überschriebene GetInitEventArgs -Methode. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die ICellConsumer -Schnittstelle.
Eine Übersicht über die Schritte zum Erstellen eines verbindbaren Webparts finden Sie unter Creating a Connectable Web Part.
' Step #11: Override the GetInitEventArgs() method.
' The GetInitEventArgs method is called by the Web Part infrastructure during the
' ASP.NET PreRender event to gather the necessary information it needs to build
' the transformer dialog box. The transformer dialog box
' is needed when connecting different interfaces such as IRowProvider
' to ICellConsumer. The transformer dialog box allows the user to map the fields between the
' interfaces. The GetInitEventArgs method only needs to be implemented for interfaces that
' can participate in a transformer which are the following:
' ICellConsumer, IRowProvider, IFilterConsumer, IParametersOutProvider, IParametersInConsumer.
' interfacename is the name of interface on which the Web Part infrastructure is requesting
' information.
' Returns an InitEventArgs object.
Public Overrides Function GetInitEventArgs(interfaceName As String) As InitEventArgs
' Check if this is my particular cell interface.
If interfaceName = "MyCellConsumerInterface" Then
' Create the object that will return the initialization arguments.
Dim cellConsumerInitArgs As New CellConsumerInitEventArgs()
' Set the FieldName and FieldDisplay name values.
cellConsumerInitArgs.FieldName = _cellName
cellConsumerInitArgs.FieldDisplayName = _cellDisplayName
' Return the CellConsumerInitEventArgs object.
Return cellConsumerInitArgs
Else
Return Nothing
End If
End Function
// Step #11: Override the GetInitEventArgs() method.
// The GetInitEventArgs method is called by the Web Part infrastructure during the ASP.NET PreRender event
// to gather the necessary information it needs to build the transformer dialog box. The transformer dialog box
// is needed when connecting different interfaces such as IRowProvider
// to ICellConsumer. The transformer dialog box allows the user to map the fields between the
// interfaces. The GetInitEventArgs method only needs to be implemented for interfaces that
// can participate in a transformer which are the following:
// ICellConsumer, IRowProvider, IFilterConsumer, IParametersOutProvider, IParametersInConsumer.
// <param name="interfacename">Name of interface on which the Web Part infrastructure is requesting information</param>
// <returns>An InitEventArgs object</returns>
public override InitEventArgs GetInitEventArgs(string interfaceName)
{
// Check if this is my particular cell interface.
if (interfaceName == "MyCellConsumerInterface")
{
// Create the object that will return the initialization arguments.
CellConsumerInitEventArgs cellConsumerInitArgs = new CellConsumerInitEventArgs();
// Set the FieldName and FieldDisplay name values.
cellConsumerInitArgs.FieldName = _cellName;
cellConsumerInitArgs.FieldDisplayName = _cellDisplayName;
// Return the CellConsumerInitEventArgs object.
return(cellConsumerInitArgs);
}
else
{
return(null);
}
}