Ejemplo n.º 1
0
        private async Task <object> CreateDoxygenConfigServiceAsync(IAsyncServiceContainer container, CancellationToken cancellationToken, Type serviceType)
        {
            var svc = new DoxygenConfigService();
            await svc.InitializeAsync(this, cancellationToken);

            return(svc);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="sourceProvider"></param>
 /// <param name="textBuffer"></param>
 public DoxygenCompletionSource(CompletionSourceProvider sourceProvider, ITextBuffer textBuffer, DoxygenConfigService configService)
 {
     m_sourceProvider = sourceProvider;
     m_textBuffer     = textBuffer;
     m_configService  = configService;
     CreateCompletionLists();
     m_configService.Config.ConfigChanged += onConfigChanged;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static async Task InitializeAsync(AsyncPackage package)
        {
            // Switch to the main thread - the call to AddCommand in GenerateComment's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = await package.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService;

            DoxygenConfigService configService = await package.GetServiceAsync((typeof(DoxygenConfigService))) as DoxygenConfigService;

            Instance = new GenerateComment(package, commandService, configService);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="textViewAdapter"></param>
        /// <param name="textView"></param>
        /// <param name="provider"></param>
        /// <param name="dte"></param>
        public DoxygenCompletionCommandHandler(IVsTextView textViewAdapter, IWpfTextView textView, CompletionHandlerProvider provider, DTE dte, DoxygenConfigService configService)
        {
            m_textView      = textView;
            m_provider      = provider;
            m_dte           = dte;
            m_configService = configService;

            // Add the command to the command chain.
            if (textViewAdapter != null &&
                textView != null &&
                textView.TextBuffer != null &&
                textView.TextBuffer.ContentType.TypeName == CppTypeName)
            {
                textViewAdapter.AddCommandFilter(this, out m_nextCommandHandler);
            }

            m_generator = new DoxygenGenerator(m_configService);

            m_configService.Config.ConfigChanged += onDoxygenConfigChanged;
            onDoxygenConfigChanged(this, EventArgs.Empty);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="configService">Doxygen configuration service.</param>
 public DoxygenGenerator(DoxygenConfigService configService)
 {
     m_configService = configService;
     m_configService.Config.ConfigChanged += onConfigChanged;
     InitStyle();
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GenerateComment"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        /// <param name="commandService">Command service to add command to, not null.</param>
        private GenerateComment(AsyncPackage package, OleMenuCommandService commandService, DoxygenConfigService configService)
        {
            m_generator = new DoxygenGenerator(configService);

            this.package   = package ?? throw new ArgumentNullException(nameof(package));
            commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));

            var menuCommandID = new CommandID(CommandSet, CommandId);
            var menuItem      = new MenuCommand(this.Execute, menuCommandID);

            commandService.AddCommand(menuItem);
        }