string GetIDEName(string selectorPattern)
{
try
{
Match m = GetMatchingPattern(DTEService.Get().MainWindow.Caption, selectorPattern);
if (!m.Success || m.Groups.Count < 2)
return null;
if (m.Groups.Count >= 3)
return m.Groups[2].Captures[0].Value;
return m.Groups[1].Captures[0].Value;
}
catch (Exception ex)
{
mLog.LogEntry(
(UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR,
"WindowTitleBuilder",
string.Format("Couldn't get IDE name: {0}", ex.Message));
}
return string.Empty;
}