Exemple #1
0
 public MarkerTagger(ThreadFixPlugin threadFixPlugin, ITextBuffer textBuffer)
 {
     _threadFixPlugin = threadFixPlugin;
     _threadFixPlugin.MarkersUpdated += ThreadFixPlugin_MarkersUpdated;
     _markerGlyphService              = new MarkerGlyphService(threadFixPlugin);
     _textBuffer = textBuffer;
 }
        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();
        }
Exemple #3
0
        /////////////////////////////////////////////////////////////////////////////
        // Overridden Package Implementation
        #region Package Members

        /// <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
        }
Exemple #4
0
 public ShowAction(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin  = threadFixPlugin;
     _viewModelService = new ViewModelService(_threadFixPlugin);
 }
Exemple #5
0
 public GoToMarkerAction(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }
Exemple #6
0
 public ClearAction(ThreadFixPlugin threadFixPlugin)
 {
     _threadFixPlugin = threadFixPlugin;
 }