Example #1
0
        private void SolutionItemSkipMenuItem_BeforeQueryStatus(object sender, EventArgs e)
        {
            OleMenuCommand menuCommand = sender as OleMenuCommand;

            if (menuCommand != null)
            {
                var activeItems    = ActiveUiHierarchyItems.Cast <UIHierarchyItem>();
                var buildFileTypes = OptionsProviderRegistry.CurrentOptions.BuildFileTypes;

                menuCommand.Visible = activeItems.Select(item => GetFileType(item.Name)).All(type => buildFileTypes.HasFlag(type) && (type != IncludeFileType.None));
                menuCommand.Checked = false;
                menuCommand.Enabled = true;
                foreach (var item in activeItems)
                {
                    ProjectItem projItem = (ProjectItem)item.Object;
                    if (SolutionFolderKind.Equals(projItem.ContainingProject.Kind, StringComparison.Ordinal))
                    {
                        menuCommand.Visible = false;
                        return;
                    }
                    bool skippedByFolder;
                    if (IsNodeSkipped(projItem, out skippedByFolder))
                    {
                        menuCommand.Checked = true;
                        if (skippedByFolder)
                        {
                            menuCommand.Enabled = false;
                        }

                        return;
                    }
                }
            }
        }
Example #2
0
        private void LintSolutionFolderNodeSkipCmdCallback(object sender, EventArgs e)
        {
            var activeProjectItems = ActiveUiHierarchyItems.Cast <UIHierarchyItem>()
                                     .Select(item => item.Object)
                                     .Cast <ProjectItem>();

            foreach (var projItem in activeProjectItems)
            {
                ToggleSkip(projItem);
            }
        }
Example #3
0
        private void SolutionFolderNodeSkipMenuItem_BeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand != null)
            {
                menuCommand.Visible = true;
                var activeItems = ActiveUiHierarchyItems.Cast <UIHierarchyItem>();
                menuCommand.Checked = activeItems.Select(item => (ProjectItem)item.Object).Any(IsNodeSkipped);
            }
        }
Example #4
0
        private void SolutionItemMenuItem_BeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand != null)
            {
                menuCommand.Visible = ActiveUiHierarchyItems.Cast <UIHierarchyItem>()
                                      .Select(item => GetFileType(item.Name))
                                      .All(type => type != IncludeFileType.None && type != IncludeFileType.Folder);
            }
        }
Example #5
0
        private void LintSolutionItemSkipCmdCallback(object sender, EventArgs e)
        {
            var buildFileTypes = OptionsProviderRegistry.CurrentOptions.BuildFileTypes;

            var buildableFiles = ActiveUiHierarchyItems.Cast <UIHierarchyItem>()
                                 .Select(item => item.Object)
                                 .Cast <ProjectItem>()
                                 .Select(projItem => new
            {
                Item     = projItem,
                FileType = GetFileType(projItem.Name)
            })
                                 .Where(c => buildFileTypes.HasFlag(c.FileType))
                                 .Select(c => c.Item);

            foreach (var item in buildableFiles)
            {
                ToggleSkip(item);
            }
        }