Edit

Share via


BufferedWebEventProvider.Initialize(String, NameValueCollection) Method

Definition

Sets the initial values for this object.

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

The name used in the configuration file to identify this provider.

config
NameValueCollection

A NameValueCollection that specifies the attributes assigned for this provider in the configuration file.

Examples

The following code example shows how to use the Initialize method.

// 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

Remarks

ASP.NET calls the Initialize method after calling the BufferedWebEventProvider constructor. This method is called to initialize the BufferedWebEventProvider with the configuration settings and name specified in the configuration file.

Applies to