internal bool TryGetValue <K, V>(K key, out V value) { if (key == null) { throw new ArgumentNullException("key"); } IMap <K, V> map = JitHelpers.UnsafeCast <IMap <K, V> >(this); if (!map.HasKey(key)) { value = default(V); return(false); } bool result; try { value = MapToDictionaryAdapter.Lookup <K, V>(map, key); result = true; } catch (KeyNotFoundException) { value = default(V); result = false; } return(result); }
internal void Indexer_Set <K, V>(K key, V value) { if ((object)key == null) { throw new ArgumentNullException("key"); } MapToDictionaryAdapter.Insert <K, V>(JitHelpers.UnsafeCast <IMap <K, V> >((object)this), key, value); }
internal V Indexer_Get <K, V>(K key) { if ((object)key == null) { throw new ArgumentNullException("key"); } return(MapToDictionaryAdapter.Lookup <K, V>(JitHelpers.UnsafeCast <IMap <K, V> >((object)this), key)); }
internal V Indexer_Get <K, V>(K key) { if (key == null) { throw new ArgumentNullException("key"); } IMap <K, V> this2 = JitHelpers.UnsafeCast <IMap <K, V> >(this); return(MapToDictionaryAdapter.Lookup <K, V>(this2, key)); }
internal void Add <K, V>(K key, V value) { if ((object)key == null) { throw new ArgumentNullException("key"); } if (this.ContainsKey <K, V>(key)) { throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate")); } MapToDictionaryAdapter.Insert <K, V>(JitHelpers.UnsafeCast <IMap <K, V> >((object)this), key, value); }
internal bool TryGetValue <K, V>(K key, out V value) { if ((object)key == null) { throw new ArgumentNullException("key"); } IMap <K, V> _this = JitHelpers.UnsafeCast <IMap <K, V> >((object)this); if (!_this.HasKey(key)) { value = default(V); return(false); } try { value = MapToDictionaryAdapter.Lookup <K, V>(_this, key); return(true); } catch (KeyNotFoundException ex) { value = default(V); return(false); } }