StackFrame.GetMethod Yöntem

Tanım

Çerçevenin yürütülmekte olduğu yöntemi alır.

public:
 System::Reflection::MethodBase ^ GetMethod();
public:
 virtual System::Reflection::MethodBase ^ GetMethod();
public System.Reflection.MethodBase GetMethod ();
public virtual System.Reflection.MethodBase? GetMethod ();
public virtual System.Reflection.MethodBase GetMethod ();
member this.GetMethod : unit -> System.Reflection.MethodBase
abstract member GetMethod : unit -> System.Reflection.MethodBase
override this.GetMethod : unit -> System.Reflection.MethodBase
Public Function GetMethod () As MethodBase
Public Overridable Function GetMethod () As MethodBase

Döndürülenler

Çerçevenin yürütülmekte olduğu yöntem.

Örnekler

Aşağıdaki örnekte yönteminin kullanımı gösterilmektedir GetMethod . Bu kod örneği, sınıfı için StackFrame sağlanan daha büyük bir örneğin parçasıdır.

StackFrame^ fr = gcnew StackFrame( 1,true );
StackTrace^ st = gcnew StackTrace( fr );
EventLog::WriteEntry( fr->GetMethod()->Name, st->ToString(), EventLogEntryType::Warning );
StackFrame fr = new StackFrame(1,true);
StackTrace st = new StackTrace(fr);
EventLog.WriteEntry(fr.GetMethod().Name,
                    st.ToString(),
                    EventLogEntryType.Warning);
Dim frame As New StackFrame(1, True)
Dim strace As New StackTrace(frame)            

EventLog.WriteEntry(frame.GetMethod().Name, _
                    strace.ToString(), _
                    EventLogEntryType.Warning)

Açıklamalar

Şu anda yürütülmekte olan yöntem, türetilmiş bir sınıfta çağrılsa da bir temel sınıftan devralınmış olabilir. Bu durumda, ReflectedType tarafından GetMethod döndürülen nesnesinin MethodBase özelliği türetilmiş sınıfı değil temel sınıfı tanımlar.

Şunlara uygulanır