Skip to content

Commit 15490f4

Browse files
committed
Address PR Review comments
1 parent 3b85956 commit 15490f4

File tree

5 files changed

+142
-142
lines changed

5 files changed

+142
-142
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public static bool HasInternals
203203
///<summary>Complies list of file items comprising an Application.</summary>
204204
public void Compile(CompilationUnit cu)
205205
{
206-
// KnownTypes, XamlTypeMapper, and ReflectionHelper all hold on to data statically that
206+
// KnownTypes, XamlTypeMapper, and ReflectionHelper all hold on to data statically that
207207
// must not be reused between compilations as different compilations can target different
208208
//
209209
// Defensively clear static data even though the prior compilation should have done it.
@@ -625,7 +625,7 @@ private void GenerateSource()
625625
// } end namespace
626626
CodeCompileUnit ccu = new CodeCompileUnit();
627627

628-
// generate pragma checksum data
628+
// generate pragma checksum data
629629
Guid hashGuid = !string.IsNullOrEmpty(ChecksumAlgorithm) && ChecksumAlgorithm.Equals("SHA256", StringComparison.OrdinalIgnoreCase)
630630
? s_hashSHA256Guid
631631
: s_hashSHA1Guid;
@@ -700,7 +700,7 @@ private SourceFileInfo OnSourceFileResolve(FileUnit file)
700700
if (sourceFileInfo.IsXamlFile)
701701
{
702702
int fileExtIndex = file.Path.LastIndexOf(DOTCHAR);
703-
703+
704704
sourceFileInfo.RelativeSourceFilePath = file.Path.Substring(0, fileExtIndex);
705705
}
706706
}
@@ -849,9 +849,9 @@ internal void ProcessDefinitionNamespace(XamlDefTagNode xamlDefTagNode)
849849
case XmlNodeType.CDATA:
850850
case XmlNodeType.Text:
851851
{
852-
int lineNumber = 0;
852+
int lineNumber = 0;
853853

854-
if (xmlReader is IXmlLineInfo xmlLineInfo)
854+
if (xmlReader is IXmlLineInfo xmlLineInfo)
855855
{
856856
lineNumber = xmlLineInfo.LineNumber;
857857
}
@@ -1563,9 +1563,9 @@ private string ParentFolderPrefix
15631563
{
15641564
// During code generation, ParentFolderPrefix returns the relative path from a .g.cs file to its markup file.
15651565
//
1566-
// One example is generated #pragmas: #pragma checksum "..\..\..\..\Views\ExportNotificationView.xaml"
1566+
// One example is generated #pragmas: #pragma checksum "..\..\..\..\Views\ExportNotificationView.xaml"
15671567
//
1568-
// The path information for a markup file is represented in SourceFileInfo:
1568+
// The path information for a markup file is represented in SourceFileInfo:
15691569
//
15701570
// SourceFileInfo.OriginalFilePath: "c:\\greenshot\\src\\Greenshot.Addons\\Views\\ExportNotificationView.xaml"
15711571
// SourceFileInfo.TargetPath: "c:\\greenshot\\src\\Greenshot.Addons\\obj\\Debug\\net6.0-windows\\"
@@ -1582,23 +1582,23 @@ private string ParentFolderPrefix
15821582
//
15831583
// The relative path calculation must take in to account both the TargetPath and the RelativeFilePath:
15841584
//
1585-
// "c:\\greenshot\\src\\Greenshot.Addons\\obj\\Debug\\net6.0-windows\\" [SourceFileInfo.TargetPath]
1585+
// "c:\\greenshot\\src\\Greenshot.Addons\\obj\\Debug\\net6.0-windows\\" [SourceFileInfo.TargetPath]
15861586
// "Views\\ExportNotificationView" [SourceFileInfo.RelativeTargetPath]
15871587
//
15881588
// TargetPath concatenated with the directory portion of the RelativeTargetPath is the location to the .g.cs file:
15891589
//
15901590
// "c:\\greenshot\\src\\Greenshot.Addons\\obj\\Debug\\net6.0-windows\\Views"
1591-
//
1591+
//
15921592
string pathOfRelativeSourceFilePath = System.IO.Path.GetDirectoryName(SourceFileInfo.RelativeSourceFilePath);
15931593

1594-
// Return the parent folder of the target file with a trailing DirectorySeparatorChar.
1594+
// Return the parent folder of the target file with a trailing DirectorySeparatorChar.
15951595
// Return a relative path if possible. Else, return an absolute path.
1596-
#if NETFX
1596+
#if NETFX
15971597
string path = PathInternal.GetRelativePath(TargetPath + pathOfRelativeSourceFilePath, SourceFileInfo.SourcePath, StringComparison.OrdinalIgnoreCase);
15981598
#else
15991599
string path = Path.GetRelativePath(TargetPath + pathOfRelativeSourceFilePath, SourceFileInfo.SourcePath);
16001600
#endif
1601-
// Always return a path with a trailing DirectorySeparatorChar.
1601+
// Always return a path with a trailing DirectorySeparatorChar.
16021602
return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
16031603
}
16041604
else
@@ -1616,7 +1616,7 @@ private string ParentFolderPrefix
16161616
}
16171617

