Created
July 25, 2019 10:18
-
-
Save marek-safar/7ab38b550cdb71dba987c00480f7bfa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerator<ConstructorInfo> e = typeInfo.DeclaredConstructors.GetEnumerator(); | |
do { | |
ConstructorInfo constructorInfo = e.Current(); | |
if (!constructorInfo.IsStatic && constructorInfo.GetParameters.Length() == 0) { | |
inst = constructorInfo.Invoke(null); | |
break; | |
} | |
} while (e.MoveNext()) | |
inst = Activator.CreateInstance (type); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment