Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick 2023.12.25 #27

Merged
merged 4 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1867,23 +1867,22 @@ Uri imageUri
)
{
//Extract file extension without '.'
String path = imageUri.OriginalString;
ReadOnlySpan<char> extension = Path.GetExtension(path).ToLower(CultureInfo.InvariantCulture).AsSpan(1);

ReadOnlySpan<char> path = imageUri.OriginalString.AsSpan();
ReadOnlySpan<char> extension = Path.GetExtension(path).Slice(1);
ContentType contentType;
if (extension.Equals(XpsS0Markup.JpgExtension, StringComparison.Ordinal))
if (extension.Equals(XpsS0Markup.JpgExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.JpgContentType;
contentType = XpsS0Markup.JpgContentType;
}
else if (extension.Equals(XpsS0Markup.PngExtension, StringComparison.Ordinal))
else if (extension.Equals(XpsS0Markup.PngExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.PngContentType;
}
else if (extension.Equals(XpsS0Markup.TifExtension, StringComparison.Ordinal))
else if (extension.Equals(XpsS0Markup.TifExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.TifContentType;
}
else if (extension.Equals(XpsS0Markup.WdpExtension, StringComparison.Ordinal))
else if (extension.Equals(XpsS0Markup.WdpExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.WdpContentType;
}
Expand All @@ -1892,9 +1891,8 @@ Uri imageUri
//default to PNG
contentType = XpsS0Markup.PngContentType;
}

return contentType;
}
}


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace System.Xaml.Schema
public class XamlTypeInvoker
{
private static XamlTypeInvoker s_Unknown;
private static object[] s_emptyObjectArray = Array.Empty<object>();

private Dictionary<XamlType, MethodInfo> _addMethods;
internal MethodInfo EnumeratorMethod { get; set; }
Expand Down Expand Up @@ -226,7 +225,7 @@ public virtual IEnumerator GetItems(object instance)
throw new NotSupportedException(SR.Get(SRID.OnlySupportedOnCollectionsAndDictionaries));
}
MethodInfo getEnumMethod = GetEnumeratorMethod();
return (IEnumerator)SafeReflectionInvoker.InvokeMethod(getEnumMethod, instance, s_emptyObjectArray);
return (IEnumerator)SafeReflectionInvoker.InvokeMethod(getEnumMethod, instance, Array.Empty<object>());
}

// vvvvv---- Unused members. Servicing policy is to retain these anyway. -----vvvvv
Expand Down