Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit be32acf

Browse files
authored
Merge pull request #36 from Smurf-IV/master
Change the projects to at least recognise C#7.2 features and enhancements
2 parents d4cd084 + 067a8de commit be32acf

File tree

15 files changed

+99
-105
lines changed

15 files changed

+99
-105
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
=======
1010

11+
## 2018-04-09 ** Use All `C#` features
12+
* Change the projects to at least recognise C#7.2 features and enhancements - _to be applied in the future_
13+
* Some tinkering with spelling corrections - _to be applied in the future_
14+
15+
=======
16+
1117
## 2018-03-27 **`KryptonRibbon.cs`** version 562
1218
* Build 562 (build date 27th March, 2017) fixes the issue as noted in #35
1319

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Design/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
using System.Runtime.InteropServices;
1818

1919
[assembly: AssemblyVersion("4.70.0.0")]
20-
[assembly: AssemblyFileVersion("4.70.546.0")]
21-
[assembly: AssemblyInformationalVersion("4.70.546.0")]
20+
[assembly: AssemblyFileVersion("4.70.549.0")]
21+
[assembly: AssemblyInformationalVersion("4.70.549.0")]
2222
[assembly: AssemblyCopyright("© Component Factory Pty Ltd, 2006-2018. Then modifications by Peter Wagner (aka Wagnerp) & Simon Coghlan (aka Smurf-IV) 2017-2018. All rights reserved.")]
2323
[assembly: AssemblyProduct("Krypton Design")]
2424
[assembly: AssemblyDefaultAlias("ComponentFactory.Krypton.Design.dll")]

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Docking/ComponentFactory.Krypton.Docking 2018.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3737
<IsWebBootstrapper>false</IsWebBootstrapper>
3838
<UseApplicationTrust>false</UseApplicationTrust>
39-
4039
<TargetFrameworkProfile />
4140
<ShouldCreateLogs>True</ShouldCreateLogs>
4241
<AdvancedSettingsExpanded>False</AdvancedSettingsExpanded>
@@ -56,8 +55,8 @@
5655
<ErrorReport>prompt</ErrorReport>
5756
<WarningLevel>4</WarningLevel>
5857
<DocumentationFile>..\..\..\..\..\Bin\Versions\4.7\Any CPU\Krypton Core Components\ComponentFactory.Krypton.Docking.xml</DocumentationFile>
59-
6058
<Prefer32Bit>false</Prefer32Bit>
59+
<LangVersion>latest</LangVersion>
6160
</PropertyGroup>
6261
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
6362
<DebugType>pdbonly</DebugType>
@@ -67,7 +66,6 @@
6766
<ErrorReport>prompt</ErrorReport>
6867
<WarningLevel>4</WarningLevel>
6968
<DocumentationFile>..\..\..\Bin\ComponentFactory.Krypton.Docking.XML</DocumentationFile>
70-
7169
<Prefer32Bit>false</Prefer32Bit>
7270
</PropertyGroup>
7371
<PropertyGroup>

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Docking/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
using System.Runtime.CompilerServices;
1717
using System.Runtime.InteropServices;
1818

19-
[assembly: AssemblyVersion("4.70.545.0")]
20-
[assembly: AssemblyFileVersion("4.70.545.0")]
21-
[assembly: AssemblyInformationalVersion("4.70.545.0")]
19+
[assembly: AssemblyVersion("4.70.548.0")]
20+
[assembly: AssemblyFileVersion("4.70.548.0")]
21+
[assembly: AssemblyInformationalVersion("4.70.548.0")]
2222
[assembly: AssemblyCopyright("© Component Factory Pty Ltd, 2006-2018. Then modifications by Peter Wagner (aka Wagnerp) & Simon Coghlan (aka Smurf-IV) 2017-2018. All rights reserved.")]
2323
[assembly: AssemblyProduct("Krypton Docking")]
2424
[assembly: AssemblyDefaultAlias("ComponentFactory.Krypton.Docking.dll")]

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Navigator/ComponentFactory.Krypton.Navigator 2018.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3737
<IsWebBootstrapper>false</IsWebBootstrapper>
3838
<UseApplicationTrust>false</UseApplicationTrust>
39-
4039
<TargetFrameworkProfile />
4140
<ShouldCreateLogs>True</ShouldCreateLogs>
4241
<AdvancedSettingsExpanded>False</AdvancedSettingsExpanded>
@@ -56,8 +55,8 @@
5655
<ErrorReport>prompt</ErrorReport>
5756
<WarningLevel>4</WarningLevel>
5857
<DocumentationFile>..\..\..\..\..\Bin\Versions\4.7\Any CPU\Krypton Core Components\ComponentFactory.Krypton.Navigator.xml</DocumentationFile>
59-
6058
<Prefer32Bit>false</Prefer32Bit>
59+
<LangVersion>latest</LangVersion>
6160
</PropertyGroup>
6261
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
6362
<DebugType>pdbonly</DebugType>
@@ -67,7 +66,6 @@
6766
<ErrorReport>prompt</ErrorReport>
6867
<WarningLevel>4</WarningLevel>
6968
<DocumentationFile>..\..\..\Bin\ComponentFactory.Krypton.Navigator.XML</DocumentationFile>
70-
7169
<Prefer32Bit>false</Prefer32Bit>
7270
</PropertyGroup>
7371
<PropertyGroup>

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Navigator/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
using System.Runtime.CompilerServices;
1717
using System.Runtime.InteropServices;
1818

