void RemoveButton_OnClick(IUEditorWidgetClickable sender, EventArgs e) { UEditorWidgetButton __castButton = (UEditorWidgetButton)sender; int __index = __castButton.GetBoundValue <int>(); //If the index is the "new item" we can't remove here if (__index == -1) { return; } this.StringList.RemoveAt(__castButton.GetBoundValue <int>()); BuildPanel(); if (this.onItemRemoved != null) { this.onItemRemoved(this, __index); } }
void AddButton_OnClick(IUEditorWidgetClickable sender, EventArgs e) { UEditorWidgetButton __castButton = (UEditorWidgetButton)sender; int __index = __castButton.GetBoundValue <int>(); if (__index == -1) { this.StringList.Add(string.Empty); } else { this.StringList.Insert((__index), string.Empty); } BuildPanel(); if (this.onItemAdded != null) { this.onItemAdded(this, __index); } }