60 references to FontStyle
System.Windows.Forms.Analyzers (2)
System\Windows\Forms\Analyzers\ApplicationConfig.FontDescriptor.cs (2)
13
public FontDescriptor(string fontName, float emSize,
FontStyle
style, GraphicsUnit unit)
23
public
FontStyle
Style { get; }
System.Windows.Forms.Analyzers.CSharp (11)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.FontConverter.cs (11)
35
FontStyle
fontStyle =
FontStyle
.Regular;
104
fontStyle |= (
FontStyle
)Enum.Parse(typeof(
FontStyle
), styleText, true);
107
FontStyle
validBits =
FontStyle
.Regular |
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Underline |
FontStyle
.Strikeout;
110
throw new InvalidEnumArgumentException(nameof(style), (int)fontStyle, typeof(
FontStyle
));
System.Windows.Forms.Analyzers.CSharp.Tests (30)
FontConverterTests.cs (26)
36
testData.Add(culture, $"Courier New", "Courier New", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Regular);
37
testData.Add(culture, $"Courier New{s_separator} 11", "Courier New", 11f, (int)GraphicsUnit.Point, (int)
FontStyle
.Regular);
38
testData.Add(culture, $"Arial{s_separator} 11px", "Arial", 11f, (int)GraphicsUnit.Pixel, (int)
FontStyle
.Regular);
39
testData.Add(culture, $"Courier New{s_separator} 11 px", "Courier New", 11f, (int)GraphicsUnit.Pixel, (int)
FontStyle
.Regular);
40
testData.Add(culture, $"Courier New{s_separator} 11 px{s_separator} style=Regular", "Courier New", 11f, (int)GraphicsUnit.Pixel, (int)
FontStyle
.Regular);
41
testData.Add(culture, $"Courier New{s_separator} style=Bold", "Courier New", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Bold);
42
testData.Add(culture, $"Courier New{s_separator} 11 px{s_separator} style=Bold{s_separator} Italic", "Courier New", 11f, (int)GraphicsUnit.Pixel, (int)(
FontStyle
.Bold |
FontStyle
.Italic));
43
testData.Add(culture, $"Courier New{s_separator} 11 px{s_separator} style=Regular, Italic", "Courier New", 11f, (int)GraphicsUnit.Pixel, (int)(
FontStyle
.Regular |
FontStyle
.Italic));
44
testData.Add(culture, $"Courier New{s_separator} 11 px{s_separator} style=Bold{s_separator} Italic{s_separator} Strikeout", "Courier New", 11f, (int)GraphicsUnit.Pixel, (int)(
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Strikeout));
45
testData.Add(culture, $"Arial{s_separator} 11 px{s_separator} style=Bold, Italic, Strikeout", "Arial", 11f, (int)GraphicsUnit.Pixel, (int)(
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Strikeout));
46
testData.Add(culture, $"arIAL{s_separator} 10{s_separator} style=bold", "arIAL", 10f, (int)GraphicsUnit.Point, (int)
FontStyle
.Bold);
47
testData.Add(culture, $"Arial{s_separator} 10{s_separator}", "Arial", 10f, (int)GraphicsUnit.Point, (int)
FontStyle
.Regular);
48
testData.Add(culture, $"Arial{s_separator}", "Arial", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Regular);
49
testData.Add(culture, $"Arial{s_separator} 10{s_separator} style=12", "Arial", 10f, (int)GraphicsUnit.Point, (int)(
FontStyle
.Underline |
FontStyle
.Strikeout));
50
testData.Add(culture, $"Courier New{s_separator} Style=Bold", "Courier New", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Bold); // FullFramework style keyword is case sensitive.
51
testData.Add(culture, $"{s_separator} 10{s_separator} style=bold", "", 10f, (int)GraphicsUnit.Point, (int)
FontStyle
.Bold);
54
testData.Add(culture, $"11px{s_separator} Style=Bold", $"11px", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Bold);
55
testData.Add(culture, $"11px", "11px", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Regular);
56
testData.Add(culture, $"Style=Bold", "Style=Bold", PropertyDefaultValue.FontSize, (int)GraphicsUnit.Point, (int)
FontStyle
.Regular);
Generators\ApplicationConfigurationGenerator\ApplicationConfigurationInitializeBuilderTests.cs (4)
116
DefaultFont: new FontDescriptor(string.Empty, 12,
FontStyle
.Bold |
FontStyle
.Italic, GraphicsUnit.Millimeter).ToString(),
127
DefaultFont: new FontDescriptor("Tahoma", 12,
FontStyle
.Regular, GraphicsUnit.Point).ToString(),
138
DefaultFont: new FontDescriptor("Microsoft Sans Serif", 8.25f,
FontStyle
.Regular, GraphicsUnit.Point).ToString(),
System.Windows.Forms.Analyzers.Tests (17)
Analyzers\AppManifestAnalyzer\FontDescriptorTests.cs (8)
25
style:
FontStyle
.Bold |
FontStyle
.Italic,
30
Assert.Equal(
FontStyle
.Bold |
FontStyle
.Italic, descriptor.Style);
48
style:
FontStyle
.Bold |
FontStyle
.Italic,
72
style:
FontStyle
.Bold |
FontStyle
.Italic,
Analyzers\AppManifestAnalyzer\FontStyleTests.cs (9)
14
var values = Enum.GetValues(typeof(
FontStyle
));
19
[InlineData("Bold",
FontStyle
.Bold)]
20
[InlineData("Italic",
FontStyle
.Italic)]
21
[InlineData("Regular",
FontStyle
.Regular)]
22
[InlineData("Strikeout",
FontStyle
.Strikeout)]
23
[InlineData("Underline",
FontStyle
.Underline)]
24
internal void CanConvertFrom(string input,
FontStyle
expected)
26
FontStyle
value = Enum.Parse<
FontStyle
>(input);