protected override void OnTextChanged(EventArgs e)
        {
            if (linkText != null && linkText.Count > 0)
            {
                int p = this.SelectionStart;
                if (p > 0)
                {
                    Select(p - 1, 1);
                }
                if (GetSelectionLink() == 1)
                {
                    return;
                }
                SelectedRtf = "";
                if (!this.Rtf.Contains("\\v0"))
                {
                    currentText = "";
                    linkText.Clear();
                }
                if (linkText.Count > 0)                                          // Text.Length > linkText.Count)
                {
                    currentText = Text.Substring(Text.LastIndexOf("#Edit") + 5); //Text.Substring(Text.IndexOf(linkText[linkText.Keys[linkText.Count - 1].]) + linkText.Values[linkText.Count - 1].Lenght);
                }
                else
                {
                    currentText = "";
                }
            }
            else
            {
                currentText = Text;
            }

            IsEmail = IsFax = false;
            if (currentText.Trim().Length > 0 && SearchType)
            {
                if (Regex.IsMatch(currentText.Trim(), "([A-Za-z0-9]+([-+._][A-Za-z0-9]+)*@[A-Za-z0-9]+([-._][A-Za-z0-9]+)*.[A-Za-z]{2,})"))
                {
                    IsEmail = true;
                }
                else
                {
                    if (Regex.IsMatch(currentText.Trim().Replace(" ", ""), "^(\\+\\d|\\d).*\\d.*\\d"))
                    {
                        IsFax = true;
                    }
                }
            }
            else
            if (Pids != null)
            {
                Pids.Clear();
            }

            base.OnTextChanged(e);
        }
예제 #2
0
        private void UpdateAppListData(RzAppListDataProvider app)
        {
            Apps.Clear();
            Pids.Clear();
            CurrentApp = app.CurrentAppExecutable;
            for (int i = 0; i < app.AppCount; i++)
            {
                Apps.Add(app.GetExecutableName(i));
                Pids.Add(app.GetPid(i));
            }

            AppListUpdated?.Invoke(this, EventArgs.Empty);
        }