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); } }
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); } }