16181618
return parentFolderPrefix;
1619-
}
1619+
}
16201620
}
16211621
}
16221622

@@ -1850,7 +1850,7 @@ private CodeExpression GetPropertyValueExpression(ITypeDescriptorContext ctx, Ty
18501850

18511851
ce = cmie;
18521852
}
1853-
else if (desc.MemberInfo is ConstructorInfo ci)
1853+
else if (desc.MemberInfo is ConstructorInfo ci) // instance ctor invoke
18541854
{
18551855
ParameterInfo[] parameters = ci.GetParameters();
18561856

@@ -1938,10 +1938,10 @@ private CodeExpression GetEventDelegate(CodeContext cc, MemberInfo miEvent, stri
19381938
cDelExp = coce;
19391939
}
19401940

1941-
1941+
19421942
// The bug that this chunk of code works around was fixed but
19431943
// exposes a different bug. To work around the second bug, we
1944-
// remove the workaround for the first one.
1944+
// remove the workaround for the first one.
19451945
// Note that the initial bug was not fixed for VB, so the code block above remains.
19461946
// else if (Language == CompilerLanguage.JScript)
19471947
// {
@@ -2641,19 +2641,19 @@ private void GenerateInitializeComponent(bool isApp)
26412641
// - Modify the AssemblyVersionAttribute to a wildcard string (e.g. "1.2.*")
26422642
// - Set Deterministic to false in the build
26432643
// During MarkupCompilation, the AssemblyVersion property would not be set and WPF would correctly generate a resource URI without a version.
2644-
// In .NET Core/5 (or .NET Framework SDK-style projects), the same process can be used if GenerateAssemblyVersionAttribute is set to false in
2645-
// the build. However, this isn't really the idiomatic way to set the version for an assembly. Instead, developers are more likely to use the
2646-
// AssemblyVersion build property. If a developer explicitly sets the AssemblyVersion build property to a wildcard version string, we would use
2647-
// that as part of the URI here. This results in an error in Version.Parse during InitializeComponent's call tree. Instead, do as we would have
2644+
// In .NET Core/5 (or .NET Framework SDK-style projects), the same process can be used if GenerateAssemblyVersionAttribute is set to false in
2645+
// the build. However, this isn't really the idiomatic way to set the version for an assembly. Instead, developers are more likely to use the
2646+
// AssemblyVersion build property. If a developer explicitly sets the AssemblyVersion build property to a wildcard version string, we would use
2647+
// that as part of the URI here. This results in an error in Version.Parse during InitializeComponent's call tree. Instead, do as we would have
26482648
// when the developer sets a wildcard version string via AssemblyVersionAttribute and use an empty string.
26492649
string version = hasWildcard || String.IsNullOrEmpty(AssemblyVersion)
2650-
? String.Empty
2650+
? String.Empty
26512651
: COMPONENT_DELIMITER + VER + AssemblyVersion;
26522652

2653-
string token = String.IsNullOrEmpty(AssemblyPublicKeyToken)
2654-
? String.Empty
2653+
string token = String.IsNullOrEmpty(AssemblyPublicKeyToken)
2654+
? String.Empty
26552655
: COMPONENT_DELIMITER + AssemblyPublicKeyToken;
2656-
2656+
26572657
uriPart = FORWARDSLASH + AssemblyName + version + token + COMPONENT_DELIMITER + COMPONENT + FORWARDSLASH + resourceID;
26582658

26592659
//

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/MultiTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ internal override void Seal()
103103
_conditions[i].Property,
104104
LogicalOp.Equals,
105105
_conditions[i].Value,
106-
_conditions[i].SourceName ?? StyleHelper.SelfName);
106+
_conditions[i].SourceName ?? StyleHelper.SelfName);
107107
}
108108

109109
// Set conditions array for all property triggers

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Trigger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace System.Windows
1313
/// A single Style property conditional dependency driver
1414
/// </summary>
1515
[ContentProperty("Setters")]
16-
[XamlSetTypeConverterAttribute("ReceiveTypeConverter")]
16+
[XamlSetTypeConverterAttribute("ReceiveTypeConverter")]
1717
public class Trigger : TriggerBase, IAddChild, ISupportInitialize
1818
{
1919
/// <summary>
@@ -213,7 +213,7 @@ internal sealed override void Seal()
213213
_property,
214214
LogicalOp.Equals,
215215
_value,
216-
_sourceName ?? StyleHelper.SelfName) };
216+
_sourceName ?? StyleHelper.SelfName) };
217217

218218
// Set Condition for all property triggers
219219
for (int i = 0; i < PropertyValues.Count; i++)

0 commit comments

Comments
 (0)