public void SetValue(int index, TextReplacerValue replacerValue) { if (index < 0) { return; } if (index < this._values.Length) { this._values[index] = replacerValue; } if (index >= this._values.Length) { List <TextReplacerValue> list = new List <TextReplacerValue>(this._values); for (int i = this._values.Length; i < index; i++) { if (i == index) { list.Add(replacerValue); } else { list.Add(default(TextReplacerValue)); } } } this.Apply(); }
public bool TryGetValue(int index, out TextReplacerValue result) { if (index >= this._values.Length) { result = default(TextReplacerValue); return(false); } result = this._values[index]; return(true); }