Horje
attribute c# get method name reflection Code Example
attribute c# get method name reflection
void Main()
{
    ControlCharacter control = new ControlCharacter();
    control.GetType()
           .GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
           .Where(method => method.GetCustomAttribute<RPC>() == null)
           .Select(method => method.Name)
           .ToList()
           .ForEach(Console.WriteLine);
}

[AttributeUsage(AttributeTargets.Method)]
public class RPC : Attribute
{
}

public class NetworkBehavior
{
}

public class ControlCharacter : NetworkBehavior
{
    [RPC] 
    public void Move() { }

    public void DrawHud() { }
}




Csharp

Related
T SQL Format GetDate() Code Example T SQL Format GetDate() Code Example
how to seperate front of decimal and back of decimal in C# Code Example how to seperate front of decimal and back of decimal in C# Code Example
Acrylic UWP Title bar C# Code Example Acrylic UWP Title bar C# Code Example
encrypt password easiest way in web app .net Code Example encrypt password easiest way in web app .net Code Example
how to make a 2d character move in unity 2020 Code Example how to make a 2d character move in unity 2020 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13