BufferedWebEventProvider.Initialize(String, NameValueCollection) Methode

Definitie

Hiermee stelt u de initiële waarden voor dit object in.

public:
 override void Initialize(System::String ^ name, System::Collections::Specialized::NameValueCollection ^ config);
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config);
override this.Initialize : string * System.Collections.Specialized.NameValueCollection -> unit
Public Overrides Sub Initialize (name As String, config As NameValueCollection)

Parameters

name
String

De naam die in het configuratiebestand wordt gebruikt om deze provider te identificeren.

config
NameValueCollection

Een NameValueCollection die de kenmerken aangeeft die zijn toegewezen voor deze provider in het configuratiebestand.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u de Initialize methode gebruikt.

// Initializes the provider.
public override void Initialize(string name,
 NameValueCollection config)
{
    base.Initialize(name, config);

    // Get the configuration information.
    providerName = name;
    buffer = SampleUseBuffering.ToString();
    bufferModality = SampleBufferMode;

    customInfo.AppendLine(string.Format(
        "Provider name: {0}", providerName));
    customInfo.AppendLine(string.Format(
        "Buffering: {0}", buffer));
    customInfo.AppendLine(string.Format(
        "Buffering modality: {0}", bufferModality));
}
' Initializes the provider.
 Public Overrides Sub Initialize(ByVal name As String, _
 ByVal config As NameValueCollection)
     MyBase.Initialize(name, config)

     ' Get the configuration information.
     providerName = name
     buffer = SampleUseBuffering.ToString()
     bufferModality = SampleBufferMode

     customInfo.AppendLine(String.Format( _
     "Provider name: {0}", providerName))
     customInfo.AppendLine(String.Format( _
     "Buffering: {0}", buffer))
     customInfo.AppendLine(String.Format( _
     "Buffering modality: {0}", bufferModality))
 End Sub

Opmerkingen

ASP.NET roept de methode Initialize aan nadat de BufferedWebEventProvider constructor is aangeroepen. Deze methode wordt aangeroepen om de BufferedWebEventProvider configuratie-instellingen en de naam die is opgegeven in het configuratiebestand te initialiseren.

Van toepassing op