Skip to content

Commit 0690a5d

Browse files
committed
Fix command line build
Also simplify constructors for Window Need to figure out how to make SA1518 an error in VS
1 parent 9d691ec commit 0690a5d

File tree

20 files changed

+21
-39
lines changed

20 files changed

+21
-39
lines changed

src/samples/ClipboardViewer/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private class ClipboardViewer : MainWindow
1616
private readonly EditControl _editControl;
1717
private readonly TextLabelControl _textLabel;
1818

19-
public ClipboardViewer(string title) : base(text: title)
19+
public ClipboardViewer(string title) : base(title: title)
2020
{
2121
_editControl = new EditControl(
2222
editStyle: EditControl.Styles.Multiline | EditControl.Styles.Left

src/samples/Layout/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private class LayoutWindow : MainWindow
2121
private readonly StaticControl _staticControl;
2222
private readonly TextLabelControl _textLabel;
2323

24-
public LayoutWindow(string title) : base(title)
24+
public LayoutWindow(string title) : base(title: title)
2525
{
2626
_editControl = new EditControl(
2727
text: "Type text here...",

src/samples/Petzold/5th/Beeper/Beeper1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class Beeper1 : MainWindow
1515
private bool _flipFlop = false;
1616
private nuint _timerId;
1717

18-
public Beeper1(string title) : base(title) { }
18+
public Beeper1(string title) : base(title: title) { }
1919

2020
protected override LRESULT WindowProcedure(HWND window, MessageType message, WPARAM wParam, LPARAM lParam)
2121
{

src/samples/Petzold/5th/Beeper/Beeper2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class Beeper2 : MainWindow
1616
private nuint _timerId;
1717
private TimerProcedure? _timerCallback;
1818

19-
public Beeper2(string title) : base(title) { }
19+
public Beeper2(string title) : base(title: title) { }
2020

2121
protected override LRESULT WindowProcedure(HWND window, MessageType message, WPARAM wParam, LPARAM lParam)
2222
{

src/samples/Petzold/5th/Bezier/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal class Bezier : MainWindow
2222
{
2323
private readonly Point[] _apt = new Point[4];
2424

25-
public Bezier(string title) : base(title)
25+
public Bezier(string title) : base(title: title)
2626
{
2727
}
2828

src/samples/Petzold/5th/Blokout2/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal class Blockout2 : MainWindow
2424
private bool _fBlocking, _fValidBox;
2525
private Point _ptBeg, _ptEnd, _ptBoxBeg, _ptBoxEnd;
2626

27-
public Blockout2(string title) : base(title)
27+
public Blockout2(string title) : base(title: title)
2828
{
2929
}
3030

src/samples/Petzold/5th/BtnLook/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private class OwnerDraw : MainWindow
2727
private const int ID_SMALLER = 1;
2828
private const int ID_LARGER = 2;
2929

30-
public OwnerDraw(string title) : base(title)
30+
public OwnerDraw(string title) : base(title: title)
3131
{
3232
}
3333

src/samples/Petzold/5th/Checker1/Checker1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Checker1 : MainWindow
1414
private readonly bool[,] _fState = new bool[DIVISIONS, DIVISIONS];
1515
private int _cxBlock, _cyBlock;
1616

17-
public Checker1(string title) : base(title)
17+
public Checker1(string title) : base(title: title)
1818
{
1919
}
2020

src/samples/Petzold/5th/Checker1/Checker2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class Checker2 : MainWindow
1616
private readonly bool[,] _state = new bool[DIVISIONS, DIVISIONS];
1717
private int _cxBlock, _cyBlock;
1818

19-
public Checker2(string title) : base(title)
19+
public Checker2(string title) : base(title: title)
2020
{
2121
}
2222

src/samples/Petzold/5th/Checker1/Checker3.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class Checker3 : MainWindow
1616
private int _cxBlock, _cyBlock;
1717
private readonly Checker3Child _childClass = (Checker3Child)(new Checker3Child().Register());
1818

19-
public Checker3(string title) : base(title)
19+
public Checker3(string title) : base(title: title)
2020
{
2121
}
2222

src/samples/Petzold/5th/Clock/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal class Clock : MainWindow
3939
private readonly GdiPlusBrush _whiteBrush = new SolidBrush(Color.White);
4040
#endif
4141

42-
public Clock(string title) : base(title) { }
42+
public Clock(string title) : base(title: title) { }
4343

4444
private void SetIsotropic(DeviceContext hdc)
4545
{

src/samples/Petzold/5th/Clover/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal class Clover : MainWindow
2424
private HRGN _hrgnClip;
2525
private const double TWO_PI = Math.PI * 2;
2626

27-
public Clover() : base(text: "Draw a Clover", backgroundBrush: StockBrush.White) { }
27+
public Clover() : base(title: "Draw a Clover", backgroundBrush: StockBrush.White) { }
2828

2929
protected override LRESULT WindowProcedure(HWND window, MessageType message, WPARAM wParam, LPARAM lParam)
3030
{

src/samples/Petzold/5th/HelloWin/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private static LRESULT WindowProcedure(HWND window, uint message, WPARAM wParam,
121121

122122
private class HelloWindow : MainWindow
123123
{
124-
public HelloWindow(string text) : base(text, backgroundBrush: StockBrush.White)
124+
public HelloWindow(string title) : base(title: title, backgroundBrush: StockBrush.White)
125125
{
126126
}
127127

src/samples/Petzold/5th/LineDemo/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private class LineDemo : MainWindow
2121
{
2222
private static int s_cxClient, s_cyClient;
2323

24-
public LineDemo(string title) : base(title) { }
24+
public LineDemo(string title) : base(title: title) { }
2525

2626
protected override LRESULT WindowProcedure(HWND window, MessageType message, WPARAM wParam, LPARAM lParam)
2727
{

src/samples/Windows101/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected override LRESULT WindowProcedure(HWND window, MessageType message, WPA
6868

6969
private class HelloWindow : MainWindow
7070
{
71-
public HelloWindow() : base("HelloWindow")
71+
public HelloWindow() : base(title: "HelloWindow")
7272
{
7373
}
7474

src/thirtytwo/MainWindow.cs

+2-20
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,16 @@ namespace Windows;
1111
public class MainWindow : Window
1212
{
1313
public MainWindow(
14+
Rectangle bounds = default,
1415
string? title = default,
1516
WindowStyles style = WindowStyles.OverlappedWindow,
1617
ExtendedWindowStyles extendedStyle = ExtendedWindowStyles.Default,
1718
WindowClass? windowClass = default,
1819
nint parameters = default,
1920
HMENU menuHandle = default,
20-
HBRUSH backgroundBrush = default) : this(
21-
DefaultBounds,
22-
title,
23-
style,
24-
extendedStyle,
25-
windowClass,
26-
parameters,
27-
menuHandle,
28-
backgroundBrush)
29-
{ }
30-
31-
public MainWindow(
32-
Rectangle bounds,
33-
string? text = default,
34-
WindowStyles style = WindowStyles.OverlappedWindow,
35-
ExtendedWindowStyles extendedStyle = ExtendedWindowStyles.Default,
36-
WindowClass? windowClass = default,
37-
nint parameters = default,
38-
HMENU menuHandle = default,
3921
HBRUSH backgroundBrush = default) : base(
4022
bounds,
41-
text,
23+
title,
4224
style,
4325
extendedStyle,
4426
default,

src/thirtytwo/Win32/Graphics/GdiPlus/Brush.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ protected override void Dispose(bool disposing)
2323

2424
_pointer = null;
2525
}
26-
}
26+
}

src/thirtytwo/Win32/Graphics/GdiPlus/GdiPlusException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ public class GdiPlusException : ThirtyTwoException
99
{
1010
public GdiPlusException(Status status) : base(status.ToString()) => Status = status;
1111
public Status Status { get; private set; }
12-
}
12+
}

src/thirtytwo/Win32/Graphics/GdiPlus/Pen.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ protected override void Dispose(bool disposing)
2929

3030
_pointer = null;
3131
}
32-
}
32+
}

src/thirtytwo/Win32/Graphics/GdiPlus/SolidBrush.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ public SolidBrush(ARGB color) : base(CreateBrush(color))
1919
Interop.GdipCreateSolidFill(color, (GpSolidFill**)&brush).ThrowIfFailed();
2020
return brush;
2121
}
22-
}
22+
}

0 commit comments

Comments
 (0)