コード例 #1
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            var project = this.dteService.ActiveDocument.ProjectItem.ContainingProject;

            if (project != null)
            {
                OpenOutputFolderHelper.OpenProjectOutputFolder(project);
            }
        }
コード例 #2
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            if (this.dteService?.SelectedItems.Count != 1)
            {
                return;
            }

            var selectedItem = this.dteService.SelectedItems.Item(1);

            if (selectedItem.Project != null)
            {
                OpenOutputFolderHelper.OpenProjectOutputFolder(selectedItem.Project);
            }
            else if (selectedItem.ProjectItem != null)
            {
                OpenOutputFolderHelper.OpenProjectOutputFolder(selectedItem.ProjectItem.ContainingProject);
            }
        }