ServicedComponent.Activate 메서드

정의

풀에서 개체를 만들거나 할당할 때 인프라에서 호출합니다. 이 메서드를 재정의하여 사용자 지정 초기화 코드를 개체에 추가합니다.

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 ()

예제

다음 코드 예제에서는이 메서드를 사용 하는 방법을 보여 줍니다.

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

적용 대상