Exemplo n.º 1
0
        /// <summary>
        /// Handles the Click event of the searchToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void searchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var form = new FormText())
            {
                form.Text = "Искать...";
                if (form.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                var searchText = form.Value.Trim().ToLower();
                if (string.IsNullOrEmpty(searchText))
                {
                    return;
                }

                DoSearch(searchText);
                return;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the Click event of the fillToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void fillToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <string> names;

            using (var form = new FormText())
            {
                form.Text = "Вставьте список из штаба";
                if (form.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                names = User.ParseUserNameList(form.Value);
            }
            foreach (var name in names)
            {
                data.Add(new CowInfo {
                    UserName = name, Coulomb = Coulomb.Undefined
                });
            }
        }