public void UpdateInlineString(InlineString inlineString) { var oldInlineString = this._inlineStringsSet.InlineStrings.Find(e => e.GUID == inlineString.GUID); oldInlineString.Id = inlineString.Id; oldInlineString.Strings = inlineString.Strings; }
public void AddInlineString() { var newString = new InlineString(this._inlineStringsWindow.InlineStringAliasToAdd, new[] { this._inlineStringsWindow.InlineStringTextToAdd }); if (!this._inlineStringValidator.Validate(newString, out string error)) { EditorUtility.DisplayDialog("Inline string adding error", error, "OK"); return; } if (this._inlineStringsRepository.IsContain(this._inlineStringsWindow.InlineStringAliasToAdd)) { EditorUtility.DisplayDialog("Inline string adding error", $"Inline string with Alias: '{this._inlineStringsWindow.InlineStringAliasToAdd}' already stored.", "OK"); return; } this._inlineStringsRepository.AddInlineString(newString); this._inlineStringsWindow.InlineStringsListView.AddInlineString(newString, this); this._inlineStringsWindow.InlineStringAliasToAdd = string.Empty; this._inlineStringsWindow.InlineStringTextToAdd = string.Empty; }
public void AddInlineString(InlineString inlineString, InlineStringsPresenter inlineStringsPresenter) { InlineStringEditor freeEditor = this._inlineStringEditorsPool.FirstOrDefault(e => e.InlineString == null); if (freeEditor == null) { this._inlineStringEditorsPool.Add(new InlineStringEditor(inlineString, inlineStringsPresenter)); } else { freeEditor.InlineString = inlineString; } }
public InlineStringEditor(InlineString inlineString, InlineStringsPresenter inlineStringsPresenter) { if (inlineStringsPresenter == null) { throw new NullReferenceException(nameof(inlineStringsPresenter)); } if (inlineString == null) { throw new NullReferenceException(nameof(inlineString)); } this._inlineStringsPresenter = inlineStringsPresenter; this._inlineString = inlineString; this._newInlineStringAlias = inlineString.Id; this._newInlineStringStrings = inlineString.Strings.ToArray(); }
public bool Equals(InlineString other) { return(string.Equals(this.GUID, other.GUID)); }
public void RemoveInlineString(InlineString inlineString) { InlineString stringToRemove = this._inlineStringsSet.InlineStrings.Find(e => e.GUID == inlineString.GUID); this._inlineStringsSet.InlineStrings.Remove(stringToRemove); }
public void AddInlineString(InlineString inlineString) { this._inlineStringsSet.InlineStrings.Add(inlineString); }