/// <summary> /// 補完候補を表示する /// </summary> /// <param name="key_char">入力しようとしていた文字列</param> /// <param name="force">補完候補がなくても表示するなら真。そうでないなら偽</param> public void OpenCompleteBox(string key_char, bool force = false) { if (!this.Enabled) { return; } if (this.GetPostion == null) { throw new InvalidOperationException("GetPostionがnullです"); } Point p = this.GetPostion(this.Document.CaretPostion, this.Document); ShowingCompleteBoxEventArgs ev = new ShowingCompleteBoxEventArgs(key_char, this.Document, p); ShowingCompleteBox(this, ev); bool hasCompleteItem = ev.foundIndex != -1 && ev.inputedWord != null && ev.inputedWord != string.Empty && ev.inputedWord.Length >= InputLength; System.Diagnostics.Debug.WriteLine("hasCompleteItem:{0}", hasCompleteItem); if (force || hasCompleteItem) { RequestShowCompleteBox(ev); } else { RequestCloseCompleteBox(); } }
/// <summary> /// 補完候補の表示要求を処理する /// </summary> /// <param name="ev"></param> protected virtual void RequestShowCompleteBox(ShowingCompleteBoxEventArgs ev) { }