19-
[assembly: AssemblyVersion("4.70.544.0")]
20-
[assembly: AssemblyFileVersion("4.70.544.0")]
21-
[assembly: AssemblyInformationalVersion("4.70.544.0")]
19+
[assembly: AssemblyVersion("4.70.547.0")]
20+
[assembly: AssemblyFileVersion("4.70.547.0")]
21+
[assembly: AssemblyInformationalVersion("4.70.547.0")]
2222
[assembly: AssemblyCopyright("© Component Factory Pty Ltd, 2006-2018. Then modifications by Peter Wagner (aka Wagnerp) & Simon Coghlan (aka Smurf-IV) 2017-2018. All rights reserved.")]
2323
[assembly: AssemblyProduct("Krypton Navigator")]
2424
[assembly: AssemblyDefaultAlias("ComponentFactory.Krypton.Navigator.dll")]

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Ribbon/ComponentFactory.Krypton.Ribbon 2018.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3535
<IsWebBootstrapper>false</IsWebBootstrapper>
3636
<UseApplicationTrust>false</UseApplicationTrust>
37-
3837
<TargetFrameworkProfile />
3938
<ShouldCreateLogs>True</ShouldCreateLogs>
4039
<AdvancedSettingsExpanded>True</AdvancedSettingsExpanded>
@@ -54,8 +53,8 @@
5453
<ErrorReport>prompt</ErrorReport>
5554
<WarningLevel>4</WarningLevel>
5655
<DocumentationFile>..\..\..\..\..\Bin\Versions\4.7\Any CPU\Krypton Core Components\ComponentFactory.Krypton.Ribbon.xml</DocumentationFile>
57-
5856
<Prefer32Bit>false</Prefer32Bit>
57+
<LangVersion>latest</LangVersion>
5958
</PropertyGroup>
6059
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
6160
<DebugType>pdbonly</DebugType>
@@ -65,7 +64,6 @@
6564
<ErrorReport>prompt</ErrorReport>
6665
<WarningLevel>4</WarningLevel>
6766
<DocumentationFile>..\..\..\Bin\ComponentFactory.Krypton.Ribbon.XML</DocumentationFile>
68-
6967
<Prefer32Bit>false</Prefer32Bit>
7068
</PropertyGroup>
7169
<PropertyGroup>

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Ribbon/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
using System.Runtime.CompilerServices;
1717
using System.Runtime.InteropServices;
1818

