// Implementing IActivityTracking is better than subscribing to ActionEvents, as // extensible workflow based actions (Refactor This, Navigate To, Generate, etc.) // will notify activity tracking, but invoke the action manually, so it doesn't // get reported by ActionEvents public void TrackAction(string actionId) { if (!enabled || ActionIdBlacklist.IsBlacklisted(actionId)) { return; } OnAction(actionId); }
public void TrackActivity(string activityGroup, string activityId, int count = 1) { if (!enabled || activityGroup != "VsAction" || ActionIdBlacklist.IsBlacklisted(activityId)) { return; } // TODO: "BulbAction" gives full type name of quick fix or context action. // IContextActionInfo.Name would give a name to display. Get all context // actions via IContextActionTable.AllActions (refresh when types change // available in ShellPartCatalogueType), keyed on ICAI.ActionKey. // QuickFix doesn't have a name, instance returns bulb actions with text. // Don't think it's possible to get a friendly name OnAction(activityId); }