From 8e274eeda35928d069fb973182e5beaf64e5cae9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Dec 2025 03:17:41 +0000 Subject: [PATCH] fix: Resolve compiler warnings and errors - Add 'new' keyword to methods hiding inherited members (Refresh, Scroll, Update, btnClose) - Fix nullable reference type warnings by adding '?' to optional parameters - Replace non-existent DarkProgressBar with System.Windows.Forms.ProgressBar - Ensure compliance with C# nullable reference types for null default values This resolves CS0114, CS0108, CS8625, and CS0246 compiler issues. --- Intersect.Editor/Forms/Controls/MapTreeList.cs | 4 ++-- Intersect.Editor/Forms/Controls/SearchableDarkTreeView.cs | 2 +- Intersect.Editor/Forms/DockingElements/frmMapEditor.cs | 2 +- Intersect.Editor/Forms/DockingElements/frmMapLayers.cs | 2 +- Intersect.Editor/Forms/DockingElements/frmMapProperties.cs | 2 +- .../Editors/Events/Event Commands/Event_GraphicSelector.cs | 2 +- .../Events/Event Commands/Event_MoveRouteDesigner.cs | 2 +- Intersect.Editor/Forms/FrmUploadToServer.Designer.cs | 6 +++--- Intersect.Editor/Forms/Helpers/GridHelper.cs | 2 +- Intersect.Editor/Forms/frmMain.cs | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Intersect.Editor/Forms/Controls/MapTreeList.cs b/Intersect.Editor/Forms/Controls/MapTreeList.cs index fec9658ba5..75332e3f4f 100644 --- a/Intersect.Editor/Forms/Controls/MapTreeList.cs +++ b/Intersect.Editor/Forms/Controls/MapTreeList.cs @@ -12,7 +12,7 @@ public partial class MapTreeList : UserControl private readonly Dictionary _nodeLookup = new(); //Cross Thread Delegates - public delegate void TryUpdateMapList(Guid selectMap, List restrictMaps = null); + public delegate void TryUpdateMapList(Guid selectMap, List? restrictMaps = null); public bool Chronological = false; @@ -406,7 +406,7 @@ private void list_AfterCollapse(object sender, TreeViewEventArgs e) } } - public static void Scroll(Control control) + public static new void Scroll(Control control) { var pt = control.PointToClient(Cursor.Position); diff --git a/Intersect.Editor/Forms/Controls/SearchableDarkTreeView.cs b/Intersect.Editor/Forms/Controls/SearchableDarkTreeView.cs index 4e23ee3d46..89524c81a3 100644 --- a/Intersect.Editor/Forms/Controls/SearchableDarkTreeView.cs +++ b/Intersect.Editor/Forms/Controls/SearchableDarkTreeView.cs @@ -56,7 +56,7 @@ public string SearchText } } - public virtual void Refresh() + public new virtual void Refresh() { UpdateNodes(); } diff --git a/Intersect.Editor/Forms/DockingElements/frmMapEditor.cs b/Intersect.Editor/Forms/DockingElements/frmMapEditor.cs index 68fc3a8759..f5a7bb0db5 100644 --- a/Intersect.Editor/Forms/DockingElements/frmMapEditor.cs +++ b/Intersect.Editor/Forms/DockingElements/frmMapEditor.cs @@ -1579,7 +1579,7 @@ public void SmartFillLayer(int x, int y) } } - private void SmartFillAttribute(int x, int y, string data = null, MapAttribute newAttribute = null) + private void SmartFillAttribute(int x, int y, string? data = null, MapAttribute? newAttribute = null) { if (x < 0 || x >= Options.Instance.Map.MapWidth || y < 0 || y >= Options.Instance.Map.MapHeight) { diff --git a/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs b/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs index 362a5453c4..226b938156 100644 --- a/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs +++ b/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs @@ -753,7 +753,7 @@ private MapCritterAttribute CreateCritterAttribute() return critterAttribute; } - public MapAttribute PlaceAttribute(MapDescriptor mapDescriptor, int x, int y, MapAttribute attribute = null) + public MapAttribute PlaceAttribute(MapDescriptor mapDescriptor, int x, int y, MapAttribute? attribute = null) { if (attribute == null) { diff --git a/Intersect.Editor/Forms/DockingElements/frmMapProperties.cs b/Intersect.Editor/Forms/DockingElements/frmMapProperties.cs index 1f17379302..9a5dfa729f 100644 --- a/Intersect.Editor/Forms/DockingElements/frmMapProperties.cs +++ b/Intersect.Editor/Forms/DockingElements/frmMapProperties.cs @@ -40,7 +40,7 @@ private void InitLocalization() Text = Strings.MapProperties.title; } - public void Update() + public new void Update() { gridMapProperties.Refresh(); } diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_GraphicSelector.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_GraphicSelector.cs index d9c42f555f..7161403734 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_GraphicSelector.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_GraphicSelector.cs @@ -31,7 +31,7 @@ public partial class EventGraphicSelector : UserControl public EventGraphicSelector( EventGraphic editingGraphic, FrmEvent eventEditor, - EventMoveRouteDesigner moveRouteDesigner = null, + EventMoveRouteDesigner? moveRouteDesigner = null, bool newMoveRouteAction = false ) { diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_MoveRouteDesigner.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_MoveRouteDesigner.cs index c4d0114275..4990f99719 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_MoveRouteDesigner.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/Event_MoveRouteDesigner.cs @@ -30,7 +30,7 @@ public EventMoveRouteDesigner( MapDescriptor currentMap, EventDescriptor currentEvent, EventMoveRoute editingRoute, - SetMoveRouteCommand editingCommand = null, + SetMoveRouteCommand? editingCommand = null, bool disableRouteTarget = false ) { diff --git a/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs b/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs index 31bf2e34f5..b62995671b 100644 --- a/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs +++ b/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs @@ -41,7 +41,7 @@ private void InitializeComponent() this.btnBrowse = new DarkUI.Controls.DarkButton(); this.btnUpload = new DarkUI.Controls.DarkButton(); this.btnClose = new DarkUI.Controls.DarkButton(); - this.progressBar = new DarkUI.Controls.DarkProgressBar(); + this.progressBar = new System.Windows.Forms.ProgressBar(); this.lblStatus = new DarkUI.Controls.DarkLabel(); this.grpUploadType = new DarkUI.Controls.DarkGroupBox(); this.grpUploadType.SuspendLayout(); @@ -221,8 +221,8 @@ private void InitializeComponent() private DarkTextBox txtDirectory; private DarkButton btnBrowse; private DarkButton btnUpload; - private DarkButton btnClose; - private DarkProgressBar progressBar; + private new DarkButton btnClose; + private System.Windows.Forms.ProgressBar progressBar; private DarkLabel lblStatus; private DarkGroupBox grpUploadType; } diff --git a/Intersect.Editor/Forms/Helpers/GridHelper.cs b/Intersect.Editor/Forms/Helpers/GridHelper.cs index 44ec0faeb4..e1443975ef 100644 --- a/Intersect.Editor/Forms/Helpers/GridHelper.cs +++ b/Intersect.Editor/Forms/Helpers/GridHelper.cs @@ -14,7 +14,7 @@ public partial struct GridCell public Color? LabelColor { get; private set; } - public GridCell(int x, int y, Color? color = default, string label = null, Color? labelColor = default) + public GridCell(int x, int y, Color? color = default, string? label = null, Color? labelColor = default) { X = x; Y = y; diff --git a/Intersect.Editor/Forms/frmMain.cs b/Intersect.Editor/Forms/frmMain.cs index d9f6b7025d..9d1f051e84 100644 --- a/Intersect.Editor/Forms/frmMain.cs +++ b/Intersect.Editor/Forms/frmMain.cs @@ -553,7 +553,7 @@ public void MouseDownHandler(object sender, MouseEventArgs e) } //Update - public void Update() + public new void Update() { if (Globals.CurrentMap != null) {