示例#1
0
        public void OnImportsSatisfied()
        {
            TrackSettings(global::ColumnGuide.Telemetry.CreateInitializeTelemetryItem(nameof(ColumnGuideAdornmentFactory) + " initialized"));

            GuidelineBrush.BrushChanged += (sender, newBrush) =>
            {
                Telemetry.Client.TrackEvent("GuidelineColorChanged", new Dictionary <string, string> {
                    ["Color"] = newBrush.ToString(InvariantCulture)
                });
            };

            if (TextEditorGuidesSettings is INotifyPropertyChanged settingsChanged)
            {
                settingsChanged.PropertyChanged += OnSettingsChanged;
            }

            // Show a warning dialog if running in an old version of VS
            if (IsRunningInOldVsVersion() && !TextEditorGuidesSettings.DontShowVsVersionWarning)
            {
                Telemetry.Client.TrackEvent("ShowDeprecationWarning");
                ThreadHelper.Generic.BeginInvoke(DispatcherPriority.Background, () =>
                {
                    var dlg = new OldVsVersionDialog();
                    if (dlg.ShowModal() == true && dlg.DontShowAgain)
                    {
                        Telemetry.Client.TrackEvent("DontShowDeprecationWarningAgain");
                        TextEditorGuidesSettings.DontShowVsVersionWarning = true;
                    }
                });
            }
        }
        public void OnImportsSatisfied()
        {
            if (TextEditorGuidesSettings is INotifyPropertyChanged settingsChanged)
            {
                settingsChanged.PropertyChanged += OnSettingsChanged;
            }

            // Show a warning dialog if running in an old version of VS
            if (IsRunningInOldVsVersion() && !TextEditorGuidesSettings.DontShowVsVersionWarning)
            {
                ThreadHelper.Generic.BeginInvoke(DispatcherPriority.Background, () =>
                {
                    var dlg = new OldVsVersionDialog();
                    if (dlg.ShowModal() == true && dlg.DontShowAgain)
                    {
                        TextEditorGuidesSettings.DontShowVsVersionWarning = true;
                    }
                });
            }
        }