diff --git a/src/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs b/src/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs index 6b9b7f457fe1..6183ea30a71b 100644 --- a/src/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs +++ b/src/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs @@ -18,3 +18,4 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.PermissionSet))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Permissions.PermissionState))] #endif + diff --git a/src/System.Security.Permissions/ref/System.Security.Permissions.cs b/src/System.Security.Permissions/ref/System.Security.Permissions.cs index f38b82cfeb01..e862fa284023 100644 --- a/src/System.Security.Permissions/ref/System.Security.Permissions.cs +++ b/src/System.Security.Permissions/ref/System.Security.Permissions.cs @@ -2091,33 +2091,4 @@ public enum AspNetHostingPermissionLevel Unrestricted = 600, } } -namespace System.Xaml.Permissions -{ - public partial class XamlAccessLevel - { - internal XamlAccessLevel() { } - public System.Reflection.AssemblyName AssemblyAccessToAssemblyName { get { throw null; } } - public string PrivateAccessToTypeName { get { throw null; } } - public static System.Xaml.Permissions.XamlAccessLevel AssemblyAccessTo(System.Reflection.Assembly assembly) { throw null; } - public static System.Xaml.Permissions.XamlAccessLevel AssemblyAccessTo(System.Reflection.AssemblyName assemblyName) { throw null; } - public static System.Xaml.Permissions.XamlAccessLevel PrivateAccessTo(string assemblyQualifiedTypeName) { throw null; } - public static System.Xaml.Permissions.XamlAccessLevel PrivateAccessTo(System.Type type) { throw null; } - } - public sealed partial class XamlLoadPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission - { - public XamlLoadPermission(System.Collections.Generic.IEnumerable allowedAccess) { } - public XamlLoadPermission(System.Security.Permissions.PermissionState state) { } - public XamlLoadPermission(System.Xaml.Permissions.XamlAccessLevel allowedAccess) { } - public System.Collections.Generic.IList AllowedAccess { get { throw null; } } - public override System.Security.IPermission Copy() { throw null; } - public override bool Equals(object obj) { throw null; } - public override void FromXml(System.Security.SecurityElement elem) { } - public override int GetHashCode() { throw null; } - public bool Includes(System.Xaml.Permissions.XamlAccessLevel requestedAccess) { throw null; } - public override System.Security.IPermission Intersect(System.Security.IPermission target) { throw null; } - public override bool IsSubsetOf(System.Security.IPermission target) { throw null; } - public bool IsUnrestricted() { throw null; } - public override System.Security.SecurityElement ToXml() { throw null; } - public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; } - } -} + diff --git a/src/System.Security.Permissions/ref/System.Security.Permissions.csproj b/src/System.Security.Permissions/ref/System.Security.Permissions.csproj index d2b4c998d46c..4372861e3128 100644 --- a/src/System.Security.Permissions/ref/System.Security.Permissions.csproj +++ b/src/System.Security.Permissions/ref/System.Security.Permissions.csproj @@ -1,4 +1,4 @@ - + {07CAF142-B259-418E-86EF-C4BD8B50253E} true @@ -9,6 +9,9 @@ + + + @@ -39,4 +42,7 @@ + + + diff --git a/src/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs b/src/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs new file mode 100644 index 000000000000..5d3c1d7eea6d --- /dev/null +++ b/src/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the http://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +namespace System.Xaml.Permissions +{ + public sealed partial class XamlLoadPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission + { + public XamlLoadPermission(System.Collections.Generic.IEnumerable allowedAccess) { } + public XamlLoadPermission(System.Security.Permissions.PermissionState state) { } + public XamlLoadPermission(System.Xaml.Permissions.XamlAccessLevel allowedAccess) { } + public System.Collections.Generic.IList AllowedAccess { get { throw null; } } + public override System.Security.IPermission Copy() { throw null; } + public override bool Equals(object obj) { throw null; } + public override void FromXml(System.Security.SecurityElement elem) { } + public override int GetHashCode() { throw null; } + public bool Includes(System.Xaml.Permissions.XamlAccessLevel requestedAccess) { throw null; } + public override System.Security.IPermission Intersect(System.Security.IPermission target) { throw null; } + public override bool IsSubsetOf(System.Security.IPermission target) { throw null; } + public bool IsUnrestricted() { throw null; } + public override System.Security.SecurityElement ToXml() { throw null; } + public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; } + } +} diff --git a/src/System.Security.Permissions/src/System.Security.Permissions.csproj b/src/System.Security.Permissions/src/System.Security.Permissions.csproj index 9d3ca6e39fb0..7498d5970e94 100644 --- a/src/System.Security.Permissions/src/System.Security.Permissions.csproj +++ b/src/System.Security.Permissions/src/System.Security.Permissions.csproj @@ -1,4 +1,4 @@ - + {07390899-C8F6-4E83-A3A9-6867B8CB46A0} System.Security.Permissions @@ -178,7 +178,8 @@ - + + @@ -228,4 +229,7 @@ + + + diff --git a/src/System.Security.Permissions/tests/PermissionTests.cs b/src/System.Security.Permissions/tests/PermissionTests.cs index e1cf80ff586d..8494d5c2328d 100644 --- a/src/System.Security.Permissions/tests/PermissionTests.cs +++ b/src/System.Security.Permissions/tests/PermissionTests.cs @@ -7,7 +7,6 @@ using System.DirectoryServices; using System.Reflection; using System.Web; -using System.Xaml.Permissions; namespace System.Security.Permissions.Tests { @@ -444,26 +443,6 @@ public static void WebBrowserPermissionAttributeCallMethods() IPermission ip = wpa.CreatePermission(); } - [Fact] - public static void XamlLoadPermissionCallMethods() - { - XamlAccessLevel accessLevel = XamlAccessLevel.AssemblyAccessTo(Assembly.GetExecutingAssembly().GetName()); - XamlLoadPermission xp = new XamlLoadPermission(accessLevel); - XamlLoadPermission xp2 = new XamlLoadPermission(PermissionState.Unrestricted); - XamlLoadPermission xp3 = new XamlLoadPermission(Array.Empty()); - bool testbool = xp.IsUnrestricted(); - IPermission ip = xp.Copy(); - IPermission ip2 = xp.Intersect(ip); - IPermission ip3 = xp.Union(ip); - testbool = xp.IsSubsetOf(ip); - testbool = xp.Equals(new object()); - testbool = xp.Includes(accessLevel); - int hash = xp.GetHashCode(); - SecurityElement se = new SecurityElement(""); - xp.FromXml(se); - se = xp.ToXml(); - } - [Fact] public static void ZoneIdentityPermissionCallMethods() { diff --git a/src/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj b/src/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj index 402e93a13761..bf3edac06971 100644 --- a/src/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj +++ b/src/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj @@ -18,6 +18,8 @@ - + + + diff --git a/src/System.Security.Permissions/tests/XamlLoadPermissionTests.cs b/src/System.Security.Permissions/tests/XamlLoadPermissionTests.cs new file mode 100644 index 000000000000..cb2e5c83548f --- /dev/null +++ b/src/System.Security.Permissions/tests/XamlLoadPermissionTests.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Xunit; +using System.Configuration; +using System.DirectoryServices; +using System.Reflection; +using System.Security; +using System.Security.Permissions; +using System.Web; +using System.Xaml.Permissions; + +namespace System.Xaml.Permissions.Tests +{ + public class XamlLoadPermissionTests + { + [Fact] + public static void XamlLoadPermissionCallMethods() + { + XamlAccessLevel accessLevel = XamlAccessLevel.AssemblyAccessTo(Assembly.GetExecutingAssembly().GetName()); + XamlLoadPermission xp = new XamlLoadPermission(accessLevel); + XamlLoadPermission xp2 = new XamlLoadPermission(PermissionState.Unrestricted); + XamlLoadPermission xp3 = new XamlLoadPermission(Array.Empty()); + bool testbool = xp.IsUnrestricted(); + IPermission ip = xp.Copy(); + IPermission ip2 = xp.Intersect(ip); + IPermission ip3 = xp.Union(ip); + testbool = xp.IsSubsetOf(ip); + testbool = xp.Equals(new object()); + testbool = xp.Includes(accessLevel); + int hash = xp.GetHashCode(); + SecurityElement se = new SecurityElement(""); + xp.FromXml(se); + se = xp.ToXml(); + } + } +} diff --git a/src/System.Windows.Extensions/ref/System.Windows.Extensions.cs b/src/System.Windows.Extensions/ref/System.Windows.Extensions.cs index 581a77931128..41ebd7db878e 100644 --- a/src/System.Windows.Extensions/ref/System.Windows.Extensions.cs +++ b/src/System.Windows.Extensions/ref/System.Windows.Extensions.cs @@ -133,3 +133,16 @@ public enum X509SelectionFlag MultiSelection = 1, } } +namespace System.Xaml.Permissions +{ + public partial class XamlAccessLevel + { + internal XamlAccessLevel() { } + public System.Reflection.AssemblyName AssemblyAccessToAssemblyName { get { throw null; } } + public string PrivateAccessToTypeName { get { throw null; } } + public static System.Xaml.Permissions.XamlAccessLevel AssemblyAccessTo(System.Reflection.Assembly assembly) { throw null; } + public static System.Xaml.Permissions.XamlAccessLevel AssemblyAccessTo(System.Reflection.AssemblyName assemblyName) { throw null; } + public static System.Xaml.Permissions.XamlAccessLevel PrivateAccessTo(string assemblyQualifiedTypeName) { throw null; } + public static System.Xaml.Permissions.XamlAccessLevel PrivateAccessTo(System.Type type) { throw null; } + } +} diff --git a/src/System.Windows.Extensions/src/System.Windows.Extensions.csproj b/src/System.Windows.Extensions/src/System.Windows.Extensions.csproj index fc4a9bf2f39e..c45d8a141716 100644 --- a/src/System.Windows.Extensions/src/System.Windows.Extensions.csproj +++ b/src/System.Windows.Extensions/src/System.Windows.Extensions.csproj @@ -71,6 +71,7 @@ + diff --git a/src/System.Security.Permissions/src/System/Xaml/Permissions/XamlAccessLevel.cs b/src/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs similarity index 96% rename from src/System.Security.Permissions/src/System/Xaml/Permissions/XamlAccessLevel.cs rename to src/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs index 7bea5cf0a9bc..80b5fef5f7f4 100644 --- a/src/System.Security.Permissions/src/System/Xaml/Permissions/XamlAccessLevel.cs +++ b/src/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/System.Windows.Extensions/tests/System.Windows.Extensions.Tests.csproj b/src/System.Windows.Extensions/tests/System.Windows.Extensions.Tests.csproj index b0836e434797..a7eeb64c180a 100644 --- a/src/System.Windows.Extensions/tests/System.Windows.Extensions.Tests.csproj +++ b/src/System.Windows.Extensions/tests/System.Windows.Extensions.Tests.csproj @@ -6,6 +6,7 @@ + diff --git a/src/System.Security.Permissions/tests/XamlAccessLevelTests.cs b/src/System.Windows.Extensions/tests/XamlAccessLevelTests.cs similarity index 93% rename from src/System.Security.Permissions/tests/XamlAccessLevelTests.cs rename to src/System.Windows.Extensions/tests/XamlAccessLevelTests.cs index a1488ee20835..d321b85ec87d 100644 --- a/src/System.Security.Permissions/tests/XamlAccessLevelTests.cs +++ b/src/System.Windows.Extensions/tests/XamlAccessLevelTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information.