Skip to content

Commit dd514dc

Browse files
ricardobossanRicardo Bossan (BEYONDSOFT CONSULTING INC)
and
Ricardo Bossan (BEYONDSOFT CONSULTING INC)
authored
Unify namespaces and class names under DemoConsole (#13433)
Related #13388 ## Proposed changes - Unifies `DesignSurfaceExt` and `DemoConsole` namespaces under the latter. - Renames class names where appropriate to reflect the shared project identity, in preparation for relocating all files into the `DemoConsole` folder in a follow-up PR. ## Customer Impact - None or succinct description ## Regression? - No ## Risk - Minimal ## Test environment(s) - 10.0.100-preview.3.25201.16 Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) <[email protected]>
1 parent 8c5ddfb commit dd514dc

11 files changed

+38
-39
lines changed

src/test/integration/DesignSurface/DemoConsole/GlobalUsings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
global using System.ComponentModel;
88
global using System.ComponentModel.Design;
99
global using System.Windows.Forms.Design;
10-
global using DesignSurfaceExt;
10+
global using DemoConsole;
1111
global using Timer = System.Windows.Forms.Timer;

src/test/integration/DesignSurface/DemoConsole/MainForm.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/integration/DesignSurface/DemoConsole/MainForm.cs

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
3-
43
namespace TestConsole;
54

65
[DesignerCategory("Default")]
76
public partial class MainForm : Form
87
{
98
private ISelectionService _selectionService;
109

11-
private readonly List<IDesignSurfaceExt> _listOfDesignSurface = [];
10+
private readonly List<IDesignSurfaceExtended> _listOfDesignSurface = [];
1211

1312
public MainForm()
1413
{
@@ -38,7 +37,7 @@ private void InitFormDesigner()
3837
// - enable the UndoEngines
3938
for (int i = 0; i < tabControl1.TabCount; i++)
4039
{
41-
IDesignSurfaceExt isurf = _listOfDesignSurface[i];
40+
IDesignSurfaceExtended isurf = _listOfDesignSurface[i];
4241
isurf.GetUndoEngineExt().Enabled = true;
4342
}
4443

@@ -47,7 +46,7 @@ private void InitFormDesigner()
4746
// - if we obtain it then hook the SelectionChanged event
4847
for (int i = 0; i < tabControl1.TabCount; i++)
4948
{
50-
IDesignSurfaceExt isurf = _listOfDesignSurface[i];
49+
IDesignSurfaceExtended isurf = _listOfDesignSurface[i];
5150
_selectionService = (ISelectionService)(isurf.GetIDesignerHost().GetService(typeof(ISelectionService)));
5251
if (_selectionService is not null)
5352
_selectionService.SelectionChanged += OnSelectionChanged;
@@ -60,7 +59,7 @@ private void OnSelectionChanged(object sender, EventArgs e)
6059
if (_selectionService is null)
6160
return;
6261

63-
IDesignSurfaceExt isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
62+
IDesignSurfaceExtended isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
6463
if (isurf is not null)
6564
{
6665
ISelectionService selectionService = isurf.GetIDesignerHost().GetService(typeof(ISelectionService)) as ISelectionService;
@@ -72,7 +71,7 @@ private void CreateDesignSurface(int n)
7271
{
7372
// - step.0
7473
// - create a DesignSurface and put it inside a Form in DesignTime
75-
DesignSurfaceExt.DesignSurfaceExt surface = new();
74+
DesignSurfaceExtended surface = new();
7675
// -
7776
// -
7877
// - store for later use
@@ -442,7 +441,7 @@ private void CreateDesignSurface(int n)
442441
private void SelectRootComponent()
443442
{
444443
// - find out the DesignSurfaceExt control hosted by the TabPage
445-
IDesignSurfaceExt isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
444+
IDesignSurfaceExtended isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
446445
if (isurf is not null)
447446
{
448447
splitContainer.Panel2.Controls.Remove(propertyGrid);
@@ -465,13 +464,13 @@ private void SelectRootComponent()
465464

466465
private void undoToolStripMenuItem_Click(object sender, EventArgs e)
467466
{
468-
IDesignSurfaceExt isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
467+
IDesignSurfaceExtended isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
469468
isurf?.GetUndoEngineExt().Undo();
470469
}
471470

472471
private void redoToolStripMenuItem_Click(object sender, EventArgs e)
473472
{
474-
IDesignSurfaceExt isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
473+
IDesignSurfaceExtended isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
475474
isurf?.GetUndoEngineExt().Redo();
476475
}
477476

@@ -483,7 +482,7 @@ private void OnAbout(object sender, EventArgs e)
483482
private void toolStripMenuItemTabOrder_Click(object sender, EventArgs e)
484483
{
485484
// - find out the DesignSurfaceExt control hosted by the TabPage
486-
IDesignSurfaceExt isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
485+
IDesignSurfaceExtended isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
487486
isurf?.SwitchTabOrder();
488487
}
489488

@@ -504,7 +503,7 @@ private void OnTabPageSelected(object sender, TabControlEventArgs e)
504503

505504
private void OnMenuClick(object sender, EventArgs e)
506505
{
507-
IDesignSurfaceExt isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
506+
IDesignSurfaceExtended isurf = _listOfDesignSurface[tabControl1.SelectedIndex];
508507
isurf?.DoAction((sender as ToolStripMenuItem).Text);
509508
}
510509
}

src/test/integration/DesignSurface/DesignSurfaceExt/DesignSurfaceExt.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

6-
public class DesignSurfaceExt : DesignSurface, IDesignSurfaceExt
6+
public class DesignSurfaceExtended : DesignSurface, IDesignSurfaceExtended
77
{
88
private const string Name = "DesignSurfaceExt";
99

@@ -73,7 +73,7 @@ public void UseNoGuides()
7373
serviceProvider.AddService(typeof(DesignerOptionService), opsService2);
7474
}
7575

76-
public UndoEngineExt GetUndoEngineExt()
76+
public UndoEngineExtended GetUndoEngineExt()
7777
{
7878
return _undoEngine;
7979
}
@@ -270,15 +270,15 @@ public void DisposeTabOrder()
270270

271271
#region UndoEngine
272272

273-
private UndoEngineExt _undoEngine;
274-
private NameCreationServiceImp _nameCreationService;
275-
private DesignerSerializationServiceImpl _designerSerializationService;
273+
private UndoEngineExtended _undoEngine;
274+
private NameCreationService _nameCreationService;
275+
private DesignerSerializationService _designerSerializationService;
276276
private CodeDomComponentSerializationService _codeDomComponentSerializationService;
277277

278278
#endregion
279279

280280
// - ctor
281-
public DesignSurfaceExt()
281+
public DesignSurfaceExtended()
282282
{
283283
InitServices();
284284
}
@@ -300,7 +300,7 @@ private void InitServices()
300300
// - otherwise the root component did not have a name and this caused
301301
// - troubles when we try to use the UndoEngine
302302
// - 1. NameCreationService
303-
_nameCreationService = new NameCreationServiceImp();
303+
_nameCreationService = new NameCreationService();
304304
ServiceContainer.RemoveService(typeof(INameCreationService), false);
305305
ServiceContainer.AddService(typeof(INameCreationService), _nameCreationService);
306306

@@ -310,12 +310,12 @@ private void InitServices()
310310
ServiceContainer.AddService(typeof(ComponentSerializationService), _codeDomComponentSerializationService);
311311

312312
// - 3. IDesignerSerializationService
313-
_designerSerializationService = new DesignerSerializationServiceImpl(ServiceContainer);
313+
_designerSerializationService = new DesignerSerializationService(ServiceContainer);
314314
ServiceContainer.RemoveService(typeof(IDesignerSerializationService), false);
315315
ServiceContainer.AddService(typeof(IDesignerSerializationService), _designerSerializationService);
316316

317317
// - 4. UndoEngine
318-
_undoEngine = new UndoEngineExt(ServiceContainer)
318+
_undoEngine = new UndoEngineExtended(ServiceContainer)
319319
{
320320
// Disable the UndoEngine
321321
Enabled = false

src/test/integration/DesignSurface/DesignSurfaceExt/DesignerOptionServiceExt.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

66
internal class DesignerOptionServiceBase : DesignerOptionService
77
{

src/test/integration/DesignSurface/DesignSurfaceExt/DesignerSerializationServiceImpl.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

6-
internal sealed class DesignerSerializationServiceImpl : IDesignerSerializationService
6+
internal sealed class DesignerSerializationService : IDesignerSerializationService
77
{
88
private readonly IServiceProvider _serviceProvider;
99

10-
public DesignerSerializationServiceImpl(IServiceProvider serviceProvider)
10+
public DesignerSerializationService(IServiceProvider serviceProvider)
1111
{
1212
_serviceProvider = serviceProvider;
1313
}

src/test/integration/DesignSurface/DesignSurfaceExt/IDesignSurfaceExt.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

6-
public interface IDesignSurfaceExt
6+
public interface IDesignSurfaceExtended
77
{
88
// - perform Cut/Copy/Paste/Delete commands
99
void DoAction(string command);
@@ -25,7 +25,7 @@ TControl CreateControl<TControl>(Size controlSize, Point controlLocation)
2525
where TControl : Control;
2626

2727
// - Get the UndoEngineExtended object
28-
UndoEngineExt GetUndoEngineExt();
28+
UndoEngineExtended GetUndoEngineExt();
2929

3030
// - Get the IDesignerHost of the .NET 2.0 DesignSurface
3131
IDesignerHost GetIDesignerHost();

src/test/integration/DesignSurface/DesignSurfaceExt/NameCreationServiceImp.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

66
/// <summary>
77
/// Implements <see cref="INameCreationService"/> to provide names for newly created controls.
@@ -13,7 +13,7 @@ namespace DesignSurfaceExt;
1313
/// it increments an integer counter until it finds a unique name that is not already in use.
1414
/// </para>
1515
/// </remarks>
16-
internal sealed class NameCreationServiceImp : INameCreationService
16+
internal sealed class NameCreationService : INameCreationService
1717
{
1818
public string CreateName(IContainer container, Type type)
1919
{

src/test/integration/DesignSurface/DesignSurfaceExt/PropertyGridExt.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

66
[DesignerCategory("Default")]
7-
public class PropertyGridExt : PropertyGrid
7+
public class PropertyGridExtended : PropertyGrid
88
{
99
private IDesignerHost _host;
1010
private IComponentChangeService _componentChangeService;

src/test/integration/DesignSurface/DesignSurfaceExt/TabOrderHooker.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

66
public class TabOrderHooker
77
{

src/test/integration/DesignSurface/DesignSurfaceExt/UndoEngineExt.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace DesignSurfaceExt;
4+
namespace DemoConsole;
55

6-
public class UndoEngineExt : UndoEngine
6+
public class UndoEngineExtended : UndoEngine
77
{
88
private readonly Stack<UndoUnit> _undoStack = new();
99
private readonly Stack<UndoUnit> _redoStack = new();
1010

11-
public UndoEngineExt(IServiceProvider provider) : base(provider) { }
11+
public UndoEngineExtended(IServiceProvider provider) : base(provider) { }
1212

1313
public bool EnableUndo
1414
{

0 commit comments

Comments
 (0)