List<UserInfo> userInfoList = castToList(api.UserGroupMemberList(newGroup));
public static <T extends List<?>> T castToList(Object obj) {
IEnumerator enumerator = ((IEnumerable) obj).GetEnumerator();
List<Object> list = new ArrayList<>();
while (enumerator.MoveNext()) {
list.add(enumerator.getCurrent());
}
return (T) list;
IDictionaryEnumerator enumerator = ((IDictionary) readMsg.getAttachments()).GetEnumerator();
enumerator.MoveNext();
enumerator.getCurrent();enumerator.getKey();enumerator.getValue();Looks like returned Object is instance of __Enumerable class, and I can't cast it to something related to IDictionary/IDictionaryEnumerator((
@ClrMethod("()[[[LSystem/Collections/Generic/Dictionary`2;")
public native Object getAttachments();
methods.Add(global::net.sf.jni4net.jni.JNINativeMethod.Create(@__type, "getAttachments", "Attachments6", "()Lsystem/Object;"));
...
private static global::net.sf.jni4net.utils.JniHandle Attachments6(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj) {
// ()Lsystem/Object;
// ()[[[LSystem/Collections/Generic/Dictionary`2;
global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
global::net.sf.jni4net.utils.JniHandle @__return = default(global::net.sf.jni4net.utils.JniHandle);
try {
global::SomeLibrary.SomeClass @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C<global::SomeLibrary.SomeClass>(@__env, @__obj);
@__return = global::net.sf.jni4net.utils.Convertor.StrongC2Jp<global::System.Collections.Generic.Dictionary<string, object>>(@__env, @__real.Attachments);
}catch (global::System.Exception __ex){@__env.ThrowExisting(__ex);}
return @__return;
}
IDictionaryEnumerator enumerator = Bridge.cast(obj, IDictionary.class).GetEnumerator();
--
--
You received this message because you are subscribed to jni...@googlegroups.com
http://groups.google.com/group/jni4net?hl=en-GB?hl=en-GB
http://jni4net.sf.net/
---
You received this message because you are subscribed to the Google Groups "jni4net" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jni4net+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.