public override void DestroyGenericArgumentState(Single value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
        {
            var r = state.ReferenceValue;

            JniObjectReference.Dispose(ref r);
            state = new JniValueMarshalerState();
        }
Пример #2
0
        internal static void DestroyArgumentState <TArray> (IList <T>?value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
            where TArray : JavaArray <T>
        {
            var source = (TArray?)state.PeerableValue;

            if (source == null)
            {
                return;
            }

            synchronize = GetCopyDirection(synchronize);
            if ((synchronize & ParameterAttributes.Out) == ParameterAttributes.Out)
            {
                var arrayDest = value as T[];
                var listDest  = value as IList <T>;
                if (arrayDest != null)
                {
                    source.CopyTo(arrayDest, 0);
                }
                else if (listDest != null)
                {
                    source.CopyToList(listDest, 0);
                }
            }

            if (source.forMarshalCollection)
            {
                source.Dispose();
            }

            state = new JniValueMarshalerState();
        }
Пример #3
0
        public override void DestroyGenericArgumentState(object value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
        {
            var vm = state.Extra as JniValueMarshaler;

            if (vm != null)
            {
                vm.DestroyArgumentState(value, ref state, synchronize);
                return;
            }
            var r = state.ReferenceValue;

            JniObjectReference.Dispose(ref r);
            state = new JniValueMarshalerState();
        }
Пример #4
0
 public abstract void                    DestroyArgumentState(object value, ref JniValueMarshalerState state, ParameterAttributes synchronize = 0);
Пример #5
0
 public override void DestroyGenericArgumentState(T value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
 {
     ValueMarshaler.DestroyArgumentState(value, ref state, synchronize);
 }
Пример #6
0
 public override void DestroyArgumentState(object value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
 {
     throw new NotSupportedException();
 }
Пример #7
0
 public override void DestroyGenericArgumentState(IList <T> value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
 {
     JavaArray <T> .DestroyArgumentState <JavaObjectArray <T> > (value, ref state, synchronize);
 }
 public override void DestroyGenericArgumentState(IntPtr value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
 {
     throw new NotImplementedException();
 }