Skip to content

Fix file attributes original filename overlaps value box #523#525

Open
chlaplan wants to merge 9 commits into
MicrosoftDocs:mainfrom
chlaplan:Fix-File-Attributes-Original-filename-overlaps-value-box-#523
Open

Fix file attributes original filename overlaps value box #523#525
chlaplan wants to merge 9 commits into
MicrosoftDocs:mainfrom
chlaplan:Fix-File-Attributes-Original-filename-overlaps-value-box-#523

Conversation

@chlaplan
Copy link
Copy Markdown
Contributor

#523

image

This pull request improves the layout and responsiveness of the slider value boxes in the CustomRuleConditionsPanel by dynamically adjusting their position and size based on the type of rule and the panel's width. It also ensures a consistent visual style for the relevant text boxes. The main changes are grouped below by theme.

UI Responsiveness and Layout Improvements:

  • Added logic to shift the slider value boxes (textBoxSlider_* and textBoxEKU) horizontally depending on the label width, preventing overlap for file attribute labels, and made their width responsive to the panel size. This includes new constants for positioning, a method to update the layout (OffsetSliderValueBoxes), and a resize event handler (Panel_Publisher_Scroll_Resize).

  • The panel containing the slider boxes (panel_Publisher_Scroll) now anchors to the left, right, and top edges of its parent, and its layout is recalculated on resize for better window resizing behavior.

Visual Consistency:

  • Set the BorderStyle of all relevant text boxes (textBoxSlider_*, textBoxEKU, textBox_MaxVersion) to FixedSingle for a consistent appearance.

chlaplan and others added 9 commits May 4, 2026 17:44
• FolderHashScanForm.cs — New dialog for folder-based hash file scanning with browse, subfolder toggle, file checklist, and hash type selection
Modified Files
CustomRuleConditionsPanel.cs
• Added hash mode panel with Single File, Multiple Files radio buttons and Folder Scan... button
• "Folder Scan..." button directly opens FolderHashScanForm dialog
• Multi-file and folder scan modes batch files into a single FolderScan-type rule using New-CIPolicy -ScanPath (instead of one PowerShell call per file)
• Selected files are copied to a temp folder preserving subfolder structure from the source
• Stores SourceFolderPath and HashTypesToKeep on the rule for downstream processing
FolderHashScanForm.cs
• Browse folder with optional Include subfolders checkbox
• Scan Folder button enumerates files by common PE/script extensions
• Select All / Deselect All for the file checklist
• Hash type checkboxes: Hash SHA1, Hash SHA256, Hash Page SHA1, Hash Page SHA256, and All (toggle)
• Exposes SelectedFiles, SelectedHashTypes, SourceFolderPath, IncludeSubfolders, AllFilesSelected
• Dark mode support
SigningRules_Control.cs
• Added AddRuleToTableWithoutClosing() method to support batch rule insertion without closing the custom rules panel
Policy.cs (PolicyCustomRules class)
• Added HashTypesToKeep property (HashSet<string>) — hash types to retain when filtering generated policy XML
• Added SourceFolderPath property (string) — original folder path for FriendlyName correction
MainForm.cs
• Added using System.Linq
• FriendlyName fix: after scan, replaces temp folder path in each rule's FriendlyName with the original source folder path (preserving subfolders)
• Hash type filtering: removes unwanted hash types (Hash SHA1, Hash Page SHA256, etc.) from generated policy based on user's checkbox selections
• Progress bar improvements:
• ProcessCustomValueRules(BackgroundWorker, SiPolicy) now reports incremental progress 0–25% per rule
• ProcessSignerRules(BackgroundWorker, SiPolicy) shows "Processing rule X of Y ..." with accurate counts
• FolderScan shows phased status: "Scanning folder: ...", "Scan complete. Applying hash type filters ...", "Filtered: kept X of Y hash rules.", "Merging scanned policy rules ..."
• ProgressChanged handler respects custom UserState messages
This reverts commit 162dd88.
• Added -NoLogo -NonInteractive flags to PowerShell invocation to reduce startup overhead
• Fixed potential deadlock: moved StandardOutput.ReadToEnd() and StandardError.ReadToEnd() before WaitForExit() to prevent buffer-full hang

MainForm.cs
• Fixed progress bar stalling at 25% during Folder Scan by reporting progress after skipping non-applicable rules
• Added mid-scan progress report (~55%) before CreateScannedPolicyFromPS(PolicyCustomRules, string, string) so UI shows activity during long scans
• Updated progress status text: "Scanning and processing rules (this may take a few minutes) ..." for the 25-80% range
…SliderBoxX = 165) plus a fixed right edge so the boxes stay inside the panel.

2. Added a small helper, OffsetSliderValueBoxes(int xLocation), that shifts the value boxes' left edge and adjusts their width (keeping the right edge fixed).

Auto expand when making window bigger.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant