Исходный код вики Сценарии

Версия 1.6 от Alexandr Fokin на 2023/05/31 09:59

Скрыть последних авторов
Alexandr Fokin 1.5 1 |(% style="width:174px" %) |(% style="width:1348px" %)Find Types in All Assemblies
Alexandr Fokin 1.4 2 [[https:~~/~~/stackoverflow.com/questions/4692340/find-types-in-all-assemblies>>https://stackoverflow.com/questions/4692340/find-types-in-all-assemblies]]
Alexandr Fokin 1.5 3 |(% style="width:174px" %) |(% style="width:1348px" %)(((
Alexandr Fokin 1.2 4 Find a private field with Reflection?
Alexandr Fokin 1.1 5 [[https:~~/~~/stackoverflow.com/questions/95910/find-a-private-field-with-reflection>>https://stackoverflow.com/questions/95910/find-a-private-field-with-reflection]]
Alexandr Fokin 1.2 6
7 Using C# reflection to call a constructor
8 [[https:~~/~~/stackoverflow.com/questions/3255697/using-c-sharp-reflection-to-call-a-constructor>>https://stackoverflow.com/questions/3255697/using-c-sharp-reflection-to-call-a-constructor]]
Alexandr Fokin 1.3 9
10 Invoke method by MethodInfo
11 [[https:~~/~~/stackoverflow.com/questions/919826/invoke-method-by-methodinfo>>https://stackoverflow.com/questions/919826/invoke-method-by-methodinfo]]
Alexandr Fokin 1.2 12 )))
Alexandr Fokin 1.5 13 |(% style="width:174px" %)Получение типа независимо от nullable|(% style="width:1348px" %){{code language="c#"}}PropertyInfo prop;
14 var type = Nullable.GetUnderlyingType(prop.PropertyType)
15 ?? prop.PropertyType;{{/code}}
Alexandr Fokin 1.6 16 |(% style="width:174px" %)Формирование конкретного типа на основе Generic|(% style="width:1348px" %)(((
17 Type.MakeGenericType
18 [[https:~~/~~/learn.microsoft.com/ru-ru/dotnet/api/system.type.makegenerictype?view=net-7.0>>https://learn.microsoft.com/ru-ru/dotnet/api/system.type.makegenerictype?view=net-7.0]]
Alexandr Fokin 1.1 19
Alexandr Fokin 1.6 20 C# Type MakeGenericType
21 [[http:~~/~~/www.java2s.com/Tutorials/CSharp/System/Type/C_Type_MakeGenericType.htm>>http://www.java2s.com/Tutorials/CSharp/System/Type/C_Type_MakeGenericType.htm]]
22 )))
23
Alexandr Fokin 1.1 24