Example #1
0
        public void UpdateInlineString(InlineString inlineString)
        {
            var oldInlineString = this._inlineStringsSet.InlineStrings.Find(e => e.GUID == inlineString.GUID);

            oldInlineString.Id      = inlineString.Id;
            oldInlineString.Strings = inlineString.Strings;
        }
Example #2
0
        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;
        }
Example #3
0
        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;
            }
        }
Example #4
0
        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();
        }
Example #5
0
 public bool Equals(InlineString other)
 {
     return(string.Equals(this.GUID, other.GUID));
 }
Example #6
0
        public void RemoveInlineString(InlineString inlineString)
        {
            InlineString stringToRemove = this._inlineStringsSet.InlineStrings.Find(e => e.GUID == inlineString.GUID);

            this._inlineStringsSet.InlineStrings.Remove(stringToRemove);
        }
Example #7
0
 public void AddInlineString(InlineString inlineString)
 {
     this._inlineStringsSet.InlineStrings.Add(inlineString);
 }