コード例 #1
0
        public override void DestroyGenericArgumentState(Single value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
        {
            var r = state.ReferenceValue;

            JniObjectReference.Dispose(ref r);
            state = new JniValueMarshalerState();
        }
コード例 #2
0
ファイル: JavaArray.cs プロジェクト: yang-er/java.interop
        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);
 }
コード例 #8
0
 public override void DestroyGenericArgumentState(IntPtr value, ref JniValueMarshalerState state, ParameterAttributes synchronize)
 {
     throw new NotImplementedException();
 }