Killers0992
Killers0992
CC#
Created by Killers0992 on 11/15/2024 in #help
Generated assembly with xml file which contains all documentation
No description
3 replies
CC#
Created by Killers0992 on 2/28/2024 in #help
Problems with sharp compress | ZlibException: Bad state (incomplete literal/length tree
No description
1 replies
CC#
Created by Killers0992 on 1/28/2024 in #help
✅ Get delegate from event
I got class
public static class Events
{
public static PlayerEvents Player { get; } = new PlayerEvents();
}
public static class Events
{
public static PlayerEvents Player { get; } = new PlayerEvents();
}
and PlayerEvents class contains
public class PlayerEvents
{
public event Event<PlayerLeftServer> Leaving;

public event Event<PlayerLeftServer> Left;
}
public class PlayerEvents
{
public event Event<PlayerLeftServer> Leaving;

public event Event<PlayerLeftServer> Left;
}
I want to get delegate from Leaving/Left event but seems like while trying to get value its null? idk
foreach (var property in typeof(Events).GetProperties(BindingFlags.Public | BindingFlags.Static))
{
foreach (var ev in property.PropertyType.GetEvents())
{
FieldInfo evField = property.PropertyType.GetField(ev.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField);

// GetValue returns null
Debug.Log(evField.GetValue(property.GetValue(null, null)));
}
}
foreach (var property in typeof(Events).GetProperties(BindingFlags.Public | BindingFlags.Static))
{
foreach (var ev in property.PropertyType.GetEvents())
{
FieldInfo evField = property.PropertyType.GetField(ev.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField);

// GetValue returns null
Debug.Log(evField.GetValue(property.GetValue(null, null)));
}
}
22 replies
CC#
Created by Killers0992 on 9/17/2022 in #help
How add analyzer for suggesting to add missing parameters or removing them?
1 replies
CC#
Created by Killers0992 on 9/16/2022 in #help
Login via external provider.
12 replies
CC#
Created by Killers0992 on 9/15/2022 in #help
How I can make ASP.NET project not suck from services controllers side.
3 replies