@@ -69,6 +69,21 @@ impl<T> List<T> {
69
69
add ( self , element, method) ;
70
70
}
71
71
72
+ pub fn insert ( & mut self , index : i32 , element : & ' static mut T ) {
73
+ let method = self . get_class ( )
74
+ . get_methods ( )
75
+ . iter ( )
76
+ . find ( |method| method. get_name ( ) == Some ( String :: from ( "Insert" ) ) )
77
+ . unwrap ( ) ;
78
+
79
+ let insert = unsafe {
80
+ std:: mem:: transmute :: < _ , extern "C" fn ( & mut Self , i32 , & ' static mut T , & MethodInfo ) > (
81
+ method. method_ptr ,
82
+ )
83
+ } ;
84
+
85
+ insert ( self , index, element, method) ;
86
+ }
72
87
pub fn len ( & self ) -> usize {
73
88
self . size as _
74
89
}
@@ -168,7 +183,30 @@ impl<TKey, TValue> Dictionary<TKey, TValue> {
168
183
169
184
add ( self , key, value, method. method_info ) ;
170
185
}
171
-
186
+ pub fn remove ( & self , key : TKey ) {
187
+ let method = self . get_class ( )
188
+ . get_virtual_method ( "Remove" )
189
+ . unwrap ( ) ;
190
+
191
+ let remove = unsafe {
192
+ std:: mem:: transmute :: < _ , extern "C" fn ( & Self , TKey , & MethodInfo ) > (
193
+ method. method_info . method_ptr ,
194
+ )
195
+ } ;
196
+ remove ( self , key, method. method_info ) ;
197
+ }
198
+ pub fn get_count ( & self ) -> i32 {
199
+ let method = self . get_class ( )
200
+ . get_virtual_method ( "get_Count" )
201
+ . unwrap ( ) ;
202
+
203
+ let count = unsafe {
204
+ std:: mem:: transmute :: < _ , extern "C" fn ( & Self ) -> i32 > (
205
+ method. method_info . method_ptr ,
206
+ )
207
+ } ;
208
+ count ( self )
209
+ }
172
210
pub fn try_get_value < ' a > ( & self , key : TKey , value : & ' a mut TValue ) -> bool {
173
211
let method = self . get_class ( )
174
212
. get_virtual_method ( "TryGetValue" )
0 commit comments