1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
-
4
3
namespace TestConsole ;
5
4
6
5
[ DesignerCategory ( "Default" ) ]
7
6
public partial class MainForm : Form
8
7
{
9
8
private ISelectionService _selectionService ;
10
9
11
- private readonly List < IDesignSurfaceExt > _listOfDesignSurface = [ ] ;
10
+ private readonly List < IDesignSurfaceExtended > _listOfDesignSurface = [ ] ;
12
11
13
12
public MainForm ( )
14
13
{
@@ -38,7 +37,7 @@ private void InitFormDesigner()
38
37
// - enable the UndoEngines
39
38
for ( int i = 0 ; i < tabControl1 . TabCount ; i ++ )
40
39
{
41
- IDesignSurfaceExt isurf = _listOfDesignSurface [ i ] ;
40
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ i ] ;
42
41
isurf . GetUndoEngineExt ( ) . Enabled = true ;
43
42
}
44
43
@@ -47,7 +46,7 @@ private void InitFormDesigner()
47
46
// - if we obtain it then hook the SelectionChanged event
48
47
for ( int i = 0 ; i < tabControl1 . TabCount ; i ++ )
49
48
{
50
- IDesignSurfaceExt isurf = _listOfDesignSurface [ i ] ;
49
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ i ] ;
51
50
_selectionService = ( ISelectionService ) ( isurf . GetIDesignerHost ( ) . GetService ( typeof ( ISelectionService ) ) ) ;
52
51
if ( _selectionService is not null )
53
52
_selectionService . SelectionChanged += OnSelectionChanged ;
@@ -60,7 +59,7 @@ private void OnSelectionChanged(object sender, EventArgs e)
60
59
if ( _selectionService is null )
61
60
return ;
62
61
63
- IDesignSurfaceExt isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
62
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
64
63
if ( isurf is not null )
65
64
{
66
65
ISelectionService selectionService = isurf . GetIDesignerHost ( ) . GetService ( typeof ( ISelectionService ) ) as ISelectionService ;
@@ -72,7 +71,7 @@ private void CreateDesignSurface(int n)
72
71
{
73
72
// - step.0
74
73
// - create a DesignSurface and put it inside a Form in DesignTime
75
- DesignSurfaceExt . DesignSurfaceExt surface = new ( ) ;
74
+ DesignSurfaceExtended surface = new ( ) ;
76
75
// -
77
76
// -
78
77
// - store for later use
@@ -442,7 +441,7 @@ private void CreateDesignSurface(int n)
442
441
private void SelectRootComponent ( )
443
442
{
444
443
// - find out the DesignSurfaceExt control hosted by the TabPage
445
- IDesignSurfaceExt isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
444
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
446
445
if ( isurf is not null )
447
446
{
448
447
splitContainer . Panel2 . Controls . Remove ( propertyGrid ) ;
@@ -465,13 +464,13 @@ private void SelectRootComponent()
465
464
466
465
private void undoToolStripMenuItem_Click ( object sender , EventArgs e )
467
466
{
468
- IDesignSurfaceExt isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
467
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
469
468
isurf ? . GetUndoEngineExt ( ) . Undo ( ) ;
470
469
}
471
470
472
471
private void redoToolStripMenuItem_Click ( object sender , EventArgs e )
473
472
{
474
- IDesignSurfaceExt isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
473
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
475
474
isurf ? . GetUndoEngineExt ( ) . Redo ( ) ;
476
475
}
477
476
@@ -483,7 +482,7 @@ private void OnAbout(object sender, EventArgs e)
483
482
private void toolStripMenuItemTabOrder_Click ( object sender , EventArgs e )
484
483
{
485
484
// - find out the DesignSurfaceExt control hosted by the TabPage
486
- IDesignSurfaceExt isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
485
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
487
486
isurf ? . SwitchTabOrder ( ) ;
488
487
}
489
488
@@ -504,7 +503,7 @@ private void OnTabPageSelected(object sender, TabControlEventArgs e)
504
503
505
504
private void OnMenuClick ( object sender , EventArgs e )
506
505
{
507
- IDesignSurfaceExt isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
506
+ IDesignSurfaceExtended isurf = _listOfDesignSurface [ tabControl1 . SelectedIndex ] ;
508
507
isurf ? . DoAction ( ( sender as ToolStripMenuItem ) . Text ) ;
509
508
}
510
509
}
0 commit comments