Skip to content

Fix the maximize window resizing #353#524

Open
chlaplan wants to merge 11 commits into
MicrosoftDocs:mainfrom
chlaplan:Fix-the-maximize-window-resizing-#353
Open

Fix the maximize window resizing #353#524
chlaplan wants to merge 11 commits into
MicrosoftDocs:mainfrom
chlaplan:Fix-the-maximize-window-resizing-#353

Conversation

@chlaplan
Copy link
Copy Markdown
Contributor

#353

This pull request introduces UI and usability improvements to several wizard pages, focusing on better resizing behavior, improved user experience when selecting events, and code consistency. The main changes include implementing the IWizardPage interface across relevant controls, enhancing the layout and anchoring of controls for better resizing, and refining the event selection logic to preserve user choices.

UI and Layout Improvements:

  • Added anchoring to various controls (buttons, panels, labels, combo boxes, and the eventsDataGridView) in EventLogRuleConfiguration.Designer.cs to improve resizing behavior and ensure controls remain visible and well-placed when the window size changes. Enabled auto-scrolling for the control. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Changed AutoSizeColumnsMode and AutoSizeMode for the eventsDataGridView and its columns to None for greater control over column sizing, and added logic to auto-fit columns to their content after data is loaded. [1] [2] [3] [4] [5] [6] [7] [8]
  • Increased the size of key buttons in EditWorkflow.Designer.cs for better usability. [1] [2] [3]

Usability Enhancements:

  • Updated event row selection logic in EventLogRuleConfiguration.cs to preserve the user's rule type selection when navigating between rows and to ensure the correct panel is displayed for the selected row. The rule type dropdown is no longer reset on selection change. [1] [2] [3] [4]

Code Consistency:

  • Implemented the IWizardPage interface on all relevant wizard page controls (BuildPage, ConfigTemplate_Control, EditWorkflow, and EventLogRuleConfiguration) for improved code consistency and maintainability. [1] [2] [3] [4]

chlaplan and others added 11 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
…tomRulesPanel() so the dropdown no longer snaps back to Publisher on every row click.

• Updated RowSelectionChanged(object, EventArgs) and EventRowClick(object, DataGridViewCellEventArgs) to repopulate the rule panel based on the currently selected rule type instead of hard-coding SetPublisherPanel(...).
• Extracted the panel-population logic into a shared RefreshRulePanelForSelectedRow() method, reused by both the row handlers and RuleTypeChanged(object, EventArgs).
• Set SelectedRow before refreshing the UI and added a bounds guard.
• Reordered the header-click (-1) sort check in EventRowClick(object, DataGridViewCellEventArgs) so sorting still works.
…roduced a small marker interface so only intended full-page wizard content is docked
…MouseEventArgs), which sorts the displayObjects data store by the clicked column and toggles ascending/descending on repeated clicks (matching the event grid behavior).

• Critically, because in-session custom rules are linked to grid rows via RowNumber, the handler remaps those row references after sorting so rule deletion/editing still targets the correct rows.
• Added GetDisplayObjectComparison(string) and a CompareDisplayStrings(string, string) helper that does case-insensitive comparison and pushes empty/null values to the bottom (same convention as the event grid's SortDisplayObjects(int, bool)).
• Added a sort glyph (▲/▼) on the active column header for visual feedback.
The existing auto-fit sizing, virtual-mode binding, and resize/docking behavior are all preserved. You can now click any column header in the File Rules grid to sort, and click again to reverse the order.
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