diff options
Diffstat (limited to 'src/mscorlib/src/System/Security/Policy/Site.cs')
-rw-r--r-- | src/mscorlib/src/System/Security/Policy/Site.cs | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/mscorlib/src/System/Security/Policy/Site.cs b/src/mscorlib/src/System/Security/Policy/Site.cs index e7c6cd3d83..14a95e1666 100644 --- a/src/mscorlib/src/System/Security/Policy/Site.cs +++ b/src/mscorlib/src/System/Security/Policy/Site.cs @@ -10,6 +10,7 @@ // using System; +using System.Diagnostics; using System.Diagnostics.Contracts; using System.Globalization; using System.Security.Permissions; @@ -26,7 +27,7 @@ namespace System.Security.Policy public Site(String name) { if (name == null) - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); Contract.EndContractBlock(); m_name = new SiteString( name ); @@ -34,7 +35,7 @@ namespace System.Security.Policy private Site(SiteString name) { - Contract.Assert(name != null); + Debug.Assert(name != null); m_name = name; } @@ -94,30 +95,6 @@ namespace System.Security.Policy return Clone(); } -#if FEATURE_CAS_POLICY - internal SecurityElement ToXml() - { - SecurityElement elem = new SecurityElement( "System.Security.Policy.Site" ); - // If you hit this assert then most likely you are trying to change the name of this class. - // This is ok as long as you change the hard coded string above and change the assert below. - Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Site" ), "Class name changed!" ); - - elem.AddAttribute( "version", "1" ); - - if(m_name != null) - elem.AddChild( new SecurityElement( "Name", m_name.ToString() ) ); - - return elem; - } -#endif // FEATURE_CAS_POLICY - -#if FEATURE_CAS_POLICY - public override String ToString() - { - return ToXml().ToString(); - } -#endif // FEATURE_CAS_POLICY - // INormalizeForIsolatedStorage is not implemented for startup perf // equivalent to INormalizeForIsolatedStorage.Normalize() internal Object Normalize() |