Ejemplo n.º 1
0
            public object this[int index] {
                get {
                    index = PythonOps.FixIndex(index, ((ArrayType)NativeType).Length);
                    INativeType elementType = ElementType;
                    return(elementType.GetValue(
                               MemHolder,
                               this,
                               checked (index * elementType.Size),
                               false
                               ));
                }
                set {
                    index = PythonOps.FixIndex(index, ((ArrayType)NativeType).Length);
                    INativeType elementType = ElementType;

                    object keepAlive = elementType.SetValue(
                        MemHolder,
                        checked (index * elementType.Size),
                        value
                        );

                    if (keepAlive != null)
                    {
                        MemHolder.AddObject(index.ToString(), keepAlive);
                    }
                }
            }
Ejemplo n.º 2
0
 public void Setvalue(object value)
 {
     NativeType.SetValue(MemHolder, 0, value);
     if (IsString)
     {
         MemHolder.AddObject("str", value);
     }
 }
Ejemplo n.º 3
0
            public object this[int index] {
                get {
                    INativeType  type    = ((PointerType)NativeType)._type;
                    MemoryHolder address = MemHolder.ReadMemoryHolder(0);

                    return(type.GetValue(address, this, checked (type.Size * index), false));
                }
                set {
                    MemoryHolder address = MemHolder.ReadMemoryHolder(0);

                    INativeType type      = ((PointerType)NativeType)._type;
                    object      keepAlive = type.SetValue(address, checked (type.Size * index), value);
                    if (keepAlive != null)
                    {
                        MemHolder.AddObject(index.ToString(), keepAlive);
                    }
                }
            }