Изменения документа Сценарии
Редактировал(а) Alexandr Fokin 2024/09/30 14:14
От версии 1.2
отредактировано Alexandr Fokin
на 2022/12/07 07:45
на 2022/12/07 07:45
Изменить комментарий:
К данной версии нет комментариев
К версии 1.6
отредактировано Alexandr Fokin
на 2023/05/31 09:59
на 2023/05/31 09:59
Изменить комментарий:
К данной версии нет комментариев
Сводка
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -1,11 +1,24 @@ 1 -|(% style="width:123px" %) |(% style="width:1340px" %)((( 1 +|(% style="width:174px" %) |(% style="width:1348px" %)Find Types in All Assemblies 2 +[[https:~~/~~/stackoverflow.com/questions/4692340/find-types-in-all-assemblies>>https://stackoverflow.com/questions/4692340/find-types-in-all-assemblies]] 3 +|(% style="width:174px" %) |(% style="width:1348px" %)((( 2 2 Find a private field with Reflection? 3 3 [[https:~~/~~/stackoverflow.com/questions/95910/find-a-private-field-with-reflection>>https://stackoverflow.com/questions/95910/find-a-private-field-with-reflection]] 4 4 5 5 Using C# reflection to call a constructor 6 6 [[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]] 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]] 7 7 ))) 8 -|(% style="width:123px" %) |(% style="width:1340px" %) 9 -|(% style="width:123px" %) |(% style="width:1340px" %) 13 +|(% style="width:174px" %)Получение типа независимо от nullable|(% style="width:1348px" %){{code language="c#"}}PropertyInfo prop; 14 +var type = Nullable.GetUnderlyingType(prop.PropertyType) 15 + ?? prop.PropertyType;{{/code}} 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]] 10 10 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 + 11 11