Show / Hide Table of Contents

Class ThisMethod

A utility class for caller methods.

Inheritance
System.Object
ThisMethod
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Existential
Assembly: Existential.Net.dll
Syntax
public static class ThisMethod

Methods

View Source

GetName(String)

Gets the name of the calling method at compile time (i.e. not requiring reflection).

Declaration
public static string GetName(string inCaller = "")
Parameters
Type Name Description
System.String inCaller

No value should be provided for this parameter. The value will be populated by the CallerMemberName attribute.

Returns
Type Description
System.String

The name of the calling method.

Remarks

Depends on the use of the CallerMemberName attribute: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callermembernameattribute?view=netframework-4.8.

  • View Source
In This Article
Back to top Copyright © 2021 Dr. Gavin T.D. Greig.