Skip to content

Commit 6665d3e

Browse files
committed
Revert "Removing NET check"
This reverts commit 753cd86.
1 parent 753cd86 commit 6665d3e

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/TaskHelper.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ internal static string GetWholeExceptionMessage(Exception exception)
203203
while (e.InnerException != null)
204204
{
205205
Exception eInner = e.InnerException;
206-
#pragma warning disable CA2249
206+
#if NET
207+
if (!e.Message.Contains(eInner.Message, StringComparison.Ordinal))
208+
#else
207209
if (e.Message.IndexOf(eInner.Message, StringComparison.Ordinal) == -1)
208-
#pragma warning restore CA2249
210+
#endif
209211
{
210212
message += ", ";
211213
message += eInner.Message;

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/UidManager.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,11 @@ private UidCollector ParseFile(string fileName)
518518
collector.RootElementLinePosition = reader.LinePosition;
519519
}
520520

521-
#pragma warning disable CA1847
521+
#if NET
522+
if (reader.Name.Contains('.'))
523+
#else
522524
if (reader.Name.Contains("."))
523-
#pragma warning restore CA1847
525+
#endif
524526
{
525527
// the name has a dot, which suggests it is a property tag.
526528
// we will ignore adding uid

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/MarkupExtensionParser.cs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1465,9 +1465,11 @@ private string ResolveAttributeNamespaceURI(string prefix, string name, string p
14651465
// if the prefix was "" then
14661466
// 1) normal properties resolve to the parent Tag namespace.
14671467
// 2) Attached properties resolve to the "" default namespace.
1468-
#pragma warning disable CA1847
1468+
#if NET
1469+
if (!name.Contains('.'))
1470+
#else
14691471
if (!name.Contains("."))
1470-
#pragma warning restore CA1847
1472+
#endif
14711473
attribNamespaceURI = parentURI;
14721474
else
14731475
attribNamespaceURI = _parserHelper.LookupNamespace("");
@@ -1626,9 +1628,11 @@ internal static void RemoveEscapes(ref string value)
16261628
if (builder == null)
16271629
{
16281630
builder = new StringBuilder(value.Length);
1629-
#pragma warning disable CA1846
1631+
#if NET
1632+
builder.Append(value.AsSpan(0,i));
1633+
#else
16301634
builder.Append(value.Substring(0,i));
1631-
#pragma warning restore CA1846
1635+
#endif
16321636
}
16331637
noEscape = false;
16341638
}

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlReaderHelper.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2738,9 +2738,11 @@ private string ResolveAttributeNamespaceURI(string prefix, string name, string p
27382738
// if the prefix was "" then
27392739
// 1) normal properties resolve to the parent Tag namespace.
27402740
// 2) Attached properties resolve to the "" default namespace.
2741-
#pragma warning disable CA1847
2741+
#if NET
2742+
if (!name.Contains('.'))
2743+
#else
27422744
if (!name.Contains("."))
2743-
#pragma warning restore CA1847
2745+
#endif
27442746
attribNamespaceURI = parentURI;
27452747
else
27462748
attribNamespaceURI = XmlReader.LookupNamespace("");

0 commit comments

Comments
 (0)