Taal

ServicedComponent.Activate Methode

Definitie

Aangeroepen door de infrastructuur wanneer het object wordt gemaakt of toegewezen vanuit een pool. Overschrijf deze methode om aangepaste initialisatiecode toe te voegen aan objecten.

protected public:
 virtual void Activate();
protected internal virtual void Activate();
abstract member Activate : unit -> unit
override this.Activate : unit -> unit
Protected Friend Overridable Sub Activate ()

Voorbeelden

In het volgende codevoorbeeld ziet u het gebruik van deze methode.

protected:
   virtual void Activate() override
   {
      MessageBox::Show( String::Format( "Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n", ContextUtil::ApplicationId.ToString(), ContextUtil::ApplicationInstanceId.ToString(), ContextUtil::ContextId.ToString() ) );
   }
protected override void Activate()
{
    MessageBox.Show( String.Format("Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n",
                                   ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(),
                                   ContextUtil.ContextId.ToString() ) );
}
Protected Overrides Sub Activate() 
    MessageBox.Show(String.Format("Now entering..." + vbLf + "Application: {0}" + vbLf + "Instance: {1}" + vbLf + "Context: {2}" + vbLf, ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(), ContextUtil.ContextId.ToString()))

End Sub

Van toepassing op