/// <summary>Gets an instance of <see cref="TextDocument"/> from the currently active document.</summary>
        public async Task <TextDocument?> GetActiveTextDocumentAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            EnvDTE80.DTE2 dte = await VS.GetDTEAsync();

            return(dte.ActiveDocument?.Object("TextDocument") as TextDocument);
        }
Beispiel #2
0
        /// <summary>
        /// Builds the solution asynchronously
        /// </summary>
        /// <returns>Returns 'true' if successfull</returns>
        public async Task <bool> BuildAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            DTE2 dte = await VS.GetDTEAsync();

            return(await dte.Solution.BuildAsync());
        }