private void OnFormatItemsChanged(object sender, FormatItemsEventArgs args) { if (args.ChangedItems.Any(i => i == JumpLabelFirstMotionFormatDef.FMT_NAME)) { ReloadColors(); Debug.WriteLine("VsSettings.OnFormatItemsChanged, FG={JumpLabelFirstMotionForegroundColor.Color} BG={JumpLabelFirstMotionBackgroundColor}"); Debug.WriteLine("VsSettings.OnFormatItemsChanged Setting GeneralOptions FG & BG"); GeneralOptions.Instance.JumpLabelFirstMotionForegroundColor = GeneralOptions.toDrawingColor(this.JumpLabelFirstMotionForegroundColor.Color); GeneralOptions.Instance.JumpLabelFirstMotionBackgroundColor = GeneralOptions.toDrawingColor(this.JumpLabelFirstMotionBackgroundColor.Color); } else if (args.ChangedItems.Any(i => i == JumpLabelFinalMotionFormatDef.FMT_NAME)) { ReloadColors(); Debug.WriteLine("VsSettings.OnFormatItemsChanged, FG={JumpLabelFinalMotionForegroundColor.Color} BG={JumpLabelFinalMotionBackgroundColor}"); Debug.WriteLine("VsSettings.OnFormatItemsChanged Setting GeneralOptions FG & BG"); GeneralOptions.Instance.JumpLabelFinalMotionForegroundColor = GeneralOptions.toDrawingColor(this.JumpLabelFinalMotionForegroundColor.Color); GeneralOptions.Instance.JumpLabelFinalMotionBackgroundColor = GeneralOptions.toDrawingColor(this.JumpLabelFinalMotionBackgroundColor.Color); } }
private void ShowNotificationsIfAny() { var pkgVersion = System.Version.Parse(GeneralOptions.getCurrentVersion()); System.Version cfgPkgVersion; try { cfgPkgVersion = System.Version.Parse(GeneralOptions.Instance.getInstalledVersionStr()); } catch (Exception ex) { Trace.Write($"Failed to parse package version stored(if there was any) in options registry! Exception: {ex.ToString()}"); cfgPkgVersion = pkgVersion; //System.Version.Parse("0.0.0"); //TODO!!!! for release - change to =pkgVersion!! No notification is needed for 'whats new' } Debug.WriteLine($"cfgPkgVersion = {cfgPkgVersion} | pkgVersion = {pkgVersion}"); if (!InfoBarService.Instance.anyInfoBarActive() && (pkgVersion > cfgPkgVersion)) { InfoBarService.Instance.ShowInfoBar(new WhatsNewNotification(), new Action(() => { // in case info bar is closed propeprly, stop showing notification GeneralOptions.Instance.setInstalledVersionToCurrentPkgVersion(); GeneralOptions.Instance.Save(); }) ); } }