| | |
| | | } |
| | | } |
| | | |
| | | public bool emptyCreate = false; |
| | | public bool emptyCreate = true; |
| | | //List<dict> _list = null; |
| | | public dict() : base() |
| | | { |
| | |
| | | { |
| | | get |
| | | { |
| | | if (!this.ContainsKey(key)) this.Add(key, default(TValue)); |
| | | if (!this.ContainsKey(key)) |
| | | { |
| | | lock (this) |
| | | { |
| | | if (!this.ContainsKey(key)) |
| | | { |
| | | if (emptyCreate) |
| | | this.Add(key, default(TValue)); |
| | | else |
| | | return default(TValue); |
| | | } |
| | | } |
| | | } |
| | | return base[key]; |
| | | |
| | | } |
| | | set |
| | | { |
| | | if (this.ContainsKey(key)) base[key] = value; |
| | | else this.Add(key, value); |
| | | if (!this.ContainsKey(key)) |
| | | { |
| | | lock (this) |
| | | { |
| | | if (!this.ContainsKey(key)) |
| | | { |
| | | if (emptyCreate) |
| | | this.Add(key, value); |
| | | else |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | base[key] = value; |
| | | } |
| | | |
| | | } |