private void byTheWindowTitleTextregexToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.lstProcesses.SelectedItem == null) return;
ProcessDetails pd = ((ProcessDetails)this.lstProcesses.SelectedItem);
if (!pd.Manageable)
return;
//TODO move to controller
if (controller.Favorites.CanAdd(pd.WindowTitle))
{
string res = Tools.Input_Text("Add to favorites by RegEx string", "Regex string (see the Help menu for reference)", pd.WindowTitle);
if (res.Trim().Length > 0)
{
Favorites.Favorite fav = new Favorites.Favorite();
fav.Kind = Favorites.Favorite.FavoriteKinds.ByRegexString;
fav.SearchText = res;
controller.Favorites.Add(fav);
}
}
}