public void Swap(string newKey, StringComparison comparison = CASESENSITIVE) { if (this.TryGetKvp(newKey, comparison, out KeyValuePair <string, object> foundKvp)) { ISwappable iswap = DictionarySwap.New(newKey, foundKvp); this.Swap(iswap); } else { throw new KeyNotFoundException(string.Format(ERR_MSG, newKey)); } }
public ISwappable NewSwappable(string newKey, string oldKey, StringComparison comparison = CASESENSITIVE) { if (!base.ContainsKey(newKey) && this.TryGetKvp(oldKey, comparison, out KeyValuePair <string, object> outKvp)) { return(DictionarySwap.New(newKey, outKvp)); } else { throw new KeyNotFoundException(string.Format(ERR_MSG, oldKey)); } }