コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="opt"></param>
        /// <returns></returns>
        internal async Task OnOptionClick(MentionsOption opt)
        {
            // update to status of  all of suggestion to un-selected state
            foreach (var item in LstOriginalOptions)
            {
                item.Selected = false;
            }

            // when the suggestion clicked is not null and enable, then change the value of textarea.
            if (opt != null && !opt.Disable)
            {
                if (string.IsNullOrEmpty(this.Value))
                {
                    this.Value = opt.Value + this.Split;
                }
                else
                {
                    this.Value = this.Value + opt.Value + this.Split;
                }
            }

            ShowSuggestions = false;

            await InvokeStateHasChangedAsync();
        }
コード例 #2
0
        public void AddOption(MentionsOption option)
        {
            if (option == null)
            {
                return;
            }
            var opt = LstOriginalOptions.Find(x => x.Value == option.Value);

            if (opt == null)
            {
                LstOriginalOptions.Add(option);
            }
        }
コード例 #3
0
 public void RemoveOption(MentionsOption option)
 {
     LstOriginalOptions.Remove(option);
 }