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; } } } }
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); } }
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); } }
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); } }
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); } }