Beispiel #1
0
 def fn():
     a = ArrayList()
     b = ArrayList()
     a.Add(b)
     c = a.get_Item(0) # type of c is Object
     c = clidowncast(c, ARRAY_LIST)
     c.Add(None)
     return c.get_Item(0)
Beispiel #2
0
 def fn():
     a = ArrayList()
     b = ArrayList()
     a.Add(b)
     c = a.get_Item(0)  # type of c is Object
     c = clidowncast(c, ARRAY_LIST)
     c.Add(None)
     return c.get_Item(0)
Beispiel #3
0
 def fn(flag):
     a = ArrayList()
     a.Add(None)
     if flag:
         obj = cliupcast(a, System.Object)
     else:
         obj = box(42)
     b = clidowncast(obj, ArrayList)
     return b.get_Item(0)
Beispiel #4
0
 def finish_code(self):
     delegatetype = dotnet.typeof(LoopDelegate)
     # initialize the array of genconsts
     consts = dotnet.new_array(System.Object, len(self.consts))
     for av_const, i in self.consts.iteritems():
         consts[i] = av_const.get_cliobj()
     # build the delegate
     func = self.meth_wrapper.create_delegate(delegatetype, consts)
     return dotnet.clidowncast(func, LoopDelegate)
Beispiel #5
0
 def finish_code(self):
     delegatetype = dotnet.typeof(LoopDelegate)
     # initialize the array of genconsts
     consts = dotnet.new_array(System.Object, len(self.consts))
     for av_const, i in self.consts.iteritems():
         consts[i] = av_const.get_cliobj()
     # build the delegate
     func = self.meth_wrapper.create_delegate(delegatetype, consts)
     return dotnet.clidowncast(func, LoopDelegate)
Beispiel #6
0
 def fn(flag):
     a = ArrayList()
     a.Add(None)
     if flag:
         obj = cliupcast(a, System.Object)
     else:
         obj = box(42)
     b = clidowncast(obj, ArrayList)
     return b.get_Item(0)
Beispiel #7
0
 def fn():
     obj = box(c)
     t = clidowncast(obj, System.Type)
     return t.get_Name()
Beispiel #8
0
 def fn(flag):
     if flag:
         x = a
     else:
         x = b
     return clidowncast(box(x), System.Type).get_Name()
Beispiel #9
0
 def fn():
     utils_obj = box(utils_class)
     utils_type = clidowncast(utils_obj, System.Type)
     return utils_type.get_Name()
Beispiel #10
0
 def fn():
     int32_obj = box(int32_class)
     int32_type = clidowncast(int32_obj, System.Type)
     return int32_type.get_Name()
Beispiel #11
0
 def fn():
     obj = box(c)
     t = clidowncast(obj, System.Type)
     return t.get_Name()
Beispiel #12
0
 def fn(flag):
     if flag:
         x = a
     else:
         x = b
     return clidowncast(box(x), System.Type).get_Name()
Beispiel #13
0
 def fn():
     utils_obj = box(utils_class)
     utils_type = clidowncast(utils_obj, System.Type)
     return utils_type.get_Name()
Beispiel #14
0
 def fn():
     int32_obj = box(int32_class)
     int32_type = clidowncast(int32_obj, System.Type)
     return int32_type.get_Name()