19-
[assembly: AssemblyVersion("4.70.544.0")]
20-
[assembly: AssemblyFileVersion("4.70.544.0")]
21-
[assembly: AssemblyInformationalVersion("4.70.544.0")]
19+
[assembly: AssemblyVersion("4.70.547.0")]
20+
[assembly: AssemblyFileVersion("4.70.547.0")]
21+
[assembly: AssemblyInformationalVersion("4.70.547.0")]
2222
[assembly: AssemblyCopyright("© Component Factory Pty Ltd, 2006-2018. Then modifications by Peter Wagner (aka Wagnerp) & Simon Coghlan (aka Smurf-IV) 2017-2018. All rights reserved.")]
2323
[assembly: AssemblyProduct("Krypton Ribbon")]
2424
[assembly: AssemblyDefaultAlias("ComponentFactory.Krypton.Ribbon.dll")]

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Toolkit/AccurateText/AccurateText.cs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class AccurateText : GlobalId
4141
/// <param name="text">String to measure.</param>
4242
/// <param name="font">Font object that defines the text format of the string.</param>
4343
/// <param name="trim">How to trim excess text.</param>
44-
/// <param name="align">How to align multine text.</param>
44+
/// <param name="align">How to align multi-line text.</param>
4545
/// <param name="prefix">How to process prefix characters.</param>
4646
/// <param name="hint">Rendering hint.</param>
4747
/// <param name="composition">Should draw on a composition element.</param>
@@ -250,7 +250,7 @@ public static bool DrawString(Graphics g,
250250
// Invert the dimensions of the rectangle for drawing upwards
251251
rect = new Rectangle(rect.X, rect.Y, rect.Height, rect.Width);
252252

253-
// Translate back from a quater left turn to the original place
253+
// Translate back from a quarter left turn to the original place
254254
translateX = rect.X - rect.Y - 1;
255255
translateY = rect.X + rect.Y + rect.Width;
256256
rotation = 270;
@@ -259,7 +259,7 @@ public static bool DrawString(Graphics g,
259259
// Invert the dimensions of the rectangle for drawing upwards
260260
rect = new Rectangle(rect.X, rect.Y, rect.Height, rect.Width);
261261

262-
// Translate back from a quater right turn to the original place
262+
// Translate back from a quarter right turn to the original place
263263
translateX = rect.X + rect.Y + rect.Height + 1;
264264
translateY = -(rect.X - rect.Y);
265265
rotation = 90f;
@@ -341,14 +341,14 @@ public static bool DrawString(Graphics g,
341341

342342
private static Color ContrastColor(Color color)
343343
{
344-
// Counting the perceptive luminance - human eye favors green color...
344+
// Counting the perceptive luminance - human eye favours green colour...
345345
double a = (1
346346
- (((0.299 * color.R)
347347
+ ((0.587 * color.G) + (0.114 * color.B)))
348348
/ 255));
349349
int d = a < 0.5 ? 0 : 255;
350350

351-
// dark colors - white font
351+
// dark colours - white font
352352
return Color.FromArgb(d, d, d);
353353
}
354354
#endregion
@@ -362,7 +362,7 @@ private static Color ContrastColor(Color color)
362362
/// <param name="font">Font to use for text.</param>
363363
/// <param name="bounds">Bounding area for the text.</param>
364364
/// <param name="state">State of the source element.</param>
365-
/// <param name="color">Color of the text.</param>
365+
/// <param name="color"><see cref="Color"/> of the text.</param>
366366
/// <param name="copyBackground">Should existing background be copied into the bitmap.</param>
367367
public static void DrawCompositionGlowingText(Graphics g,
368368
string text,
@@ -386,7 +386,7 @@ public static void DrawCompositionGlowingText(Graphics g,
386386
bmi.biBitCount = 32;
387387
bmi.biPlanes = 1;
388388

389-
// Create a device independant bitmp and select into the memory DC
389+
// Create a device independent bitmap and select into the memory DC
390390
IntPtr hDIB = PI.CreateDIBSection(gDC, bmi, 0, 0, IntPtr.Zero, 0);
391391
PI.SelectObject(mDC, hDIB);
392392

@@ -463,7 +463,7 @@ public static void DrawCompositionGlowingText(Graphics g,
463463
/// <param name="font">Font to use for text.</param>
464464
/// <param name="bounds">Bounding area for the text.</param>
465465
/// <param name="state">State of the source element.</param>
466-
/// <param name="color">Color of the text.</param>
466+
/// <param name="color"><see cref="Color"/> of the text.</param>
467467
/// <param name="copyBackground">Should existing background be copied into the bitmap.</param>
468468
/// <param name="sf">StringFormat of the memento.</param>
469469
public static void DrawCompositionText(Graphics g,
@@ -489,7 +489,7 @@ public static void DrawCompositionText(Graphics g,
489489
bmi.biBitCount = 32;
490490
bmi.biPlanes = 1;
491491

492-
// Create a device independant bitmp and select into the memory DC
492+
// Create a device independent bitmap and select into the memory DC
493493
IntPtr hDIB = PI.CreateDIBSection(gDC, bmi, 0, 0, IntPtr.Zero, 0);
494494
PI.SelectObject(mDC, hDIB);
495495

@@ -664,46 +664,46 @@ private static TextFormatFlags StringFormatToFlags(StringFormat sf)
664664

665665
// Translation table: http://msdn.microsoft.com/msdnmag/issues/06/03/TextRendering/default.aspx?fig=true#fig4
666666

667-
// Horizontal Alignment
668-
if (sf.Alignment == StringAlignment.Center)
669-
{
670-
flags = flags & TextFormatFlags.HorizontalCenter;
671-
}
672-
else if (sf.Alignment == StringAlignment.Far)
667+
switch (sf.Alignment)
673668
{
674-
flags = flags & TextFormatFlags.Right;
675-
}
676-
else
677-
{
678-
flags = flags & TextFormatFlags.Left;
669+
// Horizontal Alignment
670+
case StringAlignment.Center:
671+
flags = flags & TextFormatFlags.HorizontalCenter;
672+
break;
673+
case StringAlignment.Far:
674+
flags = flags & TextFormatFlags.Right;
675+
break;
676+
default:
677+
flags = flags & TextFormatFlags.Left;
678+
break;
679679
}
680680

681-
// Vertical Alignment
682-
if (sf.LineAlignment == StringAlignment.Far)
683-
{
684-
flags = flags & TextFormatFlags.Bottom;
685-
}
686-
else if (sf.LineAlignment == StringAlignment.Center)
687-
{
688-
flags = flags & TextFormatFlags.VerticalCenter;
689-
}
690-
else
681+
switch (sf.LineAlignment)
691682
{
692-
flags = flags & TextFormatFlags.Top;
683+
// Vertical Alignment
684+
case StringAlignment.Far:
685+
flags = flags & TextFormatFlags.Bottom;
686+
break;
687+
case StringAlignment.Center:
688+
flags = flags & TextFormatFlags.VerticalCenter;
689+
break;
690+
default:
691+
flags = flags & TextFormatFlags.Top;
692+
break;
693693
}
694694

695-
// Ellipsis
696-
if (sf.Trimming == StringTrimming.EllipsisCharacter)
695+
switch (sf.Trimming)
697696
{
698-
flags = flags & TextFormatFlags.EndEllipsis;
699-
}
700-
else if (sf.Trimming == StringTrimming.EllipsisPath)
701-
{
702-
flags = flags & TextFormatFlags.PathEllipsis;
703-
}
704-
else if (sf.Trimming == StringTrimming.EllipsisWord)
705-
{
706-
flags = flags & TextFormatFlags.WordEllipsis;
697+
// Ellipsis
698+
case StringTrimming.EllipsisCharacter:
699+
flags = flags & TextFormatFlags.EndEllipsis;
700+
break;
701+
case StringTrimming.EllipsisPath:
702+
flags = flags & TextFormatFlags.PathEllipsis;
703+
break;
704+
case StringTrimming.EllipsisWord:
705+
flags = flags & TextFormatFlags.WordEllipsis;
706+
break;
707707
}
708708

709709
// Hotkey Prefix

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Toolkit/AccurateText/AccurateTextMemento.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ public class AccurateTextMemento : GlobalId,
2727

2828
#region Instance Fields
2929
private readonly bool _disposeFont;
30-
private TextRenderingHint _hint;
31-
#endregion
30+
#endregion
3231

3332
#region Identity
3433
/// <summary>
@@ -51,8 +50,7 @@ internal AccurateTextMemento(string text,
5150
Size = new Size((int)sizeF.Width + 1, (int)sizeF.Height + 1);
5251
Font = font;
5352
Format = format;
54-
_hint = hint;
55-
_disposeFont = disposeFont;
53+
_disposeFont = disposeFont;
5654
}
5755

5856
/// <summary>

Source/Architectures/Any CPU/Krypton Components/ComponentFactory.Krypton.Toolkit/ComponentFactory.Krypton.Toolkit 2018.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3737
<IsWebBootstrapper>false</IsWebBootstrapper>
3838
<UseApplicationTrust>false</UseApplicationTrust>
39-
4039
<TargetFrameworkProfile />
4140
<ShouldCreateLogs>True</ShouldCreateLogs>
4241
<AdvancedSettingsExpanded>False</AdvancedSettingsExpanded>
@@ -58,8 +57,8 @@
5857
<DocumentationFile>..\..\..\..\..\Bin\Versions\4.7\Any CPU\Krypton Core Components\ComponentFactory.Krypton.Toolkit.xml</DocumentationFile>
5958
<CodeAnalysisRules>
6059
</CodeAnalysisRules>
61-
6260
<Prefer32Bit>false</Prefer32Bit>
61+
<LangVersion>latest</LangVersion>
6362
</PropertyGroup>
6463
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
6564
<DebugType>pdbonly</DebugType>
@@ -69,7 +68,6 @@
6968
<ErrorReport>prompt</ErrorReport>
7069
<WarningLevel>4</WarningLevel>
7170
<DocumentationFile>..\..\..\Bin\ComponentFactory.Krypton.Toolkit.XML</DocumentationFile>
72-
7371
<Prefer32Bit>false</Prefer32Bit>
7472
</PropertyGroup>
7573
<PropertyGroup>
@@ -1062,7 +1060,7 @@
10621060
</PropertyGroup>
10631061
<ProjectExtensions>
10641062
<VisualStudio>
1065-
<UserProperties BuildVersion_StartDate="2000/1/1" DocumentXCommentEditorState="&lt;HtmlEditState&gt;&#xA; &lt;Attributes /&gt;&#xA;&lt;/HtmlEditState&gt;" />
1063+
<UserProperties DocumentXCommentEditorState="&lt;HtmlEditState&gt;&#xA; &lt;Attributes /&gt;&#xA;&lt;/HtmlEditState&gt;" BuildVersion_StartDate="2000/1/1" />
10661064
</VisualStudio>
10671065
</ProjectExtensions>
10681066
</Project>

0 commit comments

Comments
 (0)