diff --git a/README.md b/README.md index e964ee3..ebb44ff 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # BlubbFish.Utils (Utils) Library containing helpfull utils + +Maybe you find this Repo on Github. This is a mirror from [here](https://git.blubbfish.net/vs_utils/Utils). \ No newline at end of file diff --git a/Utils/Helper.cs b/Utils/Helper.cs index 7aa8b63..9f92a99 100644 --- a/Utils/Helper.cs +++ b/Utils/Helper.cs @@ -49,10 +49,12 @@ namespace BlubbFish.Utils { FieldInfo field = o.GetType().GetField(name); return field.IsPublic ? field.GetValue(o) : null; } + public static Object GetField(this Type o, String name) { FieldInfo field = o.GetField(name); return field.IsPublic ? field.GetValue(o) : null; } + public static T GetEvent(this Object o, String name) { FieldInfo field = o.GetType().GetField(name, BindingFlags.Instance | BindingFlags.NonPublic); return (T)field?.GetValue(o);