Просмотр исходного кода

[System.Runtime.Serialization] Dip toes into using ReferenceSource

Miguel de Icaza 11 лет назад
Родитель
Сommit
8f32e290ad

+ 1 - 0
mcs/class/System.Runtime.Serialization/Makefile

@@ -7,6 +7,7 @@ RESOURCE_FILES = \
 
 LIBRARY = System.Runtime.Serialization.dll
 LIB_MCS_FLAGS = \
+		-unsafe \
 		/nowarn:168,169,219,414 \
 		/r:System.dll \
 		/r:System.Xml.dll \

+ 1 - 1
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources

@@ -12,7 +12,7 @@ System.Runtime.Serialization.Configuration/TypeElement.cs
 System.Runtime.Serialization.Configuration/TypeElementCollection.cs
 System.Runtime.Serialization/CollectionDataContractAttribute.cs
 System.Runtime.Serialization/ContractNamespaceAttribute.cs
-System.Runtime.Serialization/DataContractAttribute.cs
+../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs
 System.Runtime.Serialization/DataContractResolver.cs
 System.Runtime.Serialization/DataContractSerializer.cs
 System.Runtime.Serialization/DataMemberAttribute.cs

+ 0 - 59
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractAttribute.cs

@@ -1,59 +0,0 @@
-//
-// DataContractAttribute.cs
-//
-// Author:
-//	Atsushi Enomoto <[email protected]>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if NET_2_0
-using System;
-
-namespace System.Runtime.Serialization
-{
-	[AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, 
-		Inherited = false, AllowMultiple = false)]
-	public sealed class DataContractAttribute : Attribute
-	{
-		string name, ns;
-
-		public DataContractAttribute ()
-		{
-		}
-
-		public string Name {
-			get { return name; }
-			set { name = value; }
-		}
-
-		// the default namespace for XmlFormatter (with SharedSchema) is
-		// http://schemas.datacontract.org/2004/07/ .
-		public string Namespace {
-			get { return ns; }
-			set { ns = value; }
-		}
-
-		// new in 3.5 SP1
-		public bool IsReference { get; set; }
-	}
-}
-#endif

+ 0 - 30
mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs

@@ -26,7 +26,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
 using System;
 using System.Collections.Generic;
 using System.Security;
@@ -53,10 +52,6 @@ namespace System.Xml
 			this.guid = id;
 		}
 
-#if !NET_2_1
-		[SecurityCritical]
-		[SecurityTreatAsSafe]
-#endif
 		public UniqueId (string value)
 		{
 			if (value == null)
@@ -68,10 +63,6 @@ namespace System.Xml
 			this.id = value;
 		}
 
-#if !NET_2_1
-		[SecurityCritical]
-		[SecurityTreatAsSafe]
-#endif
 		public UniqueId (byte [] id, int offset)
 		{
 			if (id == null)
@@ -93,10 +84,6 @@ namespace System.Xml
 			}
 		}
 
-#if !NET_2_1
-		[SecurityCritical]
-		[SecurityTreatAsSafe]
-#endif
 		public UniqueId (char [] id, int offset, int count)
 		{
 			if (id == null)
@@ -122,10 +109,6 @@ namespace System.Xml
 		}
 
 		public int CharArrayLength {
-#if !NET_2_1
-			[SecurityCritical]
-			[SecurityTreatAsSafe]
-#endif
 			get {return id != null ? id.Length : 45;}
 		}
 
@@ -163,10 +146,6 @@ namespace System.Xml
 			return ! (id1 == id2);
 		}
 
-#if !NET_2_1
-		[SecurityCritical]
-		[SecurityTreatAsSafe]
-#endif
 		public int ToCharArray (char [] array, int offset)
 		{
 			if (array == null)
@@ -179,10 +158,6 @@ namespace System.Xml
 			return s.Length;
 		}
 
-#if !NET_2_1
-		[SecurityCritical]
-		[SecurityTreatAsSafe]
-#endif
 		public override string ToString ()
 		{
 			if (id == null)
@@ -202,10 +177,6 @@ namespace System.Xml
 			}
 		}
 
-#if !NET_2_1
-		[SecurityCritical]
-		[SecurityTreatAsSafe]
-#endif
 		public bool TryGetGuid (byte [] buffer, int offset)
 		{
 			if (!IsGuid)
@@ -223,4 +194,3 @@ namespace System.Xml
 		}
 	}
 }
-#endif

+ 1 - 1
mcs/class/System.Runtime.Serialization/mobile_System.Runtime.Serialization.dll.sources

@@ -12,7 +12,7 @@ Assembly/AssemblyInfo.cs
 ../System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs
 System.Runtime.Serialization/CollectionDataContractAttribute.cs
 System.Runtime.Serialization/ContractNamespaceAttribute.cs
-System.Runtime.Serialization/DataContractAttribute.cs
+../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs
 System.Runtime.Serialization/DataContractResolver.cs
 System.Runtime.Serialization/DataContractSerializer.cs
 System.Runtime.Serialization/DataContractSerializerSettings.cs