Skip to content

Commit 28798ba

Browse files
committed
manual followups
1 parent 76423d6 commit 28798ba

File tree

15 files changed

+23
-42
lines changed

15 files changed

+23
-42
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/ErasingStroke.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ internal void MoveTo(IEnumerable<Point> path)
7979
}
8080
#if POINTS_FILTER_TRACE
8181
_totalPointsAdded += path.Length;
82-
System.Diagnostics.Debug.WriteLine(String.Format("Total Points added: {0} screened: {1} collinear screened: {2}", _totalPointsAdded, _totalPointsScreened, _collinearPointsScreened));
82+
System.Diagnostics.Debug.WriteLine($"Total Points added: {_totalPointsAdded} screened: {_totalPointsScreened} collinear screened: {_collinearPointsScreened}");
8383
#endif
8484

8585
}

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/DynamicRendererThreadManager.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,9 @@ void Dispose(bool disposing)
256256
}
257257
catch(System.ComponentModel.Win32Exception e)
258258
{
259-
if (e.NativeErrorCode != 1400) // ERROR_INVALID_WINDOW_HANDLE
260-
{
259+
Debug.WriteLineIf(e.NativeErrorCode != 1400, // ERROR_INVALID_WINDOW_HANDLE
261260
// This is an unlocalized string but it only prints on the Debug Console
262-
Debug.WriteLine(String.Format("Dispatcher.CriticalInvokeShutdown() Failed. Error={0}", e.NativeErrorCode));
263-
}
261+
$"Dispatcher.CriticalInvokeShutdown() Failed. Error={e.NativeErrorCode}");
264262
}
265263
finally
266264
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ internal void SetOwner(StylusDeviceBase stylusDevice)
100100
/// <returns><see cref="System.String"/> name of the tablet</returns>
101101
public override string ToString()
102102
{
103-
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), this.Name);
103+
return $"{base.ToString()}({this.Name})";
104104
}
105105

106106
/////////////////////////////////////////////////////////////////////

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public string Name
175175
/// </summary>
176176
public override string ToString()
177177
{
178-
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), this.Name);
178+
return $"{base.ToString()}({this.Name})";
179179
}
180180

181181
/// <summary>

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/TabletDeviceBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ internal TabletDeviceType Type
185185
/// </summary>
186186
public override string ToString()
187187
{
188-
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), Name);
188+
return $"{base.ToString()}({this.Name})";
189189
}
190190

191191
/// <summary>

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Wisp/PenThreadWorker.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ internal void ThreadProc()
11601160
while (!__disposed)
11611161
{
11621162
#if TRACEPTW
1163-
Debug.WriteLine(String.Format("PenThreadWorker::ThreadProc(): Update __penContextWeakRefList loop"));
1163+
Debug.WriteLine("PenThreadWorker::ThreadProc(): Update __penContextWeakRefList loop");
11641164
#endif
11651165

11661166
// We need to ensure that the PenIMC COM objects can be used from this thread.
@@ -1195,7 +1195,7 @@ internal void ThreadProc()
11951195
while (true)
11961196
{
11971197
#if TRACEPTW
1198-
Debug.WriteLine (String.Format("PenThreadWorker::ThreadProc - handle event loop"));
1198+
Debug.WriteLine("PenThreadWorker::ThreadProc - handle event loop");
11991199
#endif
12001200
// get next event
12011201
int evt;
@@ -1229,9 +1229,9 @@ internal void ThreadProc()
12291229
{
12301230
// dispatch the event
12311231
#if TRACEPTW
1232-
Debug.WriteLine (String.Format("PenThreadWorker::ThreadProc - FireEvent [evt={0}, stylusId={1}]", evt, stylusPointerId));
1232+
Debug.WriteLine($"PenThreadWorker::ThreadProc - FireEvent [evt={evt}, stylusId={stylusPointerId}]");
12331233
#endif
1234-
1234+
12351235
// This comment addresses and IndexOutOfRangeException in PenThreadWorker which is related and likely caused by the above.
12361236
// This index is safe as long as there are no corruption issues within PenIMC. There have been
12371237
// instances of IndexOutOfRangeExceptions from this code but this should not occur in practice.
@@ -1248,7 +1248,7 @@ internal void ThreadProc()
12481248
else
12491249
{
12501250
#if TRACEPTW
1251-
Debug.WriteLine (String.Format("PenThreadWorker::ThreadProc - FlushInput"));
1251+
Debug.WriteLine("PenThreadWorker::ThreadProc - FlushInput");
12521252
#endif
12531253
FlushCache(true);
12541254

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Wisp/WispStylusDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ internal override string Name
11171117
/// </summary>
11181118
public override string ToString()
11191119
{
1120-
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), this.Name);
1120+
return $"{base.ToString()}({this.Name})";
11211121
}
11221122

11231123
/////////////////////////////////////////////////////////////////////

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Wisp/WispTabletDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ internal override PresentationSource ActiveSource
169169
/// </summary>
170170
public override string ToString()
171171
{
172-
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), Name);
172+
return $"{base.ToString()}({this.Name})";
173173
}
174174

175175
/////////////////////////////////////////////////////////////////////////

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/KeySpline.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,7 @@ internal string InternalConvertToString(string format, IFormatProvider formatPro
491491
// Helper to get the numeric list separator for a given culture.
492492
char separator = MS.Internal.TokenizerHelper.GetNumericListSeparator(formatProvider);
493493

494-
return String.Format(
495-
formatProvider,
496-
"{1}{0}{2}",
497-
separator,
498-
_controlPoint1,
499-
_controlPoint2);
494+
return string.Create(formatProvider, $"{_controlPoint1}{separator}{_controlPoint2}");
500495
}
501496

502497
#endregion

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/KeySplineConverter.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,11 @@ public override object ConvertTo(
122122
else if (destinationType == typeof(string))
123123
{
124124
#pragma warning disable 56506 // Suppress presharp warning: Parameter 'cultureInfo.TextInfo' to this public method must be validated: A null-dereference can occur here.
125-
return String.Format(
126-
cultureInfo,
127-
"{0}{4}{1}{4}{2}{4}{3}",
128-
keySpline.ControlPoint1.X,
129-
keySpline.ControlPoint1.Y,
130-
keySpline.ControlPoint2.X,
131-
keySpline.ControlPoint2.Y,
132-
cultureInfo != null ? cultureInfo.TextInfo.ListSeparator : CultureInfo.InvariantCulture.TextInfo.ListSeparator);
125+
string separator = cultureInfo != null ? cultureInfo.TextInfo.ListSeparator : CultureInfo.InvariantCulture.TextInfo.ListSeparator;
133126
#pragma warning restore 56506
127+
return string.Create(
128+
cultureInfo,
129+
$"{keySpline.ControlPoint1.X}{separator}{keySpline.ControlPoint1.Y}{separator}{keySpline.ControlPoint2.X}{separator}{keySpline.ControlPoint2.Y}");
134130
}
135131
}
136132

0 commit comments

Comments
 (0)