private DictionaryCheckResult GetKey(string value) { DictionaryCheckResult returnValue; if (keywordsDictionary.TryGetValue(value, out var key)) { returnValue = new DictionaryCheckResult(false, key); } else { returnValue = new DictionaryCheckResult(true, keywordsDictionary.Count); keywordsDictionary.Add(value, returnValue.Key); } return(returnValue); }
private DictionaryCheckResult GetKey(string value) { DictionaryCheckResult returnValue; int key; if (keywordsDictionary.TryGetValue(value, out key)) { returnValue = new DictionaryCheckResult() { Key = key, IsNew = false }; } else { returnValue = new DictionaryCheckResult() { Key = keywordsDictionary.Count, IsNew = true }; keywordsDictionary.Add(value, returnValue.Key); } return returnValue; }
private DictionaryCheckResult GetKey(string value) { DictionaryCheckResult returnValue; int key; if (keywordsDictionary.TryGetValue(value, out key)) { returnValue = new DictionaryCheckResult() { Key = key, IsNew = false }; } else { returnValue = new DictionaryCheckResult() { Key = keywordsDictionary.Count, IsNew = true }; keywordsDictionary.Add(value, returnValue.Key); } return(returnValue); }