示例#1
0
            public JniValueMarshaler <T> GetValueMarshaler <T>()
            {
                var m = GetValueMarshaler(typeof(T));
                var r = m as JniValueMarshaler <T>;

                if (r != null)
                {
                    return(r);
                }
                lock (Marshalers) {
                    JniValueMarshaler d;
                    if (Marshalers.TryGetValue(typeof(T), out d))
                    {
                        return((JniValueMarshaler <T>)d);
                    }
                    Marshalers.Add(typeof(T), d = new DelegatingValueMarshaler <T> (m));
                    return((JniValueMarshaler <T>)d);
                }
            }
示例#2
0
            public JniValueMarshaler <T> GetValueMarshaler <T>()
            {
                if (disposed)
                {
                    throw new ObjectDisposedException(GetType().Name);
                }

                var m = GetValueMarshaler(typeof(T));
                var r = m as JniValueMarshaler <T>;

                if (r != null)
                {
                    return(r);
                }
                lock (Marshalers) {
                    JniValueMarshaler d;
                    if (!Marshalers.TryGetValue(typeof(T), out d))
                    {
                        Marshalers.Add(typeof(T), d = new DelegatingValueMarshaler <T> (m));
                    }
                    return((JniValueMarshaler <T>)d);
                }
            }