![]() |
#15 |
Участник
|
Цитата:
Я думал что, например, такой код из C# X++: System.Collections.Generic.List<int> l = new System.Collections.Generic.List<int>(); l.Add(1); l.Add(2); Console.WriteLine(l.Count); X++: static void Job67(Args _args) { System.Type type; System.Object myIntList; System.Reflection.MethodInfo methodAdd; System.Reflection.PropertyInfo propertyCount; System.Object[] parameters; System.Object[] nil; System.Object nl; int cnt; ; type = System.Type::GetType("System.Collections.Generic.List`1[System.Int32]"); myIntList = System.Activator::CreateInstance(type); methodAdd = type.GetMethod("Add"); parameters = new System.Object[1](); parameters.SetValue(1, 0); methodAdd.Invoke(myIntList, parameters); parameters.SetValue(2, 0); methodAdd.Invoke(myIntList, parameters); propertyCount = type.GetProperty("Count"); nil = new System.Object[0](); cnt = propertyCount.GetValue(myIntList, nil); info(strFmt("%1", cnt)); } |
|
|
За это сообщение автора поблагодарили: mazzy (2), Lemming (1), alexbn (1), sukhanchik (6), Logger (10), b_nosoff (1), Morpheus (2), coolibin (3), Krasher (1), perestoronin (1), S.Kuskov (3), plumbum (3), Cardagant (1), Товарищ ♂uatr (1), MazZzDaI (1). |
Теги |
.net, clr, generic, type parameters, полезное |
|
|