protected override void Initialize() { DiscordRpc.Initialize( Config.Instance.ApplicationId, ref eh, true, null ); dte = (DTE)GetService(typeof(SDTE)); events = dte.Events; timestamp = DiscordRpc.GetTimestamp(); rp.startTimestamp = null; rp.endTimestamp = null; rp.largeImageKey = "visualstudio"; rp.largeImageText = "Visual Studio"; DiscordRpc.UpdatePresence(rp); DiscordRpc.RunCallbacks(); events.SolutionEvents.Opened += SolutionEvents_Opened; events.SolutionEvents.AfterClosing += SolutionEvents_Closed; events.WindowEvents.WindowActivated += WindowEvents_WindowActivated; base.Initialize(); Log.Info("Initialized."); }
void CheckTimestamp() { if (Config.Instance.ShowTimestamp) { if (Config.Instance.AutoResetTimestamp) { rp.startTimestamp = DiscordRpc.GetTimestamp(); } else { rp.startTimestamp = timestamp; } } else { rp.startTimestamp = null; rp.endTimestamp = null; } }