Example #1
0
        public MarkerToolTipHandler(MarkerToolTipHandlerProvider provider, ThreadFixPlugin threadFixPlugin, IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin margin)
        {
            _threadFixPlugin = threadFixPlugin;
            _textViewHost = wpfTextViewHost;
            _margin = margin;
            _glyphTagAggregator = provider.ViewTagAggregatorFactoryService.CreateTagAggregator<MarkerTag>(wpfTextViewHost.TextView);
            _popup = new Popup
            {
                IsOpen = false,
                Visibility = Visibility.Hidden
            };

            _textViewHost.Closed += (sender, e) => _glyphTagAggregator.Dispose();
        }
Example #2
0
        public static void DeserializeMarkerData(ThreadFixPlugin threadFixPlugin)
        {
            var solutionName = GetSolutionName();
            if (string.IsNullOrEmpty(solutionName))
            {
                return;
            }

            var path = GetStoredPluginFilePath(solutionName);
            if (File.Exists(path))
            {
                using (var file = File.OpenText(path))
                {
                    var storedData = (StoredPluginData) new JsonSerializer().Deserialize(file, typeof(StoredPluginData));
                    threadFixPlugin.Markers = storedData.Markers;
                    threadFixPlugin.SelectedAppIds = storedData.SelectedAppIds;
                }
            }
        }
Example #3
0
        public static void DeserializeMarkerData(ThreadFixPlugin threadFixPlugin)
        {
            var solutionName = GetSolutionName();

            if (string.IsNullOrEmpty(solutionName))
            {
                return;
            }

            var path = GetStoredPluginFilePath(solutionName);

            if (File.Exists(path))
            {
                using (var file = File.OpenText(path))
                {
                    var storedData = (StoredPluginData) new JsonSerializer().Deserialize(file, typeof(StoredPluginData));
                    threadFixPlugin.Markers        = storedData.Markers;
                    threadFixPlugin.SelectedAppIds = storedData.SelectedAppIds;
                }
            }
        }
Example #4
0
        public static void SerializeMarkerData(ThreadFixPlugin threadFixPlugin)
        {
            var solutionName = GetSolutionName();

            if (string.IsNullOrEmpty(solutionName))
            {
                return;
            }

            var path = GetStoredPluginFilePath(solutionName);

            Directory.CreateDirectory(Path.GetDirectoryName(path));

            using (var fs = File.Open(path, FileMode.Create))
                using (var sw = new StreamWriter(fs))
                    using (var jw = new JsonTextWriter(sw))
                    {
                        new JsonSerializer().Serialize(jw, new StoredPluginData {
                            Markers = threadFixPlugin.Markers, SelectedAppIds = threadFixPlugin.SelectedAppIds
                        });
                    }
        }
Example #5
0
 public ViewModelService(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
Example #6
0
 public ClearAction(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
Example #7
0
        public static void SerializeMarkerData(ThreadFixPlugin threadFixPlugin)
        {
            var solutionName = GetSolutionName();
            if (string.IsNullOrEmpty(solutionName))
            {
                return;
            }

            var path = GetStoredPluginFilePath(solutionName);
            Directory.CreateDirectory(Path.GetDirectoryName(path));

            using (var fs = File.Open(path, FileMode.Create))
            using (var sw = new StreamWriter(fs))
            using (var jw = new JsonTextWriter(sw))
            {
                new JsonSerializer().Serialize(jw, new StoredPluginData { Markers = threadFixPlugin.Markers, SelectedAppIds = threadFixPlugin.SelectedAppIds });
            }
        }
 public MarkerGlyphService(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
            _threadFixPlugin = (ThreadFixPlugin)componentModel.GetService<IThreadFixPlugin>();

            // Global plugin state
            _threadFixPlugin.ToolWindow = (ThreadFixToolWindow)FindToolWindow(typeof(ThreadFixToolWindow), 0, true);
            _threadFixPlugin.Options = (OptionsPage)GetDialogPage(typeof(OptionsPage));

            _goToMarkerAction = new GoToMarkerAction(_threadFixPlugin);
            var toolWindow = (ToolWindowControl)_threadFixPlugin.ToolWindow.Content;
            toolWindow.MarkerSelected += _goToMarkerAction.OnExecute;

            // reload file paths when solution is loaded
            _solutionEvents = (GetService(typeof(DTE)) as DTE2).Events.SolutionEvents;
            _solutionEvents.Opened += SolutionEvents_Opened;

            // Add our command handlers for menu (commands must exist in the .vsct file)
            var mcs = _threadFixPlugin.MenuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (mcs != null)
            {
                // Create the command for the menu item.
                AddMenuItemCallback((int)PkgCmdIDList.cmdidImportMarkersCommand, mcs, new ImportAction(_threadFixPlugin));
                AddMenuItemCallback((int)PkgCmdIDList.cmdidClearMarkers, mcs, new ClearAction(_threadFixPlugin));
                AddMenuItemCallback((int)PkgCmdIDList.cmdidShowToolWindow, mcs, new ShowAction(_threadFixPlugin));
            }
            #if DEBUG
            // Disable ssl certificate validation for debugging purposes
            System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
            #endif
        }
Example #10
0
 public GoToMarkerAction(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
 public MarkerGlyphService(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
Example #12
0
 public ImportAction(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
     _viewModelService = new ViewModelService(_threadFixPlugin);
 }
Example #13
0
 public ThreadFixApi(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
 public ViewModelService(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }