//-------- Helper functions -------- internal bool NavigateToTip(TipInfo nextTip, bool markAsSeen = true) { if (nextTip == null || string.IsNullOrEmpty(nextTip.contentUri)) { // Unable to navigate. No tip content URI. return(false); } currentTip = nextTip.globalTipId; // Render the new tip content in the tip viewer ShowTipContent(nextTip); // Display Group settings UpdateGroupDisplayElements(nextTip); // Mark tip as shown if (markAsSeen) { _tipHistoryManager.MarkTipAsSeen(currentTip); } // Output telemetry: Tip Shown (Consider making this conditional on "markAsSeen") VSTelemetryHelper.PostEvent("Justcla/HotTips/TipShown", "TipId", currentTip); return(true); }
public static void LogTelemetryEvent(VSTipHistoryManager manager, string eventName, params object[] nameAndProperties) { var excludedGroups = manager.GetAllExcludedTipGroups(); var excludedTipLevels = manager.GetAllExcludedTipLevels(); var tipHistory = manager.GetTipHistory(); string excludedGroupStr = string.Join(";", excludedGroups); string excludedLevelStr = string.Join(";", excludedTipLevels.Select(l => l.ToString())); string tipHistoryStr = string.Join(";", tipHistory); var properties = nameAndProperties.Concat( new[] { "ExcludedTipGroups", excludedGroupStr, "ExcludedTipLevels", excludedLevelStr, "TipHistory", tipHistoryStr }).ToArray(); VSTelemetryHelper.PostEvent(eventName, properties); }
private void LogTelemetryEvent(string eventName) { string tipGroupId = GroupNameLabel.Content.ToString(); VSTelemetryHelper.PostEvent(eventName, "TipGroupId", tipGroupId, "TipId", currentTip); }