Example #1
0
        private void Execute(Boolean replace)
        {
            bookmarks.Clear();
            object element = null;

            if (cbElementOnly.Checked)
            {
                element = parent.GetActiveWindowElement();
            }

            if (element == null)
            {
                element = parent.Model;
            }

            if (element.GetType() == typeof(Model))
            {
                ((Model)element).TextSearch(
                    bookmarks,
                    tbSearch.Text,
                    tbReplace.Text,
                    cbWholeWords.Checked,
                    cbCaseSensitivity.Checked,
                    replace);
            }
            if (element.GetType() == typeof(Package))
            {
                ((Package)element).TextSearch(
                    bookmarks,
                    tbSearch.Text,
                    tbReplace.Text,
                    cbWholeWords.Checked,
                    cbCaseSensitivity.Checked,
                    replace);
            }
            if (element.GetType() == typeof(Actor))
            {
                ((Actor)element).TextSearch(
                    bookmarks,
                    tbSearch.Text,
                    tbReplace.Text,
                    cbWholeWords.Checked,
                    cbCaseSensitivity.Checked,
                    replace);
            }
            if (element.GetType() == typeof(UseCase))
            {
                ((UseCase)element).TextSearch(
                    bookmarks,
                    tbSearch.Text,
                    tbReplace.Text,
                    cbWholeWords.Checked,
                    cbCaseSensitivity.Checked,
                    replace);
            }
        }