Horje
c# reflection create generic type Code Example
c# reflection create generic type
Type generic = typeof(Dictionary<,>);

// Create an array of types to substitute for the type parameters of Dictionary. The key is of type string, and the type to be contained in the Dictionary is Test.
Type[] typeArgs = { typeof(string), typeof(Test) };

// Create a Type object representing the constructed generic type.
Type constructed = generic.MakeGenericType(typeArgs);

var instance = Activator.CreateInstance(constructedType);




Csharp

Related
c# make a negative number positive Code Example c# make a negative number positive Code Example
find first occurrence of character in string Code Example find first occurrence of character in string Code Example
center mouse unity Code Example center mouse unity Code Example
how to get image from resource folder in c# Code Example how to get image from resource folder in c# Code Example
linq from list c# Code Example linq from list c# Code Example

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