diff options
Diffstat (limited to 'mcs/class')
775 files changed, 31676 insertions, 9233 deletions
diff --git a/mcs/class/Facades/Makefile b/mcs/class/Facades/Makefile index 6d18c6c58a..e8e8363b5f 100644 --- a/mcs/class/Facades/Makefile +++ b/mcs/class/Facades/Makefile @@ -1,23 +1,26 @@ +MCS_BUILD_DIR = ../../build + thisdir = class/Facades -net_4_5_SUBDIRS = System.Runtime System.Linq System.Xml.XmlSerializer \ - System.ServiceModel.Primitives System.Xml.ReaderWriter System.Diagnostics.Debug \ - System.Runtime.Extensions System.Diagnostics.Tools System.Collections \ - System.ComponentModel.EventBasedAsync System.ComponentModel System.ObjectModel \ - System.Text.RegularExpressions System.Threading System.Runtime.InteropServices \ - System.Reflection System.Globalization System.IO System.Reflection.Primitives \ - System.Resources.ResourceManager System.Security.Principal System.Text.Encoding \ - System.Text.Encoding.Extensions System.Linq.Queryable System.Linq.Expressions \ - System.Net.Primitives System.Net.Requests System.Net.NetworkInformation \ - System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml \ - System.Runtime.Serialization.Json System.ServiceModel.Http \ - System.Xml.XDocument System.Threading.Tasks System.Diagnostics.Contracts \ - System.Dynamic.Runtime System.ComponentModel.Annotations System.Runtime.Numerics \ - System.Linq.Parallel System.Collections.Concurrent System.Threading.Tasks.Parallel \ - System.Reflection.Extensions +monotouch_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \ + System.Diagnostics.Contracts System.Diagnostics.Debug System.Diagnostics.Tools System.Dynamic.Runtime System.Globalization System.IO System.Linq.Expressions \ + System.Linq.Parallel System.Linq.Queryable System.Linq System.Net.NetworkInformation System.Net.Primitives System.Net.Requests System.ObjectModel \ + System.Reflection.Extensions System.Reflection.Primitives System.Reflection System.Resources.ResourceManager System.Runtime.Extensions \ + System.Runtime.InteropServices System.Runtime.InteropServices.WindowsRuntime System.Runtime.Numerics System.Runtime.Serialization.Json \ + System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml System.Runtime System.Security.Principal System.ServiceModel.Http \ + System.ServiceModel.Primitives System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \ + System.Threading.Tasks System.Threading System.Xml.ReaderWriter System.Xml.XDocument System.Xml.XmlSerializer + +mobile_static_SUBDIRS = $(monotouch_SUBDIRS) + +net_4_5_SUBDIRS = $(monotouch_SUBDIRS) System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit + +monodroid_SUBDIRS = $(net_4_5_SUBDIRS) SUBDIRS = $(net_4_5_SUBDIRS) -include ../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make dist-local: dist-default + + diff --git a/mcs/class/Facades/System.Collections.Concurrent/AssemblyInfo.cs b/mcs/class/Facades/System.Collections.Concurrent/AssemblyInfo.cs index 685be8042b..b14058779a 100644 --- a/mcs/class/Facades/System.Collections.Concurrent/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Collections.Concurrent/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Collections.Concurrent.dll")] [assembly: AssemblyDescription ("System.Collections.Concurrent.dll")] [assembly: AssemblyDefaultAlias ("System.Collections.Concurrent.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Collections.Concurrent/Makefile b/mcs/class/Facades/System.Collections.Concurrent/Makefile index bb8e26bca9..d0e3fdf608 100644 --- a/mcs/class/Facades/System.Collections.Concurrent/Makefile +++ b/mcs/class/Facades/System.Collections.Concurrent/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Collections.Concurrent SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Collections.Concurrent.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent.dll.sources b/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent.dll.sources +++ b/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Collections.Concurrent/TypeForwarders.cs b/mcs/class/Facades/System.Collections.Concurrent/TypeForwarders.cs index 4103861ffa..662e404295 100644 --- a/mcs/class/Facades/System.Collections.Concurrent/TypeForwarders.cs +++ b/mcs/class/Facades/System.Collections.Concurrent/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,15 +18,16 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.BlockingCollection<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.ConcurrentBag<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.ConcurrentDictionary<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.IProducerConsumerCollection<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.ConcurrentQueue<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.ConcurrentStack<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.Partitioner<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.EnumerablePartitionerOptions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.IProducerConsumerCollection<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.OrderablePartitioner<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.Partitioner))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.EnumerablePartitionerOptions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Concurrent.Partitioner<>))] diff --git a/mcs/class/Facades/System.Collections/AssemblyInfo.cs b/mcs/class/Facades/System.Collections/AssemblyInfo.cs index a96857e7f7..e3f037ff8e 100644 --- a/mcs/class/Facades/System.Collections/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Collections/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Collections.dll")] [assembly: AssemblyDescription ("System.Collections.dll")] [assembly: AssemblyDefaultAlias ("System.Collections.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Collections/Makefile b/mcs/class/Facades/System.Collections/Makefile index 58797f283e..7169319ecf 100644 --- a/mcs/class/Facades/System.Collections/Makefile +++ b/mcs/class/Facades/System.Collections/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Collections SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Collections.dll -LIB_MCS_FLAGS = /r:System /r:System.Core + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Collections/System.Collections.dll.sources b/mcs/class/Facades/System.Collections/System.Collections.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Collections/System.Collections.dll.sources +++ b/mcs/class/Facades/System.Collections/System.Collections.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Collections/TypeForwarders.cs b/mcs/class/Facades/System.Collections/TypeForwarders.cs index 716fe5c71d..9a2b8f18f6 100644 --- a/mcs/class/Facades/System.Collections/TypeForwarders.cs +++ b/mcs/class/Facades/System.Collections/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,18 +18,19 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.LinkedList<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.LinkedListNode<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.Queue<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.Stack<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.BitArray))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.Comparer<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.Dictionary<,>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.EqualityComparer<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.List<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.HashSet<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.LinkedList<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.LinkedListNode<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.List<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.Queue<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.SortedDictionary<,>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.SortedSet<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.Stack<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.StructuralComparisons))] diff --git a/mcs/class/Facades/System.ComponentModel.Annotations/AssemblyInfo.cs b/mcs/class/Facades/System.ComponentModel.Annotations/AssemblyInfo.cs index 8aa8cbcdc1..3ea660a30b 100644 --- a/mcs/class/Facades/System.ComponentModel.Annotations/AssemblyInfo.cs +++ b/mcs/class/Facades/System.ComponentModel.Annotations/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.ComponentModel.Annotations.dll")] [assembly: AssemblyDescription ("System.ComponentModel.Annotations.dll")] [assembly: AssemblyDefaultAlias ("System.ComponentModel.Annotations.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.ComponentModel.Annotations/Makefile b/mcs/class/Facades/System.ComponentModel.Annotations/Makefile index 2d9f7b1b40..c3bc1f9dc5 100644 --- a/mcs/class/Facades/System.ComponentModel.Annotations/Makefile +++ b/mcs/class/Facades/System.ComponentModel.Annotations/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.ComponentModel.Annotations SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.ComponentModel.Annotations.dll -LIB_MCS_FLAGS = /r:System.ComponentModel.DataAnnotations + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.ComponentModel.DataAnnotations PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll.sources b/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll.sources +++ b/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.ComponentModel.Annotations/TypeForwarders.cs b/mcs/class/Facades/System.ComponentModel.Annotations/TypeForwarders.cs index 0bc80b3456..e7c1feff49 100644 --- a/mcs/class/Facades/System.ComponentModel.Annotations/TypeForwarders.cs +++ b/mcs/class/Facades/System.ComponentModel.Annotations/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,10 +18,10 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.AssociationAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.ValidationAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.CustomValidationAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.DataType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.DataTypeAttribute))] @@ -40,13 +35,14 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.RangeAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.RegularExpressionAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.RequiredAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.StringLengthAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.TimestampAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.UIHintAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.ValidationAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.ValidationContext))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.ValidationException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.ValidationResult))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.Validator))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption))] diff --git a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/AssemblyInfo.cs b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/AssemblyInfo.cs index 85cfdb9cc1..02d9d9307f 100644 --- a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/AssemblyInfo.cs +++ b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.ComponentModel.EventBasedAsync.dll")] [assembly: AssemblyDescription ("System.ComponentModel.EventBasedAsync.dll")] [assembly: AssemblyDefaultAlias ("System.ComponentModel.EventBasedAsync.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile index 479bd2000a..acd577cbc3 100644 --- a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile +++ b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.ComponentModel.EventBasedAsync SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.ComponentModel.EventBasedAsync.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync.dll.sources b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync.dll.sources +++ b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/TypeForwarders.cs b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/TypeForwarders.cs index df5c85a6da..eeef8ec2c5 100644 --- a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/TypeForwarders.cs +++ b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.AsyncCompletedEventArgs))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.AsyncCompletedEventHandler))] diff --git a/mcs/class/Facades/System.ComponentModel/AssemblyInfo.cs b/mcs/class/Facades/System.ComponentModel/AssemblyInfo.cs index 828b771a27..944626f1d5 100644 --- a/mcs/class/Facades/System.ComponentModel/AssemblyInfo.cs +++ b/mcs/class/Facades/System.ComponentModel/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.ComponentModel.dll")] [assembly: AssemblyDescription ("System.ComponentModel.dll")] [assembly: AssemblyDefaultAlias ("System.ComponentModel.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.ComponentModel/Makefile b/mcs/class/Facades/System.ComponentModel/Makefile index 680660269d..715e92db80 100644 --- a/mcs/class/Facades/System.ComponentModel/Makefile +++ b/mcs/class/Facades/System.ComponentModel/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.ComponentModel SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.ComponentModel.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.ComponentModel/System.ComponentModel.dll.sources b/mcs/class/Facades/System.ComponentModel/System.ComponentModel.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.ComponentModel/System.ComponentModel.dll.sources +++ b/mcs/class/Facades/System.ComponentModel/System.ComponentModel.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.ComponentModel/TypeForwarders.cs b/mcs/class/Facades/System.ComponentModel/TypeForwarders.cs index 238ceac40d..24e97c6fe7 100644 --- a/mcs/class/Facades/System.ComponentModel/TypeForwarders.cs +++ b/mcs/class/Facades/System.ComponentModel/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.CancelEventArgs))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.IChangeTracking))] diff --git a/mcs/class/Facades/System.Diagnostics.Contracts/AssemblyInfo.cs b/mcs/class/Facades/System.Diagnostics.Contracts/AssemblyInfo.cs index 2fc9947025..55e9ec069d 100644 --- a/mcs/class/Facades/System.Diagnostics.Contracts/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Diagnostics.Contracts/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Diagnostics.Contracts.dll")] [assembly: AssemblyDescription ("System.Diagnostics.Contracts.dll")] [assembly: AssemblyDefaultAlias ("System.Diagnostics.Contracts.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Diagnostics.Contracts/Makefile b/mcs/class/Facades/System.Diagnostics.Contracts/Makefile index a6ffb84934..24336c082b 100644 --- a/mcs/class/Facades/System.Diagnostics.Contracts/Makefile +++ b/mcs/class/Facades/System.Diagnostics.Contracts/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Diagnostics.Contracts SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Diagnostics.Contracts.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts.dll.sources b/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts.dll.sources +++ b/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Diagnostics.Contracts/TypeForwarders.cs b/mcs/class/Facades/System.Diagnostics.Contracts/TypeForwarders.cs index ac2cc3dc37..961cfe8bfe 100644 --- a/mcs/class/Facades/System.Diagnostics.Contracts/TypeForwarders.cs +++ b/mcs/class/Facades/System.Diagnostics.Contracts/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,20 +18,21 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.Contract))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractAbbreviatorAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractArgumentValidatorAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractClassAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractClassForAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractFailedEventArgs))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractFailureKind))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractInvariantMethodAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractOptionAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractPublicPropertyNameAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractReferenceAssemblyAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractRuntimeIgnoredAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractVerificationAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.PureAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractFailedEventArgs))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractAbbreviatorAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractArgumentValidatorAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Contracts.ContractOptionAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ContractHelper))] diff --git a/mcs/class/Facades/System.Diagnostics.Debug/AssemblyInfo.cs b/mcs/class/Facades/System.Diagnostics.Debug/AssemblyInfo.cs index f1e987d020..a7cbf21727 100644 --- a/mcs/class/Facades/System.Diagnostics.Debug/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Diagnostics.Debug/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Diagnostics.Debug.dll")] [assembly: AssemblyDescription ("System.Diagnostics.Debug.dll")] [assembly: AssemblyDefaultAlias ("System.Diagnostics.Debug.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Diagnostics.Debug/Makefile b/mcs/class/Facades/System.Diagnostics.Debug/Makefile index 440c475fac..024f0d6557 100644 --- a/mcs/class/Facades/System.Diagnostics.Debug/Makefile +++ b/mcs/class/Facades/System.Diagnostics.Debug/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Diagnostics.Debug SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Diagnostics.Debug.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug.dll.sources b/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug.dll.sources +++ b/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Diagnostics.Debug/TypeForwarders.cs b/mcs/class/Facades/System.Diagnostics.Debug/TypeForwarders.cs index e829ac7eeb..e9604390df 100644 --- a/mcs/class/Facades/System.Diagnostics.Debug/TypeForwarders.cs +++ b/mcs/class/Facades/System.Diagnostics.Debug/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Debug))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Debugger))] diff --git a/mcs/class/Facades/System.Diagnostics.Tools/AssemblyInfo.cs b/mcs/class/Facades/System.Diagnostics.Tools/AssemblyInfo.cs index b6db9a1e64..62b783c937 100644 --- a/mcs/class/Facades/System.Diagnostics.Tools/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Diagnostics.Tools/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Diagnostics.Tools.dll")] [assembly: AssemblyDescription ("System.Diagnostics.Tools.dll")] [assembly: AssemblyDefaultAlias ("System.Diagnostics.Tools.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Diagnostics.Tools/Makefile b/mcs/class/Facades/System.Diagnostics.Tools/Makefile index 24a69af872..2a448a7711 100644 --- a/mcs/class/Facades/System.Diagnostics.Tools/Makefile +++ b/mcs/class/Facades/System.Diagnostics.Tools/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Diagnostics.Tools SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Diagnostics.Tools.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools.dll.sources b/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools.dll.sources +++ b/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Diagnostics.Tools/TypeForwarders.cs b/mcs/class/Facades/System.Diagnostics.Tools/TypeForwarders.cs index a07fed0c3f..56ebfd6570 100644 --- a/mcs/class/Facades/System.Diagnostics.Tools/TypeForwarders.cs +++ b/mcs/class/Facades/System.Diagnostics.Tools/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.CodeDom.Compiler.GeneratedCodeAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.CodeAnalysis.SuppressMessageAttribute))] diff --git a/mcs/class/Facades/System.Dynamic.Runtime/AssemblyInfo.cs b/mcs/class/Facades/System.Dynamic.Runtime/AssemblyInfo.cs index 085333228a..e64d545b78 100644 --- a/mcs/class/Facades/System.Dynamic.Runtime/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Dynamic.Runtime/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Dynamic.Runtime.dll")] [assembly: AssemblyDescription ("System.Dynamic.Runtime.dll")] [assembly: AssemblyDefaultAlias ("System.Dynamic.Runtime.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Dynamic.Runtime/Makefile b/mcs/class/Facades/System.Dynamic.Runtime/Makefile index ed5c735fb4..393bc9dcd5 100644 --- a/mcs/class/Facades/System.Dynamic.Runtime/Makefile +++ b/mcs/class/Facades/System.Dynamic.Runtime/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Dynamic.Runtime SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Dynamic.Runtime.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Core /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime.dll.sources b/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime.dll.sources +++ b/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Dynamic.Runtime/TypeForwarders.cs b/mcs/class/Facades/System.Dynamic.Runtime/TypeForwarders.cs index 2a7a27c41b..52c9043511 100644 --- a/mcs/class/Facades/System.Dynamic.Runtime/TypeForwarders.cs +++ b/mcs/class/Facades/System.Dynamic.Runtime/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,32 @@ // 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. +// +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.BinaryOperationBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.BindingRestrictions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.CallInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.ConvertBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.CreateInstanceBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.DeleteIndexBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.DeleteMemberBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.DynamicMetaObject))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.DynamicMetaObjectBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.DynamicObject))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.ExpandoObject))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.GetIndexBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.GetMemberBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.IDynamicMetaObjectProvider))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.IInvokeOnGetBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.InvokeBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.InvokeMemberBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.SetIndexBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.SetMemberBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Dynamic.UnaryOperationBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DynamicExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallSite))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallSite<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallSiteBinder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallSiteHelpers))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.DynamicAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConditionalWeakTable<,>))] - diff --git a/mcs/class/Facades/System.Globalization/AssemblyInfo.cs b/mcs/class/Facades/System.Globalization/AssemblyInfo.cs index e924712186..9db0473f4f 100644 --- a/mcs/class/Facades/System.Globalization/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Globalization/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Globalization.dll")] [assembly: AssemblyDescription ("System.Globalization.dll")] [assembly: AssemblyDefaultAlias ("System.Globalization.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Globalization/Makefile b/mcs/class/Facades/System.Globalization/Makefile index 6a9fb37997..bb46d247e3 100644 --- a/mcs/class/Facades/System.Globalization/Makefile +++ b/mcs/class/Facades/System.Globalization/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Globalization SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Globalization.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Globalization/System.Globalization.dll.sources b/mcs/class/Facades/System.Globalization/System.Globalization.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Globalization/System.Globalization.dll.sources +++ b/mcs/class/Facades/System.Globalization/System.Globalization.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Globalization/TypeForwarders.cs b/mcs/class/Facades/System.Globalization/TypeForwarders.cs index 9f279911f9..fd2bc99d8c 100644 --- a/mcs/class/Facades/System.Globalization/TypeForwarders.cs +++ b/mcs/class/Facades/System.Globalization/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.Calendar))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.CalendarWeekRule))] @@ -30,6 +26,7 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.CompareInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.CompareOptions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.CultureInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.CultureNotFoundException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.DateTimeFormatInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.NumberFormatInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.RegionInfo))] @@ -37,5 +34,4 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.TextElementEnumerator))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.TextInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.UnicodeCategory))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.CultureNotFoundException))] diff --git a/mcs/class/Facades/System.IO/AssemblyInfo.cs b/mcs/class/Facades/System.IO/AssemblyInfo.cs index f87e3ce5de..6b5b23d878 100644 --- a/mcs/class/Facades/System.IO/AssemblyInfo.cs +++ b/mcs/class/Facades/System.IO/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.IO.dll")] [assembly: AssemblyDescription ("System.IO.dll")] [assembly: AssemblyDefaultAlias ("System.IO.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.IO/Makefile b/mcs/class/Facades/System.IO/Makefile index a59d44828f..221291d4c5 100644 --- a/mcs/class/Facades/System.IO/Makefile +++ b/mcs/class/Facades/System.IO/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.IO SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.IO.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.IO/System.IO.dll.sources b/mcs/class/Facades/System.IO/System.IO.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.IO/System.IO.dll.sources +++ b/mcs/class/Facades/System.IO/System.IO.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.IO/TypeForwarders.cs b/mcs/class/Facades/System.IO/TypeForwarders.cs index 1a3d86656f..ea526e77de 100644 --- a/mcs/class/Facades/System.IO/TypeForwarders.cs +++ b/mcs/class/Facades/System.IO/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,20 +18,21 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.BinaryReader))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.BinaryWriter))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.IOException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.EndOfStreamException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.FileNotFoundException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Stream))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.InvalidDataException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.IOException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.MemoryStream))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.SeekOrigin))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.TextReader))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Stream))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.StreamReader))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.TextWriter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.StreamWriter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.StringReader))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.StringWriter))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.InvalidDataException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.TextReader))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.TextWriter))] diff --git a/mcs/class/Facades/System.Linq.Expressions/AssemblyInfo.cs b/mcs/class/Facades/System.Linq.Expressions/AssemblyInfo.cs index 6f25c83331..de01cb447b 100644 --- a/mcs/class/Facades/System.Linq.Expressions/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Linq.Expressions/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Linq.Expressions.dll")] [assembly: AssemblyDescription ("System.Linq.Expressions.dll")] [assembly: AssemblyDefaultAlias ("System.Linq.Expressions.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Linq.Expressions/Makefile b/mcs/class/Facades/System.Linq.Expressions/Makefile index 1883c9107a..60b5140e37 100644 --- a/mcs/class/Facades/System.Linq.Expressions/Makefile +++ b/mcs/class/Facades/System.Linq.Expressions/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Linq.Expressions SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Linq.Expressions.dll -LIB_MCS_FLAGS = /r:System.Core /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions.dll.sources b/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions.dll.sources +++ b/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs b/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs index 1f5818bde9..db18f12782 100644 --- a/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs +++ b/mcs/class/Facades/System.Linq.Expressions/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,25 +18,36 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IOrderedQueryable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IOrderedQueryable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryProvider))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BlockExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.CatchBlock))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DebugInfoExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DefaultExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpressionKind))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IndexExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelTarget))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LoopExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.RuntimeVariablesExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchCase))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SymbolDocumentInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TryExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BinaryExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ConditionalExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ConstantExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ElementInit))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LambdaExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ExpressionType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ExpressionVisitor))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.InvocationExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LambdaExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ListInitExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBinding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberAssignment))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBinding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBindingType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberInitExpression))] @@ -53,21 +59,9 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ParameterExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TypeBinaryExpression))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.UnaryExpression))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IOrderedQueryable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IOrderedQueryable<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryProvider))] -#if !FULL_AOT_RUNTIME -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BlockExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.CatchBlock))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DebugInfoExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DefaultExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpressionKind))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IndexExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelTarget))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LoopExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.RuntimeVariablesExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchCase))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchExpression))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SymbolDocumentInfo))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TryExpression))] -#endif diff --git a/mcs/class/Facades/System.Linq.Parallel/AssemblyInfo.cs b/mcs/class/Facades/System.Linq.Parallel/AssemblyInfo.cs index 5824fc0e7c..b3d86f59f9 100644 --- a/mcs/class/Facades/System.Linq.Parallel/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Linq.Parallel/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Linq.Parallel.dll")] [assembly: AssemblyDescription ("System.Linq.Parallel.dll")] [assembly: AssemblyDefaultAlias ("System.Linq.Parallel.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Linq.Parallel/Makefile b/mcs/class/Facades/System.Linq.Parallel/Makefile index bf9069a77b..54a937f7ed 100644 --- a/mcs/class/Facades/System.Linq.Parallel/Makefile +++ b/mcs/class/Facades/System.Linq.Parallel/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Linq.Parallel SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Linq.Parallel.dll -LIB_MCS_FLAGS = /r:System.Core /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel.dll.sources b/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel.dll.sources +++ b/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Linq.Parallel/TypeForwarders.cs b/mcs/class/Facades/System.Linq.Parallel/TypeForwarders.cs index 8fab8b6f07..00445f24a3 100644 --- a/mcs/class/Facades/System.Linq.Parallel/TypeForwarders.cs +++ b/mcs/class/Facades/System.Linq.Parallel/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,11 +18,12 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelQuery))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelQuery<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.OrderedParallelQuery<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelEnumerable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelExecutionMode))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelMergeOptions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelQuery))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.ParallelQuery<>))] diff --git a/mcs/class/Facades/System.Linq.Queryable/AssemblyInfo.cs b/mcs/class/Facades/System.Linq.Queryable/AssemblyInfo.cs index 5c425d1487..ec77afbfeb 100644 --- a/mcs/class/Facades/System.Linq.Queryable/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Linq.Queryable/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Linq.Queryable.dll")] [assembly: AssemblyDescription ("System.Linq.Queryable.dll")] [assembly: AssemblyDefaultAlias ("System.Linq.Queryable.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Linq.Queryable/Makefile b/mcs/class/Facades/System.Linq.Queryable/Makefile index 3bed035956..270601149d 100644 --- a/mcs/class/Facades/System.Linq.Queryable/Makefile +++ b/mcs/class/Facades/System.Linq.Queryable/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Linq.Queryable SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Linq.Queryable.dll -LIB_MCS_FLAGS = /r:System.Core /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable.dll.sources b/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable.dll.sources +++ b/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Linq.Queryable/TypeForwarders.cs b/mcs/class/Facades/System.Linq.Queryable/TypeForwarders.cs index 0d20080e20..a8f9ee444e 100644 --- a/mcs/class/Facades/System.Linq.Queryable/TypeForwarders.cs +++ b/mcs/class/Facades/System.Linq.Queryable/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.EnumerableExecutor))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.EnumerableExecutor<>))] diff --git a/mcs/class/Facades/System.Linq/AssemblyInfo.cs b/mcs/class/Facades/System.Linq/AssemblyInfo.cs index 0c3c697408..e654d85a44 100644 --- a/mcs/class/Facades/System.Linq/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Linq/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Linq.dll")] [assembly: AssemblyDescription ("System.Linq.dll")] [assembly: AssemblyDefaultAlias ("System.Linq.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Linq/Makefile b/mcs/class/Facades/System.Linq/Makefile index cca44b1499..b08a8a3798 100644 --- a/mcs/class/Facades/System.Linq/Makefile +++ b/mcs/class/Facades/System.Linq/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Linq SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Linq.dll -LIB_MCS_FLAGS = /r:System.Core /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Linq/System.Linq.dll.sources b/mcs/class/Facades/System.Linq/System.Linq.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Linq/System.Linq.dll.sources +++ b/mcs/class/Facades/System.Linq/System.Linq.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Linq/TypeForwarders.cs b/mcs/class/Facades/System.Linq/TypeForwarders.cs index b5cd612a2b..5ae7fa03f4 100644 --- a/mcs/class/Facades/System.Linq/TypeForwarders.cs +++ b/mcs/class/Facades/System.Linq/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Enumerable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IGrouping<,>))] diff --git a/mcs/class/Facades/System.Net.NetworkInformation/AssemblyInfo.cs b/mcs/class/Facades/System.Net.NetworkInformation/AssemblyInfo.cs index 62f55c5684..4f5c9c1b6d 100644 --- a/mcs/class/Facades/System.Net.NetworkInformation/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Net.NetworkInformation/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Net.NetworkInformation.dll")] [assembly: AssemblyDescription ("System.Net.NetworkInformation.dll")] [assembly: AssemblyDefaultAlias ("System.Net.NetworkInformation.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Net.NetworkInformation/Makefile b/mcs/class/Facades/System.Net.NetworkInformation/Makefile index 6c24f13694..2168babf39 100644 --- a/mcs/class/Facades/System.Net.NetworkInformation/Makefile +++ b/mcs/class/Facades/System.Net.NetworkInformation/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Net.NetworkInformation SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Net.NetworkInformation.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation.dll.sources b/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation.dll.sources +++ b/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Net.NetworkInformation/TypeForwarders.cs b/mcs/class/Facades/System.Net.NetworkInformation/TypeForwarders.cs index 0cb15ff155..c16fa7fdaa 100644 --- a/mcs/class/Facades/System.Net.NetworkInformation/TypeForwarders.cs +++ b/mcs/class/Facades/System.Net.NetworkInformation/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkAddressChangedEventHandler))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkChange))] diff --git a/mcs/class/Facades/System.Net.Primitives/AssemblyInfo.cs b/mcs/class/Facades/System.Net.Primitives/AssemblyInfo.cs index 7baa4d6611..43418d0fb7 100644 --- a/mcs/class/Facades/System.Net.Primitives/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Net.Primitives/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Net.Primitives.dll")] [assembly: AssemblyDescription ("System.Net.Primitives.dll")] [assembly: AssemblyDefaultAlias ("System.Net.Primitives.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Net.Primitives/Makefile b/mcs/class/Facades/System.Net.Primitives/Makefile index 6307ee11c0..db960f4931 100644 --- a/mcs/class/Facades/System.Net.Primitives/Makefile +++ b/mcs/class/Facades/System.Net.Primitives/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Net.Primitives SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Net.Primitives.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives.dll.sources b/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives.dll.sources +++ b/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Net.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Net.Primitives/TypeForwarders.cs index 9227c4614f..1d78a8dbaa 100644 --- a/mcs/class/Facades/System.Net.Primitives/TypeForwarders.cs +++ b/mcs/class/Facades/System.Net.Primitives/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,18 +18,19 @@ // 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. +// +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.AuthenticationSchemes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Cookie))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieContainer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CredentialCache))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.DecompressionMethods))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.HttpStatusCode))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.ICredentials))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkCredential))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.AuthenticationSchemes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.ICredentialsByHost))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CredentialCache))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.DecompressionMethods))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.IWebProxy))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkCredential))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.TransportContext))] diff --git a/mcs/class/Facades/System.Net.Requests/AssemblyInfo.cs b/mcs/class/Facades/System.Net.Requests/AssemblyInfo.cs index d75c389c82..771473695c 100644 --- a/mcs/class/Facades/System.Net.Requests/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Net.Requests/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Net.Requests.dll")] [assembly: AssemblyDescription ("System.Net.Requests.dll")] [assembly: AssemblyDefaultAlias ("System.Net.Requests.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Net.Requests/Makefile b/mcs/class/Facades/System.Net.Requests/Makefile index f3c942ef6f..35d7d842f6 100644 --- a/mcs/class/Facades/System.Net.Requests/Makefile +++ b/mcs/class/Facades/System.Net.Requests/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Net.Requests SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Net.Requests.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Net.Requests/System.Net.Requests.dll.sources b/mcs/class/Facades/System.Net.Requests/System.Net.Requests.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Net.Requests/System.Net.Requests.dll.sources +++ b/mcs/class/Facades/System.Net.Requests/System.Net.Requests.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Net.Requests/TypeForwarders.cs b/mcs/class/Facades/System.Net.Requests/TypeForwarders.cs index 9730eaec3d..2d4e79f6f0 100644 --- a/mcs/class/Facades/System.Net.Requests/TypeForwarders.cs +++ b/mcs/class/Facades/System.Net.Requests/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,15 +18,16 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.HttpRequestHeader))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebRequest))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.HttpWebRequest))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebResponse))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.HttpWebResponse))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.IWebRequestCreate))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.ProtocolViolationException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebExceptionStatus))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebHeaderCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebRequest))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebResponse))] diff --git a/mcs/class/Facades/System.ObjectModel/AssemblyInfo.cs b/mcs/class/Facades/System.ObjectModel/AssemblyInfo.cs index a7f198c67b..1eac48ac27 100644 --- a/mcs/class/Facades/System.ObjectModel/AssemblyInfo.cs +++ b/mcs/class/Facades/System.ObjectModel/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.ObjectModel.dll")] [assembly: AssemblyDescription ("System.ObjectModel.dll")] [assembly: AssemblyDefaultAlias ("System.ObjectModel.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.ObjectModel/Makefile b/mcs/class/Facades/System.ObjectModel/Makefile index 0a6e2a5118..6f9294289b 100644 --- a/mcs/class/Facades/System.ObjectModel/Makefile +++ b/mcs/class/Facades/System.ObjectModel/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.ObjectModel SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.ObjectModel.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.ObjectModel/System.ObjectModel.dll.sources b/mcs/class/Facades/System.ObjectModel/System.ObjectModel.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.ObjectModel/System.ObjectModel.dll.sources +++ b/mcs/class/Facades/System.ObjectModel/System.ObjectModel.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.ObjectModel/TypeForwarders.cs b/mcs/class/Facades/System.ObjectModel/TypeForwarders.cs index 8737de0adc..456c9db6eb 100644 --- a/mcs/class/Facades/System.ObjectModel/TypeForwarders.cs +++ b/mcs/class/Facades/System.ObjectModel/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,18 +18,20 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.INotifyPropertyChanged))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.PropertyChangedEventArgs))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.PropertyChangedEventHandler))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.ReadOnlyDictionary<,>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.KeyedCollection<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Specialized.INotifyCollectionChanged))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.ObservableCollection<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.ReadOnlyObservableCollection<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Specialized.INotifyCollectionChanged))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Specialized.NotifyCollectionChangedAction))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Specialized.NotifyCollectionChangedEventArgs))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Specialized.NotifyCollectionChangedEventHandler))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Windows.Input.ICommand))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.INotifyDataErrorInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DataErrorsChangedEventArgs))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.INotifyDataErrorInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.INotifyPropertyChanged))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.PropertyChangedEventArgs))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.PropertyChangedEventHandler))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Windows.Input.ICommand))] diff --git a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/AssemblyInfo.cs new file mode 100644 index 0000000000..43035ee9d2 --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/AssemblyInfo.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle ("System.Reflection.Emit.ILGeneration.dll")] +[assembly: AssemblyDescription ("System.Reflection.Emit.ILGeneration.dll")] +[assembly: AssemblyDefaultAlias ("System.Reflection.Emit.ILGeneration.dll")] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] +[assembly: AssemblyVersion ("4.0.0.0")] +[assembly: AssemblyInformationalVersion ("4.0.0.0")] +[assembly: AssemblyFileVersion ("4.0.0.0")] +[assembly: AssemblyDelaySign (true)] +[assembly: AssemblyKeyFile ("../../msfinal.pub")] + +[assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile new file mode 100644 index 0000000000..d1c857b3b6 --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile @@ -0,0 +1,22 @@ +MCS_BUILD_DIR = ../../../build + +thisdir = class/Facades/System.Reflection.Emit.ILGeneration +SUBDIRS = +include $(MCS_BUILD_DIR)/rules.make + +LIBRARY_SUBDIR = Facades +LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades + +LIBRARY = System.Reflection.Emit.ILGeneration.dll + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib + +PLATFORM_DEBUG_FLAGS = + +NO_TEST = yes + +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/System.Reflection.Emit.ILGeneration.dll.sources b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/System.Reflection.Emit.ILGeneration.dll.sources new file mode 100644 index 0000000000..8e33d4ddea --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/System.Reflection.Emit.ILGeneration.dll.sources @@ -0,0 +1,3 @@ +TypeForwarders.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/TypeForwarders.cs new file mode 100644 index 0000000000..3547d6dc6b --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/TypeForwarders.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.CustomAttributeBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.ILGenerator))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.Label))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.LocalBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.ParameterBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.SignatureHelper))] + diff --git a/mcs/class/Facades/System.Reflection.Emit.Lightweight/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection.Emit.Lightweight/AssemblyInfo.cs new file mode 100644 index 0000000000..521dee748d --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.Lightweight/AssemblyInfo.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle ("System.Reflection.Emit.Lightweight.dll")] +[assembly: AssemblyDescription ("System.Reflection.Emit.Lightweight.dll")] +[assembly: AssemblyDefaultAlias ("System.Reflection.Emit.Lightweight.dll")] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] +[assembly: AssemblyVersion ("4.0.0.0")] +[assembly: AssemblyInformationalVersion ("4.0.0.0")] +[assembly: AssemblyFileVersion ("4.0.0.0")] +[assembly: AssemblyDelaySign (true)] +[assembly: AssemblyKeyFile ("../../msfinal.pub")] + +[assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile b/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile new file mode 100644 index 0000000000..751a8ec956 --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile @@ -0,0 +1,22 @@ +MCS_BUILD_DIR = ../../../build + +thisdir = class/Facades/System.Reflection.Emit.Lightweight +SUBDIRS = +include $(MCS_BUILD_DIR)/rules.make + +LIBRARY_SUBDIR = Facades +LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades + +LIBRARY = System.Reflection.Emit.Lightweight.dll + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib + +PLATFORM_DEBUG_FLAGS = + +NO_TEST = yes + +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight.dll.sources b/mcs/class/Facades/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight.dll.sources new file mode 100644 index 0000000000..8e33d4ddea --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight.dll.sources @@ -0,0 +1,3 @@ +TypeForwarders.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Reflection.Emit.Lightweight/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.Emit.Lightweight/TypeForwarders.cs new file mode 100644 index 0000000000..7cd359e90a --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit.Lightweight/TypeForwarders.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.DynamicMethod))] + diff --git a/mcs/class/Facades/System.Reflection.Emit/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection.Emit/AssemblyInfo.cs new file mode 100644 index 0000000000..656df0b122 --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit/AssemblyInfo.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle ("System.Reflection.Emit.dll")] +[assembly: AssemblyDescription ("System.Reflection.Emit.dll")] +[assembly: AssemblyDefaultAlias ("System.Reflection.Emit.dll")] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] +[assembly: AssemblyVersion ("4.0.0.0")] +[assembly: AssemblyInformationalVersion ("4.0.0.0")] +[assembly: AssemblyFileVersion ("4.0.0.0")] +[assembly: AssemblyDelaySign (true)] +[assembly: AssemblyKeyFile ("../../msfinal.pub")] + +[assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Reflection.Emit/Makefile b/mcs/class/Facades/System.Reflection.Emit/Makefile new file mode 100644 index 0000000000..43659a90ca --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit/Makefile @@ -0,0 +1,22 @@ +MCS_BUILD_DIR = ../../../build + +thisdir = class/Facades/System.Reflection.Emit +SUBDIRS = +include $(MCS_BUILD_DIR)/rules.make + +LIBRARY_SUBDIR = Facades +LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades + +LIBRARY = System.Reflection.Emit.dll + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib + +PLATFORM_DEBUG_FLAGS = + +NO_TEST = yes + +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Reflection.Emit/System.Reflection.Emit.dll.sources b/mcs/class/Facades/System.Reflection.Emit/System.Reflection.Emit.dll.sources new file mode 100644 index 0000000000..8e33d4ddea --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit/System.Reflection.Emit.dll.sources @@ -0,0 +1,3 @@ +TypeForwarders.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Reflection.Emit/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.Emit/TypeForwarders.cs new file mode 100644 index 0000000000..c00424dbfa --- /dev/null +++ b/mcs/class/Facades/System.Reflection.Emit/TypeForwarders.cs @@ -0,0 +1,34 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.AssemblyBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.AssemblyBuilderAccess))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.ConstructorBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.EnumBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.EventBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.FieldBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.GenericTypeParameterBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.MethodBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.ModuleBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.PropertyBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.TypeBuilder))] + diff --git a/mcs/class/Facades/System.Reflection.Extensions/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection.Extensions/AssemblyInfo.cs index 9124e1b2b5..7b9237816e 100644 --- a/mcs/class/Facades/System.Reflection.Extensions/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Reflection.Extensions/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Reflection.Extensions.dll")] [assembly: AssemblyDescription ("System.Reflection.Extensions.dll")] [assembly: AssemblyDefaultAlias ("System.Reflection.Extensions.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Reflection.Extensions/Makefile b/mcs/class/Facades/System.Reflection.Extensions/Makefile index aaf20facb0..ff09a4df75 100644 --- a/mcs/class/Facades/System.Reflection.Extensions/Makefile +++ b/mcs/class/Facades/System.Reflection.Extensions/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Reflection.Extensions SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Reflection.Extensions.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions.dll.sources b/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions.dll.sources +++ b/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Reflection.Extensions/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.Extensions/TypeForwarders.cs index 3ed6cd94c0..0bb74c4e2c 100644 --- a/mcs/class/Facades/System.Reflection.Extensions/TypeForwarders.cs +++ b/mcs/class/Facades/System.Reflection.Extensions/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeExtensions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.InterfaceMapping))] diff --git a/mcs/class/Facades/System.Reflection.Primitives/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection.Primitives/AssemblyInfo.cs index 0141d30c0e..260b4584c6 100644 --- a/mcs/class/Facades/System.Reflection.Primitives/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Reflection.Primitives/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Reflection.Primitives.dll")] [assembly: AssemblyDescription ("System.Reflection.Primitives.dll")] [assembly: AssemblyDefaultAlias ("System.Reflection.Primitives.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Reflection.Primitives/Makefile b/mcs/class/Facades/System.Reflection.Primitives/Makefile index 602815ba56..6d1d422f0f 100644 --- a/mcs/class/Facades/System.Reflection.Primitives/Makefile +++ b/mcs/class/Facades/System.Reflection.Primitives/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Reflection.Primitives SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Reflection.Primitives.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives.dll.sources b/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives.dll.sources +++ b/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs index 8dfe9b4b95..cfa70ce24a 100644 --- a/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs +++ b/mcs/class/Facades/System.Reflection.Primitives/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,14 +18,24 @@ // 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 !FULL_AOT_RUNTIME +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.FlowControl))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OpCode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OpCodes))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OpCodeType))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.OperandType))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.PackingSize))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.StackBehaviour))] +#endif [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CallingConventions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.EventAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.FieldAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.GenericParameterAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodAttributes))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodImplAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ParameterAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.PropertyAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TypeAttributes))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodImplAttributes))] diff --git a/mcs/class/Facades/System.Reflection/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection/AssemblyInfo.cs index 6c614cdb54..36520e0b75 100644 --- a/mcs/class/Facades/System.Reflection/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Reflection/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Reflection.dll")] [assembly: AssemblyDescription ("System.Reflection.dll")] [assembly: AssemblyDefaultAlias ("System.Reflection.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Reflection/Makefile b/mcs/class/Facades/System.Reflection/Makefile index 85c5ac89f1..12e2a5f649 100644 --- a/mcs/class/Facades/System.Reflection/Makefile +++ b/mcs/class/Facades/System.Reflection/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Reflection SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Reflection.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Reflection/System.Reflection.dll.sources b/mcs/class/Facades/System.Reflection/System.Reflection.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Reflection/System.Reflection.dll.sources +++ b/mcs/class/Facades/System.Reflection/System.Reflection.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Reflection/TypeForwarders.cs b/mcs/class/Facades/System.Reflection/TypeForwarders.cs index 5e5d09de03..511c1fe2ed 100644 --- a/mcs/class/Facades/System.Reflection/TypeForwarders.cs +++ b/mcs/class/Facades/System.Reflection/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,31 +18,32 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MemberInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AmbiguousMatchException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Assembly))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyContentType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyName))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodBase))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ConstructorInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeData))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeNamedArgument))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeTypedArgument))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.EventInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.FieldInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.IntrospectionExtensions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.IReflectableType))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.LocalVariableInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ManifestResourceInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MemberInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodBase))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.MethodInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Module))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ParameterInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.PropertyInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ReflectionContext))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ReflectionTypeLoadException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ResourceLocation))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TargetInvocationException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TargetParameterCountException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ManifestResourceInfo))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ResourceLocation))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyContentType))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeData))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeNamedArgument))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.CustomAttributeTypedArgument))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.IntrospectionExtensions))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.IReflectableType))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.LocalVariableInfo))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.ReflectionContext))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.TypeInfo))] diff --git a/mcs/class/Facades/System.Resources.ResourceManager/AssemblyInfo.cs b/mcs/class/Facades/System.Resources.ResourceManager/AssemblyInfo.cs index 97c869f804..067874f4f0 100644 --- a/mcs/class/Facades/System.Resources.ResourceManager/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Resources.ResourceManager/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Resources.ResourceManager.dll")] [assembly: AssemblyDescription ("System.Resources.ResourceManager.dll")] [assembly: AssemblyDefaultAlias ("System.Resources.ResourceManager.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Resources.ResourceManager/Makefile b/mcs/class/Facades/System.Resources.ResourceManager/Makefile index 0a3cf9d347..018d077905 100644 --- a/mcs/class/Facades/System.Resources.ResourceManager/Makefile +++ b/mcs/class/Facades/System.Resources.ResourceManager/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Resources.ResourceManager SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Resources.ResourceManager.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager.dll.sources b/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager.dll.sources +++ b/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Resources.ResourceManager/TypeForwarders.cs b/mcs/class/Facades/System.Resources.ResourceManager/TypeForwarders.cs index 349023f6cc..bea32f418e 100644 --- a/mcs/class/Facades/System.Resources.ResourceManager/TypeForwarders.cs +++ b/mcs/class/Facades/System.Resources.ResourceManager/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Resources.MissingManifestResourceException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Resources.NeutralResourcesLanguageAttribute))] diff --git a/mcs/class/Facades/System.Runtime.Extensions/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.Extensions/AssemblyInfo.cs index 8d2517ab53..f3163e0d80 100644 --- a/mcs/class/Facades/System.Runtime.Extensions/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime.Extensions/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.Extensions.dll")] [assembly: AssemblyDescription ("System.Runtime.Extensions.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.Extensions.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.Extensions/Makefile b/mcs/class/Facades/System.Runtime.Extensions/Makefile index 9c371e1bed..489c457dc9 100644 --- a/mcs/class/Facades/System.Runtime.Extensions/Makefile +++ b/mcs/class/Facades/System.Runtime.Extensions/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime.Extensions SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.Extensions.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions.dll.sources b/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions.dll.sources +++ b/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.Extensions/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Extensions/TypeForwarders.cs index d0c05ecc04..a12987dbdc 100644 --- a/mcs/class/Facades/System.Runtime.Extensions/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime.Extensions/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,17 +18,18 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriBuilder))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.BitConverter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Convert))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Stopwatch))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Environment))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Path))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Math))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Random))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringComparer))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Stopwatch))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MidpointRounding))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Progress<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Path))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.WebUtility))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Progress<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Random))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringComparer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriBuilder))] diff --git a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/AssemblyInfo.cs new file mode 100644 index 0000000000..f63a705107 --- /dev/null +++ b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/AssemblyInfo.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle ("System.Runtime.InteropServices.WindowsRuntime.dll")] +[assembly: AssemblyDescription ("System.Runtime.InteropServices.WindowsRuntime.dll")] +[assembly: AssemblyDefaultAlias ("System.Runtime.InteropServices.WindowsRuntime.dll")] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] +[assembly: AssemblyVersion ("4.0.0.0")] +[assembly: AssemblyInformationalVersion ("4.0.0.0")] +[assembly: AssemblyFileVersion ("4.0.0.0")] +[assembly: AssemblyDelaySign (true)] +[assembly: AssemblyKeyFile ("../../msfinal.pub")] + +[assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile new file mode 100644 index 0000000000..bb8dbee9be --- /dev/null +++ b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile @@ -0,0 +1,22 @@ +MCS_BUILD_DIR = ../../../build + +thisdir = class/Facades/System.Runtime.InteropServices.WindowsRuntime +SUBDIRS = +include $(MCS_BUILD_DIR)/rules.make + +LIBRARY_SUBDIR = Facades +LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades + +LIBRARY = System.Runtime.InteropServices.WindowsRuntime.dll + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib + +PLATFORM_DEBUG_FLAGS = + +NO_TEST = yes + +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/System.Runtime.InteropServices.WindowsRuntime.dll.sources b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/System.Runtime.InteropServices.WindowsRuntime.dll.sources new file mode 100644 index 0000000000..8e33d4ddea --- /dev/null +++ b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/System.Runtime.InteropServices.WindowsRuntime.dll.sources @@ -0,0 +1,3 @@ +TypeForwarders.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/TypeForwarders.cs new file mode 100644 index 0000000000..efc9d91377 --- /dev/null +++ b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/TypeForwarders.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +// +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.DefaultInterfaceAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.IActivationFactory))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.InterfaceImplementedInVersionAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArrayAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.ReturnValueNameAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.WindowsRuntime.WriteOnlyArrayAttribute))] diff --git a/mcs/class/Facades/System.Runtime.InteropServices/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.InteropServices/AssemblyInfo.cs index fa299ae9c6..25b7d0a053 100644 --- a/mcs/class/Facades/System.Runtime.InteropServices/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime.InteropServices/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.InteropServices.dll")] [assembly: AssemblyDescription ("System.Runtime.InteropServices.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.InteropServices.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.InteropServices/Makefile b/mcs/class/Facades/System.Runtime.InteropServices/Makefile index 133466068c..b3e4a41c80 100644 --- a/mcs/class/Facades/System.Runtime.InteropServices/Makefile +++ b/mcs/class/Facades/System.Runtime.InteropServices/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime.InteropServices SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.InteropServices.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices.dll.sources b/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices.dll.sources +++ b/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs index 29d69ea40a..599fff8e80 100644 --- a/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime.InteropServices/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,10 +18,16 @@ // 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 !FULL_AOT_RUNTIME +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComImportAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DispatchWrapper))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ErrorWrapper))] +#endif [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DataMisalignedException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Missing))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DllNotFoundException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Missing))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ArrayWithOffset))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.BestFitMappingAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.BStrWrapper))] @@ -37,10 +38,8 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComDefaultInterfaceAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComEventInterfaceAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.COMException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComInterfaceType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComMemberType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComSourceInterfacesAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CriticalHandle))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CurrencyWrapper))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultCharSetAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DispIdAttribute))] @@ -50,23 +49,17 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.GuidAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ICustomAdapter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.InAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.InterfaceTypeAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.InvalidComObjectException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.InvalidOleVariantTypeException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.MarshalAsAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.MarshalDirectiveException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.OptionalAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.PreserveSigAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.SafeArrayRankMismatchException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.SafeArrayTypeMismatchException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.SafeHandle))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.SafeBuffer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.SEHException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.TypeIdentifierAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.UnknownWrapper))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.UnmanagedType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.VarEnum))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.VariantWrapper))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.DefaultParameterValueAttribute))] diff --git a/mcs/class/Facades/System.Runtime.Numerics/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.Numerics/AssemblyInfo.cs index 3a4e894f56..00b01219c8 100644 --- a/mcs/class/Facades/System.Runtime.Numerics/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime.Numerics/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.Numerics.dll")] [assembly: AssemblyDescription ("System.Runtime.Numerics.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.Numerics.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.Numerics/Makefile b/mcs/class/Facades/System.Runtime.Numerics/Makefile index eb821c8656..b21abddbab 100644 --- a/mcs/class/Facades/System.Runtime.Numerics/Makefile +++ b/mcs/class/Facades/System.Runtime.Numerics/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime.Numerics SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.Numerics.dll -LIB_MCS_FLAGS = /r:System.Numerics + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Numerics PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics.dll.sources b/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics.dll.sources +++ b/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.Numerics/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Numerics/TypeForwarders.cs index e937f327cd..ac647df3d1 100644 --- a/mcs/class/Facades/System.Runtime.Numerics/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime.Numerics/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Numerics.BigInteger))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Numerics.Complex))] diff --git a/mcs/class/Facades/System.Runtime.Serialization.Json/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.Serialization.Json/AssemblyInfo.cs index 6eda657d09..6710dca152 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Json/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime.Serialization.Json/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.Serialization.Json.dll")] [assembly: AssemblyDescription ("System.Runtime.Serialization.Json.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Json.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile index 8997f73155..30bc06f1d1 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile +++ b/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime.Serialization.Json SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.Serialization.Json.dll -LIB_MCS_FLAGS = /r:System.Runtime.Serialization /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Runtime.Serialization PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources b/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources +++ b/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Json/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Serialization.Json/TypeForwarders.cs index 9ccfd6eba2..57aeedd78a 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Json/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime.Serialization.Json/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,9 +18,10 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.Json.DataContractJsonSerializer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DateTimeFormat))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.EmitTypeInformation))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.Json.DataContractJsonSerializer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.Json.DataContractJsonSerializerSettings))] diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.Serialization.Primitives/AssemblyInfo.cs index b7749b9903..c76790eaf0 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.Serialization.Primitives.dll")] [assembly: AssemblyDescription ("System.Runtime.Serialization.Primitives.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Primitives.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile index 4210975d19..403f973fba 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile +++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime.Serialization.Primitives SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.Serialization.Primitives.dll -LIB_MCS_FLAGS = /r:System.Runtime.Serialization /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Runtime.Serialization PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources b/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources +++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs index 10faec2b27..ce3180fe1f 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.CollectionDataContractAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ContractNamespaceAttribute))] diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime.Serialization.Xml/AssemblyInfo.cs index 2194c61005..f88da3f3a5 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Xml/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.Serialization.Xml.dll")] [assembly: AssemblyDescription ("System.Runtime.Serialization.Xml.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Xml.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile index 9be218059f..cf4c9ab90e 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile +++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime.Serialization.Xml SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.Serialization.Xml.dll -LIB_MCS_FLAGS = /r:System.Runtime.Serialization /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Runtime.Serialization /r:System.Xml PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources b/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources +++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs b/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs index ffedd4dbbf..34638aee54 100644 --- a/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,19 +18,20 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XmlObjectSerializer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractResolver))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractSerializer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractSerializerSettings))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XmlObjectSerializer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlDictionary))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.UniqueId))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlBinaryReaderSession))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlBinaryWriterSession))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionary))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionaryReader))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionaryReaderQuotas))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionaryString))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlDictionaryWriter))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractResolver))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractSerializerSettings))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlBinaryReaderSession))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlBinaryWriterSession))] diff --git a/mcs/class/Facades/System.Runtime/AssemblyInfo.cs b/mcs/class/Facades/System.Runtime/AssemblyInfo.cs index c921c6c115..359e2334b7 100644 --- a/mcs/class/Facades/System.Runtime/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Runtime/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Runtime.dll")] [assembly: AssemblyDescription ("System.Runtime.dll")] [assembly: AssemblyDefaultAlias ("System.Runtime.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Runtime/Makefile b/mcs/class/Facades/System.Runtime/Makefile index bb482472a1..72ada093b0 100644 --- a/mcs/class/Facades/System.Runtime/Makefile +++ b/mcs/class/Facades/System.Runtime/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Runtime SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Runtime.dll -LIB_MCS_FLAGS = /r:System /r:System.Core /r:System.ComponentModel.Composition + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System /r:System.ComponentModel.Composition /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Runtime/System.Runtime.dll.sources b/mcs/class/Facades/System.Runtime/System.Runtime.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Runtime/System.Runtime.dll.sources +++ b/mcs/class/Facades/System.Runtime/System.Runtime.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Runtime/TypeForwarders.cs b/mcs/class/Facades/System.Runtime/TypeForwarders.cs index 2a6afa89ae..4a6a0166b3 100644 --- a/mcs/class/Facades/System.Runtime/TypeForwarders.cs +++ b/mcs/class/Facades/System.Runtime/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,89 +18,144 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ExtensionAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Uri))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriComponents))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriFormat))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriKind))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DefaultValueAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EditorBrowsableAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EditorBrowsableState))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(object))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ValueType))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IComparable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IComparable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IEquatable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IFormattable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(decimal))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Delegate))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MulticastDelegate))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Activator))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Exception))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ArgumentException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ArgumentNullException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ArgumentOutOfRangeException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ArithmeticException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IEnumerable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ICollection))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IList))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Array))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ArraySegment<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ArrayTypeMismatchException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.AsyncCallback))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Attribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Enum))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.AttributeTargets))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.AttributeUsageAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.BadImageFormatException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(bool))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Boolean))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Buffer))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(byte))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(char))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Byte))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Char))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.CLSCompliantAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.DictionaryEntry))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.ICollection<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IComparer<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IDictionary<,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IEnumerable<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IEnumerator<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IEqualityComparer<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IList<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IReadOnlyCollection<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IReadOnlyDictionary<,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IReadOnlyList<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.ISet<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.KeyNotFoundException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.KeyValuePair<,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ICollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IComparer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IDictionary))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IDictionaryEnumerator))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IEnumerable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IEnumerator))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IEqualityComparer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IList))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IStructuralComparable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IStructuralEquatable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.Collection<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.ReadOnlyCollection<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Comparison<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.DefaultValueAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EditorBrowsableAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ComponentModel.EditorBrowsableState))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DateTime))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DateTimeKind))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DateTimeOffset))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DayOfWeek))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Decimal))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Delegate))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.ConditionalAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.DebuggableAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DivideByZeroException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(double))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Double))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Enum))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.EventArgs))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.EventHandler))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.EventHandler<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Exception))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.FlagsAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.FormatException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.GC))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.GCCollectionMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.DateTimeStyles))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.NumberStyles))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.TimeSpanStyles))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Guid))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IAsyncResult))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IComparable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IComparable<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ICustomFormatter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IDisposable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IEquatable<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IFormatProvider))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IFormattable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IndexOutOfRangeException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(short))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(int))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(long))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Int16))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Int32))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Int64))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IntPtr))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.InvalidCastException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.InvalidOperationException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.InvalidTimeZoneException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IObservable<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IObserver<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IProgress<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Lazy<,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Lazy<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MemberAccessException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MissingMemberException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MTAThreadAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MulticastDelegate))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.NotImplementedException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.NotSupportedException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Nullable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Nullable<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.NullReferenceException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Object))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ObjectDisposedException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ObsoleteAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.OutOfMemoryException))] @@ -114,47 +164,6 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.PlatformNotSupportedException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Predicate<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RankException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RuntimeFieldHandle))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RuntimeMethodHandle))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RuntimeTypeHandle))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(sbyte))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(float))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IComparer<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IEqualityComparer<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IComparer))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IEqualityComparer))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringComparison))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringSplitOptions))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TimeoutException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TimeSpan))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Type))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TypeInitializationException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TypeLoadException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(ushort))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(uint))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(ulong))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UIntPtr))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UnauthorizedAccessException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Version))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(void))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.WeakReference))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.DictionaryEntry))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IDictionary))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IEnumerator))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IDictionaryEnumerator))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IEnumerable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.ICollection<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IDictionary<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IEnumerator<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IList<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.KeyNotFoundException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.KeyValuePair<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.Collection<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.ObjectModel.ReadOnlyCollection<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.ConditionalAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.DebuggableAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.DateTimeStyles))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.NumberStyles))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyCompanyAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyConfigurationAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyCopyrightAttribute))] @@ -167,113 +176,100 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyInformationalVersionAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyKeyFileAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyKeyNameAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyMetadataAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyNameFlags))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyProductAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblySignatureKeyAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyTitleAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyTrademarkAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyVersionAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.DefaultMemberAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AccessedThroughPropertyAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncStateMachineAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallerFilePathAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallerLineNumberAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallerMemberNameAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CompilationRelaxationsAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CustomConstantAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.DateTimeConstantAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.DecimalConstantAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ExtensionAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.FixedBufferAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IndexerNameAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.InternalsVisibleToAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IStrongBox))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IsVolatile))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IteratorStateMachineAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.MethodImplAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.MethodImplOptions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ReferenceAssemblyAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.RuntimeCompatibilityAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.RuntimeHelpers))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.StateMachineAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.StrongBox<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TypeForwardedFromAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TypeForwardedToAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.UnsafeValueTypeAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.ExceptionServices.ExceptionDispatchInfo))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.GCLatencyMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.GCSettings))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CharSet))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComVisibleAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.FieldOffsetAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.LayoutKind))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.OutAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.StructLayoutAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Versioning.TargetFrameworkAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RuntimeFieldHandle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RuntimeMethodHandle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.RuntimeTypeHandle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.SByte))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AllowPartiallyTrustedCallersAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.SecurityCriticalAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.SecurityException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.SecuritySafeCriticalAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.SecurityTransparentAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.VerificationException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Single))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.STAThreadAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.String))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringComparison))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringSplitOptions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.StringBuilder))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.WaitHandle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LazyThreadSafetyMode))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Timeout))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.InvalidTimeZoneException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TimeZoneInfo))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IStrongBox))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.StrongBox<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.TimeSpanStyles))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Lazy<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.ISet<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Action<,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IStructuralComparable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.IStructuralEquatable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Func<,,,,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Lazy<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.WaitHandle))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ThreadStaticAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TimeoutException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TimeSpan))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TimeZoneInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,,,>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<,>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Tuple<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Type))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TypeAccessException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TypeForwardedFromAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TypeForwardedToAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.AllowPartiallyTrustedCallersAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LazyThreadSafetyMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TypeInitializationException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.TypeLoadException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UInt16))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UInt32))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UInt64))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UIntPtr))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UnauthorizedAccessException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Uri))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriComponents))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriFormat))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriHostNameType))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.GCCollectionMode))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IObservable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IObserver<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.GCLatencyMode))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.GCSettings))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.FixedBufferAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.UnsafeValueTypeAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CharSet))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComVisibleAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IReadOnlyCollection<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IReadOnlyList<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IProgress<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.MTAThreadAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.STAThreadAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.UriKind))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ValueType))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Version))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.WeakReference))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.WeakReference<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Collections.Generic.IReadOnlyDictionary<,>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblyMetadataAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.AssemblySignatureKeyAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.StateMachineAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncStateMachineAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallerFilePathAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallerLineNumberAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.CallerMemberNameAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IteratorStateMachineAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ReferenceAssemblyAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.ExceptionServices.ExceptionDispatchInfo))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(string))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(void))] diff --git a/mcs/class/Facades/System.Security.Principal/AssemblyInfo.cs b/mcs/class/Facades/System.Security.Principal/AssemblyInfo.cs index 9add5807e5..9d0d014384 100644 --- a/mcs/class/Facades/System.Security.Principal/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Security.Principal/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Security.Principal.dll")] [assembly: AssemblyDescription ("System.Security.Principal.dll")] [assembly: AssemblyDefaultAlias ("System.Security.Principal.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Security.Principal/Makefile b/mcs/class/Facades/System.Security.Principal/Makefile index 6662c5ac9a..738880ff00 100644 --- a/mcs/class/Facades/System.Security.Principal/Makefile +++ b/mcs/class/Facades/System.Security.Principal/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Security.Principal SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Security.Principal.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Security.Principal/System.Security.Principal.dll.sources b/mcs/class/Facades/System.Security.Principal/System.Security.Principal.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Security.Principal/System.Security.Principal.dll.sources +++ b/mcs/class/Facades/System.Security.Principal/System.Security.Principal.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Security.Principal/TypeForwarders.cs b/mcs/class/Facades/System.Security.Principal/TypeForwarders.cs index 85a934368b..a6682541e6 100644 --- a/mcs/class/Facades/System.Security.Principal/TypeForwarders.cs +++ b/mcs/class/Facades/System.Security.Principal/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Principal.IIdentity))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Principal.IPrincipal))] diff --git a/mcs/class/Facades/System.ServiceModel.Http/AssemblyInfo.cs b/mcs/class/Facades/System.ServiceModel.Http/AssemblyInfo.cs index a44d7588ec..2dc616e75c 100644 --- a/mcs/class/Facades/System.ServiceModel.Http/AssemblyInfo.cs +++ b/mcs/class/Facades/System.ServiceModel.Http/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.ServiceModel.Http.dll")] [assembly: AssemblyDescription ("System.ServiceModel.Http.dll")] [assembly: AssemblyDefaultAlias ("System.ServiceModel.Http.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.ServiceModel.Http/Makefile b/mcs/class/Facades/System.ServiceModel.Http/Makefile index b3eda58895..b709ac623e 100644 --- a/mcs/class/Facades/System.ServiceModel.Http/Makefile +++ b/mcs/class/Facades/System.ServiceModel.Http/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.ServiceModel.Http SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.ServiceModel.Http.dll -LIB_MCS_FLAGS = /r:System.ServiceModel + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.ServiceModel PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http.dll.sources b/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http.dll.sources +++ b/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs index 79b95a0203..57276e7078 100644 --- a/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs +++ b/mcs/class/Facades/System.ServiceModel.Http/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpBinding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpMessageCredentialType))] @@ -30,13 +26,14 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.BasicHttpSecurityMode))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpRequestMessageProperty))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpResponseMessageProperty))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpTransportBindingElement))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpsTransportBindingElement))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.HttpTransportBindingElement))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IHttpCookieContainerManager))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.WebSocketTransportSettings))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.WebSocketTransportUsage))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpBindingBase))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpClientCredentialType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpTransportSecurity))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpBinding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpMessageEncoding))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.WebSocketTransportSettings))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.WebSocketTransportUsage))] diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/AssemblyInfo.cs b/mcs/class/Facades/System.ServiceModel.Primitives/AssemblyInfo.cs index c180411f3e..02bec1d5c4 100644 --- a/mcs/class/Facades/System.ServiceModel.Primitives/AssemblyInfo.cs +++ b/mcs/class/Facades/System.ServiceModel.Primitives/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.ServiceModel.Primitives.dll")] [assembly: AssemblyDescription ("System.ServiceModel.Primitives.dll")] [assembly: AssemblyDefaultAlias ("System.ServiceModel.Primitives.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/Makefile b/mcs/class/Facades/System.ServiceModel.Primitives/Makefile index c71d40bc9d..5391e8cdef 100644 --- a/mcs/class/Facades/System.ServiceModel.Primitives/Makefile +++ b/mcs/class/Facades/System.ServiceModel.Primitives/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.ServiceModel.Primitives SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.ServiceModel.Primitives.dll -LIB_MCS_FLAGS = /r:System.ServiceModel /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.ServiceModel /r:System.Xml PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources b/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources +++ b/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs b/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs index 9cb7162320..37b5c7d915 100644 --- a/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs +++ b/mcs/class/Facades/System.ServiceModel.Primitives/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,132 +18,145 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.XmlSerializerFormatAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationException))] +#if !MONOTOUCH +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.CompressionFormat))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.ClientOperation))] +#endif [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ActionNotSupportedException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IDefaultCommunicationTimeouts))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.Binding))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ICommunicationObject))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.CommunicationObject))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IChannelFactory))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ChannelFactory))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ClientBase<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IChannel))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IOutputChannel))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IRequestChannel))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IExtensibleObject<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IContextChannel))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IClientChannel))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationObjectAbortedException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationObjectFaultedException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationState))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.DataContractFormatAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointAddress))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointAddressBuilder))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointNotFoundException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EnvelopeVersion))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ExceptionDetail))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultCode))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultContractAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultException<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultReason))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultReasonText))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IExtension<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IExtensionCollection<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.InvalidMessageContractException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageContractMemberAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageBodyMemberAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageContractAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ProtocolException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageHeaderException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageParameterAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContext))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContextScope))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContractAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationFormatStyle))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.QuotaExceededException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServerTooBusyException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServiceActivationException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServiceContractAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServiceKnownTypeAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.UnknownMessageReceivedEventArgs))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ChannelFactory<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.AddressHeader))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.AddressHeaderCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.AddressingVersion))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BindingElement))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageEncodingBindingElement))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BinaryMessageEncodingBindingElement))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.Binding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BindingContext))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BindingElement))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BindingElementCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BindingParameterCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BodyWriter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.BufferManager))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ChannelBase))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ChannelManagerBase))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ChannelFactoryBase))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IChannelFactory<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ChannelFactoryBase<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ChannelManagerBase))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ChannelParameterCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.CommunicationObject))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.CustomBinding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.FaultConverter))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.TransportBindingElement))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IInputChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IChannelFactory))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IChannelFactory<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IDuplexChannel))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ISession))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IInputSession))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IOutputSession))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IDuplexSession))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ISessionChannel<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IDuplexSessionChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IInputChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IInputSession))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IInputSessionChannel))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IMessageProperty))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IOutputChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IOutputSession))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IOutputSessionChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IRequestChannel))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.IRequestSessionChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ISession))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.ISessionChannel<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.Message))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageBuffer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageEncoder))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageEncoderFactory))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageEncodingBindingElement))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageFault))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageHeaderInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageHeader))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageHeaderInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageHeaders))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageProperties))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageState))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.MessageVersion))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.RequestContext))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.TextMessageEncodingBindingElement))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.TransportBindingElement))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ClientBase<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationObjectAbortedException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationObjectFaultedException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.CommunicationState))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.DataContractFormatAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.ClientCredentials))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.ContractDescription))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.DataContractSerializerOperationBehavior))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.FaultDescription))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.FaultDescriptionCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.IContractBehavior))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.IEndpointBehavior))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.IOperationBehavior))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageBodyDescription))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageDescription))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageDescriptionCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageDirection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageHeaderDescription))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageHeaderDescriptionCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessagePartDescription))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessagePartDescriptionCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessagePropertyDescription))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessagePropertyDescriptionCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.OperationDescription))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.OperationDescriptionCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.ServiceEndpoint))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.MessageSecurityException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.SecurityAccessDeniedException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.UserNamePasswordClientCredential))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ChannelFactory<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.ClientRuntime))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.DispatchOperation))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.DispatchRuntime))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.EndpointDispatcher))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.IClientMessageFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.IClientMessageInspector))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.IClientOperationSelector))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Dispatcher.IParameterInspector))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointAddress))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointAddressBuilder))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointIdentity))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EndpointNotFoundException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.EnvelopeVersion))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ExceptionDetail))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultCode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultContractAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultException<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultReason))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.FaultReasonText))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IClientChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ICommunicationObject))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IContextChannel))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IDefaultCommunicationTimeouts))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IExtensibleObject<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IExtension<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.IExtensionCollection<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.InvalidMessageContractException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageBodyMemberAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageContractAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageContractMemberAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageCredentialType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageHeader<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.SecurityMode))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.TransferMode))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.IEndpointBehavior))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.IOperationBehavior))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.DataContractSerializerOperationBehavior))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.IContractBehavior))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageHeaderDescription))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessageHeaderDescriptionCollection))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessagePropertyDescription))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Description.MessagePropertyDescriptionCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageHeaderException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.MessageParameterAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContext))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContextScope))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationContractAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.OperationFormatStyle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ProtocolException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.QuotaExceededException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.HttpDigestClientCredential))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.MessageSecurityException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.SecurityAccessDeniedException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.UserNamePasswordClientCredential))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Security.WindowsClientCredential))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.SecurityMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServerTooBusyException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServiceActivationException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServiceContractAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.ServiceKnownTypeAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.TransferMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.UnknownMessageReceivedEventArgs))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.XmlSerializerFormatAttribute))] diff --git a/mcs/class/Facades/System.Text.Encoding.Extensions/AssemblyInfo.cs b/mcs/class/Facades/System.Text.Encoding.Extensions/AssemblyInfo.cs index e8e33f00cd..33c51e0187 100644 --- a/mcs/class/Facades/System.Text.Encoding.Extensions/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Text.Encoding.Extensions/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Text.Encoding.Extensions.dll")] [assembly: AssemblyDescription ("System.Text.Encoding.Extensions.dll")] [assembly: AssemblyDefaultAlias ("System.Text.Encoding.Extensions.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile b/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile index eb7bed8371..b8cbfb2283 100644 --- a/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile +++ b/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Text.Encoding.Extensions SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Text.Encoding.Extensions.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions.dll.sources b/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions.dll.sources +++ b/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Text.Encoding.Extensions/TypeForwarders.cs b/mcs/class/Facades/System.Text.Encoding.Extensions/TypeForwarders.cs index 8b7affa11a..fe366378eb 100644 --- a/mcs/class/Facades/System.Text.Encoding.Extensions/TypeForwarders.cs +++ b/mcs/class/Facades/System.Text.Encoding.Extensions/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.UnicodeEncoding))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.UTF8Encoding))] diff --git a/mcs/class/Facades/System.Text.Encoding/AssemblyInfo.cs b/mcs/class/Facades/System.Text.Encoding/AssemblyInfo.cs index 5f87926050..ff006b094f 100644 --- a/mcs/class/Facades/System.Text.Encoding/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Text.Encoding/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Text.Encoding.dll")] [assembly: AssemblyDescription ("System.Text.Encoding.dll")] [assembly: AssemblyDefaultAlias ("System.Text.Encoding.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Text.Encoding/Makefile b/mcs/class/Facades/System.Text.Encoding/Makefile index cdbab84043..bf200cf7c5 100644 --- a/mcs/class/Facades/System.Text.Encoding/Makefile +++ b/mcs/class/Facades/System.Text.Encoding/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Text.Encoding SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Text.Encoding.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding.dll.sources b/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding.dll.sources +++ b/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Text.Encoding/TypeForwarders.cs b/mcs/class/Facades/System.Text.Encoding/TypeForwarders.cs index d15e314346..8c132eccc5 100644 --- a/mcs/class/Facades/System.Text.Encoding/TypeForwarders.cs +++ b/mcs/class/Facades/System.Text.Encoding/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.Decoder))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.DecoderFallbackException))] diff --git a/mcs/class/Facades/System.Text.RegularExpressions/AssemblyInfo.cs b/mcs/class/Facades/System.Text.RegularExpressions/AssemblyInfo.cs index 4caaa79a5d..41f882f463 100644 --- a/mcs/class/Facades/System.Text.RegularExpressions/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Text.RegularExpressions/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Text.RegularExpressions.dll")] [assembly: AssemblyDescription ("System.Text.RegularExpressions.dll")] [assembly: AssemblyDefaultAlias ("System.Text.RegularExpressions.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Text.RegularExpressions/Makefile b/mcs/class/Facades/System.Text.RegularExpressions/Makefile index 34e35c9894..24cd5d7fce 100644 --- a/mcs/class/Facades/System.Text.RegularExpressions/Makefile +++ b/mcs/class/Facades/System.Text.RegularExpressions/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Text.RegularExpressions SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Text.RegularExpressions.dll -LIB_MCS_FLAGS = /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions.dll.sources b/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions.dll.sources +++ b/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs b/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs index 62e0e5c58b..be4c7cc58b 100644 --- a/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs +++ b/mcs/class/Facades/System.Text.RegularExpressions/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.Capture))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.CaptureCollection))] @@ -32,6 +28,6 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.MatchCollection))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.MatchEvaluator))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.Regex))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexOptions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexMatchTimeoutException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.RegularExpressions.RegexOptions))] diff --git a/mcs/class/Facades/System.Threading.Tasks.Parallel/AssemblyInfo.cs b/mcs/class/Facades/System.Threading.Tasks.Parallel/AssemblyInfo.cs index d01e3e586a..25719f70bf 100644 --- a/mcs/class/Facades/System.Threading.Tasks.Parallel/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Threading.Tasks.Parallel/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Threading.Tasks.Parallel.dll")] [assembly: AssemblyDescription ("System.Threading.Tasks.Parallel.dll")] [assembly: AssemblyDefaultAlias ("System.Threading.Tasks.Parallel.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile b/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile index 1704d13f70..37059d95bf 100644 --- a/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile +++ b/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Threading.Tasks.Parallel SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Threading.Tasks.Parallel.dll -LIB_MCS_FLAGS = + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel.dll.sources b/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel.dll.sources +++ b/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Threading.Tasks.Parallel/TypeForwarders.cs b/mcs/class/Facades/System.Threading.Tasks.Parallel/TypeForwarders.cs index 16a8a39a14..bdf9140205 100644 --- a/mcs/class/Facades/System.Threading.Tasks.Parallel/TypeForwarders.cs +++ b/mcs/class/Facades/System.Threading.Tasks.Parallel/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Parallel))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.ParallelLoopResult))] diff --git a/mcs/class/Facades/System.Threading.Tasks/AssemblyInfo.cs b/mcs/class/Facades/System.Threading.Tasks/AssemblyInfo.cs index 94041db6eb..b4b38c4706 100644 --- a/mcs/class/Facades/System.Threading.Tasks/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Threading.Tasks/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Threading.Tasks.dll")] [assembly: AssemblyDescription ("System.Threading.Tasks.dll")] [assembly: AssemblyDefaultAlias ("System.Threading.Tasks.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Threading.Tasks/Makefile b/mcs/class/Facades/System.Threading.Tasks/Makefile index 57f1823544..2358e77f0f 100644 --- a/mcs/class/Facades/System.Threading.Tasks/Makefile +++ b/mcs/class/Facades/System.Threading.Tasks/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Threading.Tasks SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Threading.Tasks.dll -LIB_MCS_FLAGS = /r:System.Core /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks.dll.sources b/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks.dll.sources +++ b/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Threading.Tasks/TypeForwarders.cs b/mcs/class/Facades/System.Threading.Tasks/TypeForwarders.cs index 9d1d9bd176..bebef9da52 100644 --- a/mcs/class/Facades/System.Threading.Tasks/TypeForwarders.cs +++ b/mcs/class/Facades/System.Threading.Tasks/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,35 +18,36 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskExtensions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.AggregateException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.OperationCanceledException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncVoidMethodBuilder))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConfiguredTaskAwaitable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IAsyncStateMachine))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ICriticalNotifyCompletion))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.INotifyCompletion))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TaskAwaiter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TaskAwaiter<>))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.YieldAwaitable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.CancellationToken))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.CancellationTokenRegistration))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.CancellationTokenSource))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Task))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Task<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskCanceledException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskCompletionSource<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskContinuationOptions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskCreationOptions))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskExtensions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskFactory))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskFactory<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskScheduler))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskSchedulerException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.TaskStatus))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.UnobservedTaskExceptionEventArgs))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncVoidMethodBuilder))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConfiguredTaskAwaitable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.INotifyCompletion))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ICriticalNotifyCompletion))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.IAsyncStateMachine))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TaskAwaiter))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.TaskAwaiter<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.YieldAwaitable))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair))] diff --git a/mcs/class/Facades/System.Threading/AssemblyInfo.cs b/mcs/class/Facades/System.Threading/AssemblyInfo.cs index 2b90731b7f..c68b68a093 100644 --- a/mcs/class/Facades/System.Threading/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Threading/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Threading.dll")] [assembly: AssemblyDescription ("System.Threading.dll")] [assembly: AssemblyDefaultAlias ("System.Threading.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Threading/Makefile b/mcs/class/Facades/System.Threading/Makefile index 5d845c942e..62788e4c86 100644 --- a/mcs/class/Facades/System.Threading/Makefile +++ b/mcs/class/Facades/System.Threading/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Threading SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Threading.dll -LIB_MCS_FLAGS = /r:System.Core /r:System + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System /r:System.Core PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Threading/System.Threading.dll.sources b/mcs/class/Facades/System.Threading/System.Threading.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Threading/System.Threading.dll.sources +++ b/mcs/class/Facades/System.Threading/System.Threading.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Threading/TypeForwarders.cs b/mcs/class/Facades/System.Threading/TypeForwarders.cs index 605b66f26b..7d6affcb01 100644 --- a/mcs/class/Facades/System.Threading/TypeForwarders.cs +++ b/mcs/class/Facades/System.Threading/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,32 +18,33 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SynchronizationContext))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.EventWaitHandle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.AbandonedMutexException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.AutoResetEvent))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Interlocked))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ManualResetEvent))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Monitor))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SendOrPostCallback))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SynchronizationLockException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LockRecursionPolicy))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ReaderWriterLockSlim))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Barrier))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.BarrierPostPhaseException))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Semaphore))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.AbandonedMutexException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.CountdownEvent))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.EventResetMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.EventWaitHandle))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Interlocked))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LazyInitializer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LockRecursionException))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.LockRecursionPolicy))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ManualResetEvent))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ManualResetEventSlim))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Monitor))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Mutex))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ReaderWriterLockSlim))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Semaphore))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SemaphoreFullException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SemaphoreSlim))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SendOrPostCallback))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SpinLock))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SpinWait))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SynchronizationContext))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.SynchronizationLockException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ThreadLocal<>))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.WaitHandleCannotBeOpenedException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Volatile))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.WaitHandleCannotBeOpenedException))] diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/AssemblyInfo.cs b/mcs/class/Facades/System.Xml.ReaderWriter/AssemblyInfo.cs index 54a6d7d37a..d051051155 100644 --- a/mcs/class/Facades/System.Xml.ReaderWriter/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Xml.ReaderWriter/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Xml.ReaderWriter.dll")] [assembly: AssemblyDescription ("System.Xml.ReaderWriter.dll")] [assembly: AssemblyDefaultAlias ("System.Xml.ReaderWriter.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/Makefile b/mcs/class/Facades/System.Xml.ReaderWriter/Makefile index 5f91ff210c..57feb51f2a 100644 --- a/mcs/class/Facades/System.Xml.ReaderWriter/Makefile +++ b/mcs/class/Facades/System.Xml.ReaderWriter/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Xml.ReaderWriter SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Xml.ReaderWriter.dll -LIB_MCS_FLAGS = /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Xml PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter.dll.sources b/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter.dll.sources +++ b/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs b/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs index 0d3ab53df0..f3ee0d8101 100644 --- a/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs +++ b/mcs/class/Facades/System.Xml.ReaderWriter/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,21 +18,24 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.ConformanceLevel))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.DtdProcessing))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlLineInfo))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlNamespaceResolver))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.NamespaceHandling))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlNameTable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.NameTable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.NewLineHandling))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.ReadState))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Schema.XmlSchema))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Schema.XmlSchemaForm))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.WriteState))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlConvert))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlException))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlNamespaceManager))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlNamespaceScope))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlNameTable))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlNodeType))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlParserContext))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlQualifiedName))] @@ -46,6 +44,4 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlSpace))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlWriter))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.XmlWriterSettings))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Schema.XmlSchema))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Schema.XmlSchemaForm))] diff --git a/mcs/class/Facades/System.Xml.XDocument/AssemblyInfo.cs b/mcs/class/Facades/System.Xml.XDocument/AssemblyInfo.cs index e3f2265166..bd6476be52 100644 --- a/mcs/class/Facades/System.Xml.XDocument/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Xml.XDocument/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Xml.XDocument.dll")] [assembly: AssemblyDescription ("System.Xml.XDocument.dll")] [assembly: AssemblyDefaultAlias ("System.Xml.XDocument.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Xml.XDocument/Makefile b/mcs/class/Facades/System.Xml.XDocument/Makefile index a02bc52e68..2f2aa6fabd 100644 --- a/mcs/class/Facades/System.Xml.XDocument/Makefile +++ b/mcs/class/Facades/System.Xml.XDocument/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Xml.XDocument SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Xml.XDocument.dll -LIB_MCS_FLAGS = /r:System.Xml.Linq /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Xml.Linq /r:System.Xml PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument.dll.sources b/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument.dll.sources +++ b/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Xml.XDocument/TypeForwarders.cs b/mcs/class/Facades/System.Xml.XDocument/TypeForwarders.cs index 4a74cd240e..4bedfba794 100644 --- a/mcs/class/Facades/System.Xml.XDocument/TypeForwarders.cs +++ b/mcs/class/Facades/System.Xml.XDocument/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,15 +18,13 @@ // 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. +// [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.Extensions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.LoadOptions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.ReaderOptions))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.SaveOptions))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XObject))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XNode))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XText))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XCData))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XComment))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XContainer))] @@ -41,10 +34,13 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XElement))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XName))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XNamespace))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XNode))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XNodeDocumentOrderComparer))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XNodeEqualityComparer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XObject))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XObjectChange))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XObjectChangeEventArgs))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XProcessingInstruction))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XStreamingElement))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Linq.XText))] diff --git a/mcs/class/Facades/System.Xml.XmlSerializer/AssemblyInfo.cs b/mcs/class/Facades/System.Xml.XmlSerializer/AssemblyInfo.cs index 4a33ba5a72..71235d79b0 100644 --- a/mcs/class/Facades/System.Xml.XmlSerializer/AssemblyInfo.cs +++ b/mcs/class/Facades/System.Xml.XmlSerializer/AssemblyInfo.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,6 +18,7 @@ // 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. +// using System; using System.Reflection; @@ -31,10 +27,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle ("System.Xml.XmlSerializer.dll")] [assembly: AssemblyDescription ("System.Xml.XmlSerializer.dll")] [assembly: AssemblyDefaultAlias ("System.Xml.XmlSerializer.dll")] - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany ("Xamarin, Inc.")] +[assembly: AssemblyProduct ("Mono Common Language Infrastructure")] +[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")] [assembly: AssemblyVersion ("4.0.0.0")] [assembly: AssemblyInformationalVersion ("4.0.0.0")] [assembly: AssemblyFileVersion ("4.0.0.0")] @@ -42,3 +37,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyKeyFile ("../../msfinal.pub")] [assembly: ReferenceAssembly] + + diff --git a/mcs/class/Facades/System.Xml.XmlSerializer/Makefile b/mcs/class/Facades/System.Xml.XmlSerializer/Makefile index 700ad785b5..c627fca305 100644 --- a/mcs/class/Facades/System.Xml.XmlSerializer/Makefile +++ b/mcs/class/Facades/System.Xml.XmlSerializer/Makefile @@ -1,15 +1,22 @@ +MCS_BUILD_DIR = ../../../build + thisdir = class/Facades/System.Xml.XmlSerializer SUBDIRS = -include ../../../build/rules.make +include $(MCS_BUILD_DIR)/rules.make LIBRARY_SUBDIR = Facades LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades LIBRARY = System.Xml.XmlSerializer.dll -LIB_MCS_FLAGS = /r:System.Xml + +KEY_FILE = ../../msfinal.pub +SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 +LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.Xml PLATFORM_DEBUG_FLAGS = NO_TEST = yes -include ../../../build/library.make +include $(MCS_BUILD_DIR)/library.make + + diff --git a/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer.dll.sources b/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer.dll.sources index 74532efb2e..8e33d4ddea 100644 --- a/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer.dll.sources +++ b/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer.dll.sources @@ -1,3 +1,3 @@ -AssemblyInfo.cs TypeForwarders.cs -../../../build/common/Consts.cs +AssemblyInfo.cs + diff --git a/mcs/class/Facades/System.Xml.XmlSerializer/TypeForwarders.cs b/mcs/class/Facades/System.Xml.XmlSerializer/TypeForwarders.cs index bda6911b92..df2b775f4e 100644 --- a/mcs/class/Facades/System.Xml.XmlSerializer/TypeForwarders.cs +++ b/mcs/class/Facades/System.Xml.XmlSerializer/TypeForwarders.cs @@ -1,21 +1,16 @@ -// -// TypeForwarders.cs -// -// Author: -// Martin Baulig <martin.baulig@xamarin.com> -// +// // Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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 @@ -23,28 +18,29 @@ // 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. +// -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlSerializer))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlArrayItemAttributes))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAttributeOverrides))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAttributes))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlElementAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.IXmlSerializable))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAnyAttributeAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAnyElementAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAnyElementAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlArrayAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlArrayItemAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlArrayItemAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAttributeAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAttributeOverrides))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlChoiceIdentifierAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlElementAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlElementAttributes))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlEnumAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlIgnoreAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlIncludeAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlNamespaceDeclarationsAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlRootAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlSchemaProviderAttribute))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlSerializer))] +[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlSerializerNamespaces))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlTextAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlTypeAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAnyElementAttributes))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlSerializerNamespaces))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAnyElementAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlNamespaceDeclarationsAttribute))] -[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.Serialization.XmlAnyAttributeAttribute))] diff --git a/mcs/class/I18N/CJK/ISO2022JP.cs b/mcs/class/I18N/CJK/ISO2022JP.cs index 675cd2a333..cd79fad402 100644 --- a/mcs/class/I18N/CJK/ISO2022JP.cs +++ b/mcs/class/I18N/CJK/ISO2022JP.cs @@ -642,7 +642,7 @@ namespace I18N.CJK continue; } i++; - if (bytes [i] == 0x42) + if (bytes [i] == 0x42 || bytes [i] == 0x40) m = wide ? ISO2022JPMode.JISX0208 : ISO2022JPMode.ASCII; else if (bytes [i] == 0x4A) // obsoleted m = ISO2022JPMode.ASCII; @@ -730,7 +730,7 @@ namespace I18N.CJK continue; } i++; - if (bytes [i] == 0x42) + if (bytes [i] == 0x42 || bytes [i] == 0x40) m = wide ? ISO2022JPMode.JISX0208 : ISO2022JPMode.ASCII; else if (bytes [i] == 0x4A) // obsoleted m = ISO2022JPMode.ASCII; diff --git a/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs b/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs index ddc58c7fd1..274ee160ad 100644 --- a/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs +++ b/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs @@ -575,6 +575,14 @@ namespace MonoTests.I18N.CJK Assert.AreEqual ("don\u2019t", s); } + + [Test] + public void Bug14591 () + { + var expected = "\u4f50\u85e4\u8c4a"; + var text = Encoding.GetEncoding ("iso-2022-jp").GetString (Convert.FromBase64String ("GyRAOjRGI0stGyhK")); + Assert.AreEqual (expected, text, "#1"); + } #endregion #region Korean diff --git a/mcs/class/Makefile b/mcs/class/Makefile index 91decc95e6..61267f5eb4 100644 --- a/mcs/class/Makefile +++ b/mcs/class/Makefile @@ -88,10 +88,6 @@ common_dirs := \ SystemWebTestShim net_2_0_dirs := \ - Microsoft.Build.Framework \ - Microsoft.Build.Utilities \ - Microsoft.Build.Engine \ - Microsoft.Build.Tasks \ System.Xml.Linq \ System.Runtime.Serialization \ System.Data.DataSetExtensions \ @@ -114,7 +110,6 @@ net_2_0_dirs := \ Mono.Tasklets \ System.Dynamic \ Mono.CSharp \ - Moonlight.Build.Tasks \ System.Net \ System.Json @@ -128,6 +123,8 @@ net_2_0_only_dirs := \ System.Data.Services \ System.Web.Mvc \ +pcl_facade_dirs := Facades + mobile_dirs := \ corlib \ System \ @@ -156,7 +153,7 @@ mobile_dirs := \ System.Net \ System.Windows \ System.Xml.Serialization \ - Facades + $(pcl_facade_dirs) monodroid_dirs := \ Mono.CompilerServices.SymbolWriter \ @@ -167,16 +164,13 @@ monodroid_dirs := \ monotouch_runtime_dirs := \ corlib -net_3_5_only_dirs := \ - Microsoft.Build.Framework \ - Microsoft.Build.Utilities \ - Microsoft.Build.Engine \ - Microsoft.Build.Tasks +monotouch_dirs := \ + Mono.Dynamic.Interpreter \ + System.Core net_4_0_dirs := \ System.Numerics \ Microsoft.CSharp \ - Microsoft.Build \ System.Windows.Forms.DataVisualization \ System.Xaml \ WindowsBase \ @@ -195,6 +189,7 @@ net_4_0_dirs := \ System.Reactive.Runtime.Remoting \ System.Reactive.Windows.Forms \ System.Reactive.Windows.Threading \ + System.Reactive.Observable.Aliases \ System.Reactive.Experimental \ System.Reactive.Debugger \ Microsoft.Web.Infrastructure \ @@ -229,23 +224,35 @@ net_4_5_dirs := \ System.IO.Compression.FileSystem \ System.Windows \ System.Xml.Serialization \ - Facades - -net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) aot-compiler + $(pcl_facade_dirs) + +xbuild_2_0_dirs := \ + Microsoft.Build.Framework \ + Microsoft.Build.Utilities \ + Microsoft.Build.Engine \ + Mono.XBuild.Tasks \ + Microsoft.Build.Tasks + +xbuild_4_0_dirs := \ + $(xbuild_2_0_dirs) \ + Microsoft.Build + +net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs) -monotouch_SUBDIRS := $(mobile_dirs) +monotouch_SUBDIRS := $(mobile_dirs) $(monotouch_dirs) monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs) mobile_static_SUBDIRS := $(mobile_dirs) mobile_SUBDIRS := $(mobile_dirs) -net_3_5_SUBDIRS := $(net_3_5_only_dirs) -net_4_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) -net_4_5_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) aot-compiler +net_3_5_SUBDIRS := $(xbuild_2_0_dirs) +net_4_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs) +net_4_5_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler +xbuild_12_SUBDIRS := $(xbuild_4_0_dirs) include ../build/rules.make -SUBDIRS = $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) $(net_3_5_only_dirs) $(mobile_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs) +SUBDIRS = $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_dirs) $(monotouch_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs) -DIST_ONLY_SUBDIRS = dlr aot-compiler +DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs) # No new makefiles for: System.Messaging, System.Web.Mobile, # System.ServiceProcess diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs index 404c0e2156..505a41a044 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs @@ -76,6 +76,7 @@ namespace System.Windows.Forms { internal bool whacky_wm; internal bool fixed_size; internal bool zombie; /* X11 only flag. true if the X windows have been destroyed but we haven't been Disposed */ + internal bool topmost; /* X11 only. */ internal Region user_clip; internal XEventQueue queue; internal WindowExStyles initial_ex_style; @@ -122,6 +123,7 @@ namespace System.Windows.Forms { children = new ArrayList (); resizing_or_moving = false; whacky_wm = false; + topmost = false; } public void Dispose() { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs index 8cad840c4e..8470f2987b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs @@ -173,6 +173,8 @@ namespace System.Windows.Forms this.MenuDroppedDown = false; base.Dismiss (reason); + + this.FireMenuDeactivate (); } internal void FireMenuActivate () diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs index 45f3ff801f..30c0d89f5f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs @@ -894,7 +894,7 @@ namespace System.Windows.Forms if (this is MenuStrip && mouse_currently_over is ToolStripMenuItem && !(mouse_currently_over as ToolStripMenuItem).HasDropDownItems) return; } else { - this.HideMenus (true, ToolStripDropDownCloseReason.AppClicked); + this.Dismiss (ToolStripDropDownCloseReason.AppClicked); } if (this is MenuStrip) @@ -1503,17 +1503,6 @@ namespace System.Windows.Forms this.GetTopLevelToolStrip ().Dismiss (ToolStripDropDownCloseReason.ItemClicked); } - internal void HideMenus (bool release, ToolStripDropDownCloseReason reason) - { - if (this is MenuStrip && release && menu_selected) - (this as MenuStrip).FireMenuDeactivate (); - - if (release) - menu_selected = false; - - NotifySelectedChanged (null); - } - internal void NotifySelectedChanged (ToolStripItem tsi) { foreach (ToolStripItem tsi2 in this.DisplayedItems) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs index da16b149ad..4df3397908 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs @@ -315,12 +315,9 @@ namespace System.Windows.Forms protected override void OnMouseUp (MouseEventArgs e) { if (this.close_on_mouse_release) { - this.DropDown.Dismiss (ToolStripDropDownCloseReason.ItemClicked); + this.Parent.Dismiss (ToolStripDropDownCloseReason.ItemClicked); this.Invalidate (); this.close_on_mouse_release = false; - - if (!this.IsOnDropDown && this.Parent is MenuStrip) - (this.Parent as MenuStrip).MenuDroppedDown = false; } if (!this.HasDropDownItems && Enabled) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index 9b6c13014a..be29661572 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -1619,11 +1619,23 @@ namespace System.Windows.Forms { if (hwnd.zombie) return; - if ((windows & WindowType.Whole) != 0) { - XMapWindow(DisplayHandle, hwnd.whole_window); - } - if ((windows & WindowType.Client) != 0) { - XMapWindow(DisplayHandle, hwnd.client_window); + if (hwnd.topmost) { + // Most window managers will respect the _NET_WM_STATE property. + // If not, use XMapRaised to map the window at the top level as + // a last ditch effort. + if ((windows & WindowType.Whole) != 0) { + XMapRaised(DisplayHandle, hwnd.whole_window); + } + if ((windows & WindowType.Client) != 0) { + XMapRaised(DisplayHandle, hwnd.client_window); + } + } else { + if ((windows & WindowType.Whole) != 0) { + XMapWindow(DisplayHandle, hwnd.whole_window); + } + if ((windows & WindowType.Client) != 0) { + XMapWindow(DisplayHandle, hwnd.client_window); + } } hwnd.mapped = true; @@ -2972,13 +2984,8 @@ namespace System.Windows.Forms { XSelectInput(DisplayHandle, hwnd.client_window, new IntPtr ((int)(SelectInputMask | EventMask.StructureNotifyMask | Keyboard.KeyEventMask))); } - if (ExStyleSet (cp.ExStyle, WindowExStyles.WS_EX_TOPMOST)) { - atoms = new int[2]; - atoms[0] = _NET_WM_WINDOW_TYPE_NORMAL.ToInt32(); - XChangeProperty(DisplayHandle, hwnd.whole_window, _NET_WM_WINDOW_TYPE, (IntPtr)Atom.XA_ATOM, 32, PropertyMode.Replace, atoms, 1); - - XSetTransientForHint (DisplayHandle, hwnd.whole_window, RootWindow); - } + if (ExStyleSet (cp.ExStyle, WindowExStyles.WS_EX_TOPMOST)) + SetTopmost(hwnd.whole_window, true); SetWMStyles(hwnd, cp); @@ -5787,6 +5794,7 @@ namespace System.Windows.Forms { { Hwnd hwnd = Hwnd.ObjectFromHandle(handle); + hwnd.topmost = enabled; if (enabled) { lock (XlibLock) { @@ -6405,6 +6413,13 @@ namespace System.Windows.Forms { DebugHelper.TraceWriteLine ("XMapWindow"); return _XMapWindow(display, window); } + [DllImport ("libX11", EntryPoint="XMapRaised")] + internal extern static int _XMapRaised(IntPtr display, IntPtr window); + internal static int XMapRaised(IntPtr display, IntPtr window) + { + DebugHelper.TraceWriteLine ("XMapRaised"); + return _XMapRaised(display, window); + } [DllImport ("libX11", EntryPoint="XUnmapWindow")] internal extern static int _XUnmapWindow(IntPtr display, IntPtr window); internal static int XUnmapWindow(IntPtr display, IntPtr window) @@ -7255,6 +7270,9 @@ namespace System.Windows.Forms { [DllImport ("libX11", EntryPoint="XMapWindow")] internal extern static int XMapWindow(IntPtr display, IntPtr window); + [DllImport ("libX11", EntryPoint="XMapRaised")] + internal extern static int XMapRaised(IntPtr display, IntPtr window); + [DllImport ("libX11", EntryPoint="XUnmapWindow")] internal extern static int XUnmapWindow(IntPtr display, IntPtr window); diff --git a/mcs/class/Microsoft.Build.Engine/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build.Engine/Assembly/AssemblyInfo.cs index 9c51bc96e5..52cbf31089 100644 --- a/mcs/class/Microsoft.Build.Engine/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build.Engine/Assembly/AssemblyInfo.cs @@ -44,9 +44,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany (Consts.MonoCompany)] [assembly: AssemblyProduct (Consts.MonoProduct)] [assembly: AssemblyCopyright (Consts.MonoCopyright)] -[assembly: AssemblyVersion (Consts.FxVersion)] -[assembly: SatelliteContractVersion (Consts.FxVersion)] -[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyVersion (XBuildConsts.AssemblyVersion)] +[assembly: SatelliteContractVersion (XBuildConsts.AssemblyVersion)] +[assembly: AssemblyInformationalVersion (XBuildConsts.FileVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -55,5 +55,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (XBuildConsts.FileVersion)] diff --git a/mcs/class/Microsoft.Build.Engine/Makefile b/mcs/class/Microsoft.Build.Engine/Makefile index 3bba6d6404..04f9e66dac 100644 --- a/mcs/class/Microsoft.Build.Engine/Makefile +++ b/mcs/class/Microsoft.Build.Engine/Makefile @@ -2,64 +2,38 @@ thisdir = class/Microsoft.Build.Engine SUBDIRS = include ../../build/rules.make -LIBRARY = Microsoft.Build.Engine.dll - -BUILD_FRAMEWORK = Microsoft.Build.Framework.dll +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make -ifeq (3.5, $(FRAMEWORK_VERSION)) -NAME_SUFFIX = .v3.5 -BUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/$(BUILD_FRAMEWORK) -else -ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) -NAME_SUFFIX = .v4.0 -endif -endif +LIBRARY = Microsoft.Build.Engine.dll LIB_MCS_FLAGS = \ - /r:$(corlib) \ - /r:System.dll \ - /r:System.Core.dll \ - /r:System.Xml.dll \ - /r:$(BUILD_FRAMEWORK) \ - /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll + /r:$(corlib) \ + /r:System.dll \ + /r:System.Core.dll \ + /r:System.Xml.dll \ + /r:$(XBUILD_FRAMEWORK) \ + /r:$(XBUILD_UTILITIES) TEST_MCS_FLAGS = \ - /r:$(BUILD_FRAMEWORK) \ - /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll \ + /r:$(XBUILD_FRAMEWORK) \ + /r:$(XBUILD_UTILITIES) \ /r:System.Xml.dll EXTRA_DISTFILES = \ Test/resources/TestTasks.cs \ Test/resources/*.*proj \ - Test/resources/*.csproj \ - Test/test-config-file* + Test/resources/*.csproj Test/resources/TestTasks.dll: Test/resources/TestTasks.cs - $(CSCOMPILE) Test/resources/TestTasks.cs /r:Microsoft.Build.Framework.dll /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll /target:library - -clean-local: clean-test-tasks + $(CSCOMPILE) Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library -clean-test-tasks: +clean-test-resources: rm -f Test/resources/TestTasks.dll -test-local: copy-config - -ifeq (net_4_0, $(PROFILE)) -copy-config: - cp Test/test-config-file-net-4.0 $(test_lib).config -else -ifeq (net_3_5, $(PROFILE)) -copy-config: - cp Test/test-config-file-net-3.5 $(test_lib).config -else -copy-config: -endif -endif - -export TESTING_MONO=a -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make - test-local: Test/resources/TestTasks.dll +clean-local: clean-test-resources + +include $(XBUILD_DIR)/xbuild_test.make include ../../build/library.make diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs index 8d67fec080..86f14a1a79 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs @@ -167,9 +167,7 @@ namespace Microsoft.Build.BuildEngine { { if (ReservedNameUtils.IsReservedMetadataName (metadataName)) { string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, evaluatedMetadata); - return string.Equals (metadataName, "fullpath", StringComparison.OrdinalIgnoreCase) - ? MSBuildUtils.Escape (metadata) - : metadata; + return MSBuildUtils.Unescape (metadata); } if (evaluatedMetadata.Contains (metadataName)) @@ -181,10 +179,7 @@ namespace Microsoft.Build.BuildEngine { public string GetMetadata (string metadataName) { if (ReservedNameUtils.IsReservedMetadataName (metadataName)) { - string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata); - return string.Equals (metadataName, "fullpath", StringComparison.OrdinalIgnoreCase) - ? MSBuildUtils.Escape (metadata) - : metadata; + return ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata); } else if (unevaluatedMetadata.Contains (metadataName)) return (string) unevaluatedMetadata [metadataName]; else @@ -269,9 +264,12 @@ namespace Microsoft.Build.BuildEngine { void AddMetadata (string name, string value) { + var options = IsDynamic ? + ParseOptions.AllowItemsMetadataAndSplit : ParseOptions.AllowItemsNoMetadataAndSplit; + if (parent_item_group != null) { Expression e = new Expression (); - e.Parse (value, ParseOptions.AllowItemsNoMetadataAndSplit); + e.Parse (value, options); evaluatedMetadata [name] = (string) e.ConvertTo (parent_item_group.ParentProject, typeof (string), ExpressionOptions.ExpandItemRefs); } else diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs index 006fe2b3fa..9c827f0953 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs @@ -30,6 +30,7 @@ using System; using System.Text; using System.Xml; +using System.Collections.Generic; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -241,6 +242,14 @@ namespace Microsoft.Build.BuildEngine { internal XmlElement XmlElement { get { return propertyElement; } } + + internal IEnumerable<string> GetAttributes () + { + if (!FromXml) + yield break; + foreach (XmlAttribute attr in propertyElement.Attributes) + yield return attr.Value; + } } internal enum PropertyType { diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs index fc6b02447c..9800c6883f 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs @@ -43,6 +43,7 @@ namespace Microsoft.Build.BuildEngine { List <BuildProperty> properties; Dictionary <string, BuildProperty> propertiesByName; bool evaluated; + bool isDynamic; public BuildPropertyGroup () : this (null, null, null, false) @@ -50,12 +51,18 @@ namespace Microsoft.Build.BuildEngine { } internal BuildPropertyGroup (XmlElement xmlElement, Project project, ImportedProject importedProject, bool readOnly) + : this (xmlElement, project, importedProject, readOnly, false) + { + } + + internal BuildPropertyGroup (XmlElement xmlElement, Project project, ImportedProject importedProject, bool readOnly, bool isDynamic) { this.importedProject = importedProject; this.parentCollection = null; this.parentProject = project; this.propertyGroup = xmlElement; this.read_only = readOnly; + this.isDynamic = isDynamic; if (FromXml) { this.properties = new List <BuildProperty> (); @@ -223,7 +230,7 @@ namespace Microsoft.Build.BuildEngine { internal void Evaluate () { - if (evaluated) + if (!isDynamic && evaluated) return; foreach (BuildProperty bp in properties) @@ -299,5 +306,16 @@ namespace Microsoft.Build.BuildEngine { internal XmlElement XmlElement { get { return propertyGroup; } } + + internal IEnumerable<string> GetAttributes () + { + foreach (XmlAttribute attrib in XmlElement.Attributes) + yield return attrib.Value; + + foreach (BuildProperty bp in properties) { + foreach (string attr in bp.GetAttributes ()) + yield return attr; + } + } } } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs index 4df2f780a9..b5482ae166 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs @@ -38,7 +38,7 @@ namespace Microsoft.Build.BuildEngine { } internal BuildTaskPropertyGroup (XmlElement element, Target target) - : base (element, target.Project, null, false) + : base (element, target.Project, null, false, true) { } @@ -48,10 +48,9 @@ namespace Microsoft.Build.BuildEngine { return true; } - public IEnumerable<string> GetAttributes () + IEnumerable<string> IBuildTask.GetAttributes () { - foreach (XmlAttribute attrib in XmlElement.Attributes) - yield return attrib.Value; + return GetAttributes (); } } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorResetter.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorResetter.cs index abe0ec9d8e..357f9d26ad 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorResetter.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorResetter.cs @@ -28,6 +28,11 @@ using System; -namespace Microsoft.Build.BuildEngine { +#if MICROSOFT_BUILD_DLL +namespace Microsoft.Build.Logging +#else +namespace Microsoft.Build.BuildEngine +#endif +{ public delegate void ColorResetter (); } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorSetter.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorSetter.cs index 85091186ea..d38f551e67 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorSetter.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorSetter.cs @@ -27,6 +27,11 @@ using System; -namespace Microsoft.Build.BuildEngine { +#if MICROSOFT_BUILD_DLL +namespace Microsoft.Build.Logging +#else +namespace Microsoft.Build.BuildEngine +#endif +{ public delegate void ColorSetter (ConsoleColor color); } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs index 709fedf1ce..bf61921902 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs @@ -109,6 +109,11 @@ namespace Microsoft.Build.BuildEngine { { if (token.Type == TokenType.Number) return true; + else if (token.Type == TokenType.String) { + var text = StringEvaluate (context); + Single number; + return Single.TryParse (text, out number); + } else return false; } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs index 2a62f4b388..5fb7d21899 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs @@ -35,33 +35,24 @@ using System.Security; using System.Text; using Microsoft.Build.Framework; -namespace Microsoft.Build.BuildEngine { +#if MICROSOFT_BUILD_DLL +namespace Microsoft.Build.Logging +#else +namespace Microsoft.Build.BuildEngine +#endif +{ public class ConsoleLogger : ILogger { string parameters; - int indent; LoggerVerbosity verbosity; WriteHandler writeHandler; - int errorCount; - int warningCount; - DateTime buildStart; - bool performanceSummary; - bool showSummary; bool skipProjectStartedText; - List<string> errors, warnings; - bool projectFailed; ConsoleColor errorColor, warningColor, eventColor, messageColor, highMessageColor; ColorSetter colorSet; ColorResetter colorReset; IEventSource eventSource; bool no_message_color, use_colors; - bool noItemAndPropertyList; - - List<BuildEvent> events; - Dictionary<string, List<string>> errorsTable; - Dictionary<string, List<string>> warningsTable; - SortedDictionary<string, PerfInfo> targetPerfTable, tasksPerfTable; - string current_events_string; + ConsoleLoggerParameter config = new ConsoleLoggerParameter (); public ConsoleLogger () : this (LoggerVerbosity.Normal, null, null, null) @@ -69,7 +60,7 @@ namespace Microsoft.Build.BuildEngine { } public ConsoleLogger (LoggerVerbosity verbosity) - : this (LoggerVerbosity.Normal, null, null, null) + : this (verbosity, null, null, null) { } @@ -79,27 +70,14 @@ namespace Microsoft.Build.BuildEngine { ColorResetter colorReset) { this.verbosity = verbosity; - this.indent = 0; - this.errorCount = 0; - this.warningCount = 0; if (write == null) this.writeHandler += new WriteHandler (WriteHandlerFunction); else this.writeHandler += write; - this.performanceSummary = false; - this.showSummary = true; this.skipProjectStartedText = false; - errors = new List<string> (); - warnings = new List<string> (); this.colorSet = colorSet; this.colorReset = colorReset; - events = new List<BuildEvent> (); - errorsTable = new Dictionary<string, List<string>> (); - warningsTable = new Dictionary<string, List<string>> (); - targetPerfTable = new SortedDictionary<string, PerfInfo> (); - tasksPerfTable = new SortedDictionary<string, PerfInfo> (); - //defaults errorColor = ConsoleColor.DarkRed; warningColor = ConsoleColor.DarkYellow; @@ -146,6 +124,11 @@ namespace Microsoft.Build.BuildEngine { } } } + + private void WriteHandlerFunction (string message) + { + Console.WriteLine (message); + } bool TryParseConsoleColor (string color_str, ref ConsoleColor color) { @@ -192,21 +175,32 @@ namespace Microsoft.Build.BuildEngine { } } + class ConsoleLoggerParameter + { + public ConsoleLoggerParameter () + { + ShowSummary = true; + } + public bool PerformanceSummary { get; set; } + public bool ShowSummary { get; set; } + public bool NoItemAndPropertyList { get; set; } + } + public void ApplyParameter (string parameterName, string parameterValue) { switch (parameterName) { case "PerformanceSummary": - this.performanceSummary = true; + config.PerformanceSummary = true; break; case "Summary": - this.showSummary = true; + config.ShowSummary = true; break; case "NoSummary": - this.showSummary = false; + config.ShowSummary = false; break; case "NoItemAndPropertyList": - this.noItemAndPropertyList = true; + config.NoItemAndPropertyList = true; break; default: if (parameterName.StartsWith ("Verbosity=")) @@ -282,375 +276,93 @@ namespace Microsoft.Build.BuildEngine { if (!String.IsNullOrEmpty (parameters)) ParseParameters (); } - - public void BuildStartedHandler (object sender, BuildStartedEventArgs args) + + Dictionary<object,BuildRecord> build_records = new Dictionary<object, BuildRecord> (); + + object dummy_key = new object (); + + BuildRecord GetBuildRecord (object sender) { - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { - WriteLine (String.Empty); - WriteLine (String.Format ("Build started {0}.", args.Timestamp)); - WriteLine ("__________________________________________________"); + BuildRecord r; + // FIXME: our Microsoft.Build.Engine shouldn't give different "sender" object for each event + // during the same build run. But it actually does. + // It is problematic for parallel build because it is impossible to determine right "ongoing build" + // record for the event without correct sender object. + // Hence we expect sender as a valid object only if it is IBuildEngine4 - + // only Microsoft.Build.Internal.BuildEngine4 implements it so far. + // (Used IBuildEngine3 because it needs to build for NET_4_0). +#if NET_4_0 + var key = sender as IBuildEngine3 ?? dummy_key; +#else + var key = dummy_key; +#endif + if (!build_records.TryGetValue (key, out r)) { + r = new BuildRecord (this); + build_records.Add (key, r); } - buildStart = args.Timestamp; + return r; + } - PushEvent (args); + public void BuildStartedHandler (object sender, BuildStartedEventArgs args) + { + GetBuildRecord (sender).BuildStartedHandler (sender, args); } public void BuildFinishedHandler (object sender, BuildFinishedEventArgs args) { - BuildFinishedHandlerActual (args); - - // Reset - events.Clear (); - errorsTable.Clear (); - warningsTable.Clear (); - targetPerfTable.Clear (); - tasksPerfTable.Clear (); - errors.Clear (); - warnings.Clear (); - - indent = 0; - errorCount = 0; - warningCount = 0; - projectFailed = false; + GetBuildRecord (sender).BuildFinishedHandler (args); + build_records.Remove (sender); } - - void BuildFinishedHandlerActual (BuildFinishedEventArgs args) + + void PushEvent<T> (object sender, T args) where T: BuildStatusEventArgs { - if (!IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { - PopEvent (args); - return; - } - - TimeSpan timeElapsed = args.Timestamp - buildStart; - if (performanceSummary || verbosity == LoggerVerbosity.Diagnostic) - DumpPerformanceSummary (); - - if (args.Succeeded == true && !projectFailed) { - WriteLine ("Build succeeded."); - } else { - WriteLine ("Build FAILED."); - } - if (warnings.Count > 0) { - WriteLine (Environment.NewLine + "Warnings:"); - SetColor (warningColor); - - WriteLine (String.Empty); - foreach (KeyValuePair<string, List<string>> pair in warningsTable) { - if (!String.IsNullOrEmpty (pair.Key)) - WriteLine (pair.Key); - - string indent_str = String.IsNullOrEmpty (pair.Key) ? String.Empty : "\t"; - foreach (string msg in pair.Value) - WriteLine (String.Format ("{0}{1}", indent_str, msg)); - - WriteLine (String.Empty); - } - - ResetColor (); - } - - if (errors.Count > 0) { - WriteLine ("Errors:"); - SetColor (errorColor); - - WriteLine (String.Empty); - foreach (KeyValuePair<string, List<string>> pair in errorsTable) { - if (!String.IsNullOrEmpty (pair.Key)) - WriteLine (pair.Key); - - string indent_str = String.IsNullOrEmpty (pair.Key) ? String.Empty : "\t"; - foreach (string msg in pair.Value) - WriteLine (String.Format ("{0}{1}", indent_str, msg)); - - WriteLine (String.Empty); - } - ResetColor (); - } - - if (showSummary == true){ - WriteLine (String.Format ("\t {0} Warning(s)", warningCount)); - WriteLine (String.Format ("\t {0} Error(s)", errorCount)); - WriteLine (String.Empty); - WriteLine (String.Format ("Time Elapsed {0}", timeElapsed)); - } - - PopEvent (args); + GetBuildRecord (sender).PushEvent (sender, args); + } + void PopEvent<T> (object sender, T args) where T: BuildStatusEventArgs + { + GetBuildRecord (sender).PopEvent (args); } - public void ProjectStartedHandler (object sender, ProjectStartedEventArgs args) { - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { - SetColor (eventColor); - WriteLine (String.Format ("Project \"{0}\" ({1} target(s)):", args.ProjectFile, - String.IsNullOrEmpty (args.TargetNames) ? "default" : args.TargetNames)); - ResetColor (); - DumpProperties (args.Properties); - DumpItems (args.Items); - } + GetBuildRecord (sender).ProjectStartedHandler (args); } - public void ProjectFinishedHandler (object sender, ProjectFinishedEventArgs args) { - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { - if (indent == 1) - indent --; - SetColor (eventColor); - WriteLine (String.Format ("Done building project \"{0}\".{1}", args.ProjectFile, - args.Succeeded ? String.Empty : "-- FAILED")); - ResetColor (); - WriteLine (String.Empty); - } - if (!projectFailed) - // no project has failed yet, so update the flag - projectFailed = !args.Succeeded; - } - + GetBuildRecord (sender).ProjectFinishedHandler (args); + } public void TargetStartedHandler (object sender, TargetStartedEventArgs args) { - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { - indent++; - SetColor (eventColor); - WriteLine (String.Empty); - WriteLine (String.Format ("Target {0}:",args.TargetName)); - ResetColor (); - } + GetBuildRecord (sender).TargetStartedHandler (args); } - public void TargetFinishedHandler (object sender, TargetFinishedEventArgs args) { - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed) || - (!args.Succeeded && IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal))) { - SetColor (eventColor); - WriteLine (String.Format ("Done building target \"{0}\" in project \"{1}\".{2}", - args.TargetName, args.ProjectFile, - args.Succeeded ? String.Empty : "-- FAILED")); - ResetColor (); - WriteLine (String.Empty); - } - indent--; + GetBuildRecord (sender).TargetFinishedHandler (args); } - public void TaskStartedHandler (object sender, TaskStartedEventArgs args) { - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed)) { - SetColor (eventColor); - WriteLine (String.Format ("Task \"{0}\"",args.TaskName)); - ResetColor (); - } - indent++; + GetBuildRecord (sender).TaskStartedHandler (args); } - public void TaskFinishedHandler (object sender, TaskFinishedEventArgs args) { - indent--; - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed) || - (!args.Succeeded && IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal))) { - SetColor (eventColor); - if (args.Succeeded) - WriteLine (String.Format ("Done executing task \"{0}\"", args.TaskName)); - else - WriteLine (String.Format ("Task \"{0}\" execution -- FAILED", args.TaskName)); - ResetColor (); - } + GetBuildRecord (sender).TaskFinishedHandler (args); } - public void MessageHandler (object sender, BuildMessageEventArgs args) { - if (IsMessageOk (args)) { - if (no_message_color) { - ExecutePendingEventHandlers (); - WriteLine (args.Message); - } else { - ExecutePendingEventHandlers (); - SetColor (args.Importance == MessageImportance.High ? highMessageColor : messageColor); - WriteLine (args.Message); - ResetColor (); - } - } + GetBuildRecord (sender).MessageHandler (args); } - public void WarningHandler (object sender, BuildWarningEventArgs args) { - string msg = FormatWarningEvent (args); - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Quiet)) { - ExecutePendingEventHandlers (); - SetColor (warningColor); - WriteLineWithoutIndent (msg); - ResetColor (); - } - warnings.Add (msg); - - List<string> list = null; - if (!warningsTable.TryGetValue (EventsAsString, out list)) - warningsTable [EventsAsString] = list = new List<string> (); - list.Add (msg); - - warningCount++; + GetBuildRecord (sender).WarningHandler (args); } - public void ErrorHandler (object sender, BuildErrorEventArgs args) { - string msg = FormatErrorEvent (args); - if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Quiet)) { - ExecutePendingEventHandlers (); - SetColor (errorColor); - WriteLineWithoutIndent (msg); - ResetColor (); - } - errors.Add (msg); - - List<string> list = null; - if (!errorsTable.TryGetValue (EventsAsString, out list)) - errorsTable [EventsAsString] = list = new List<string> (); - list.Add (msg); - errorCount++; + GetBuildRecord (sender).ErrorHandler (args); } [MonoTODO] public void CustomEventHandler (object sender, CustomBuildEventArgs args) { - } - - private void WriteLine (string message) - { - if (indent > 0) { - StringBuilder sb = new StringBuilder (); - for (int i = 0; i < indent; i++) - sb.Append ('\t'); - - string indent_str = sb.ToString (); - - foreach (string line in message.Split (new string[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)) - writeHandler (indent_str + line); - } else { - writeHandler (message); - } - } - - void PushEvent<T> (object sender, T args) where T: BuildStatusEventArgs - { - PushEvent (args); - } - - void PushEvent<T> (T args) where T: BuildStatusEventArgs - { - BuildEvent be = new BuildEvent { - EventArgs = args, - StartHandlerHasExecuted = false, - ConsoleLogger = this - }; - - events.Add (be); - current_events_string = null; - } - - void PopEvent<T> (object sender, T finished_args) where T: BuildStatusEventArgs - { - PopEvent (finished_args); - } - - void PopEvent<T> (T finished_args) where T: BuildStatusEventArgs - { - if (events.Count == 0) - throw new InvalidOperationException ("INTERNAL ERROR: Trying to pop from an empty events stack"); - - BuildEvent be = events [events.Count - 1]; - if (performanceSummary || verbosity == LoggerVerbosity.Diagnostic) { - var args = be.EventArgs; - TargetStartedEventArgs tgt_args = args as TargetStartedEventArgs; - if (tgt_args != null) { - AddPerfInfo (tgt_args.TargetName, args.Timestamp, targetPerfTable); - } else { - TaskStartedEventArgs tsk_args = args as TaskStartedEventArgs; - if (tsk_args != null) - AddPerfInfo (tsk_args.TaskName, args.Timestamp, tasksPerfTable); - } - } - - be.ExecuteFinishedHandler (finished_args); - events.RemoveAt (events.Count - 1); - current_events_string = null; - } - - void ExecutePendingEventHandlers () - { - foreach (var be in events) - be.ExecuteStartedHandler (); - } - - string EventsToString () - { - StringBuilder sb = new StringBuilder (); - - string last_imported_target_file = String.Empty; - for (int i = 0; i < events.Count; i ++) { - var args = events [i].EventArgs; - ProjectStartedEventArgs pargs = args as ProjectStartedEventArgs; - if (pargs != null) { - sb.AppendFormat ("{0} ({1}) ->\n", pargs.ProjectFile, - String.IsNullOrEmpty (pargs.TargetNames) ? - "default targets" : - pargs.TargetNames); - last_imported_target_file = String.Empty; - continue; - } - - TargetStartedEventArgs targs = args as TargetStartedEventArgs; - if (targs != null) { - if (targs.TargetFile != targs.ProjectFile && targs.TargetFile != last_imported_target_file) - // target from an imported file, - // and it hasn't been mentioned as yet - sb.AppendFormat ("{0} ", targs.TargetFile); - - last_imported_target_file = targs.TargetFile; - sb.AppendFormat ("({0} target) ->\n", targs.TargetName); - } - } - - return sb.ToString (); - } - - void AddPerfInfo (string name, DateTime start, IDictionary<string, PerfInfo> perf_table) - { - PerfInfo pi; - if (!perf_table.TryGetValue (name, out pi)) { - pi = new PerfInfo (); - perf_table [name] = pi; - } - - pi.Time += DateTime.Now - start; - pi.NumberOfCalls ++; - } - - void DumpPerformanceSummary () - { - SetColor (eventColor); - WriteLine ("Target perfomance summary:"); - ResetColor (); - - foreach (var pi in targetPerfTable.OrderBy (pair => pair.Value.Time)) - WriteLine (String.Format ("{0,10:0.000} ms {1,-50} {2,5} calls", pi.Value.Time.TotalMilliseconds, pi.Key, pi.Value.NumberOfCalls)); - - WriteLine (String.Empty); - - SetColor (eventColor); - WriteLine ("Tasks perfomance summary:"); - ResetColor (); - - foreach (var pi in tasksPerfTable.OrderBy (pair => pair.Value.Time)) - WriteLine (String.Format ("{0,10:0.000} ms {1,-50} {2,5} calls", pi.Value.Time.TotalMilliseconds, pi.Key, pi.Value.NumberOfCalls)); - - WriteLine (String.Empty); - } - - private void WriteLineWithoutIndent (string message) - { - writeHandler (message); - } - - private void WriteHandlerFunction (string message) - { - Console.WriteLine (message); + build_records [sender].CustomHandler (args); } void SetColor (ConsoleColor color) @@ -694,131 +406,6 @@ namespace Microsoft.Build.BuildEngine { eventSource.ErrorRaised -= ErrorHandler; } - static bool InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t"; - - private string FormatErrorEvent (BuildErrorEventArgs args) - { - // For some reason we get an 1-char empty string as Subcategory somtimes. - string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " "; - string subcat = subprefix == "" ? "" : args.Subcategory; - - if (args.LineNumber != 0){ - if (args.ColumnNumber != 0 && !InEmacs) - return String.Format ("{0}({1},{2}): {3}{4}error {5}: {6}", - args.File, args.LineNumber, args.ColumnNumber, - subprefix, subcat, args.Code, args.Message); - - return String.Format ("{0}({1}): {2}{3}error {4}: {5}", - args.File, args.LineNumber, - subprefix, subcat, args.Code, args.Message); - } else { - return String.Format ("{0}: {1}{2}error {3}: {4}", args.File, subprefix, subcat, args.Code, - args.Message); - } - } - - private string FormatWarningEvent (BuildWarningEventArgs args) - { - // For some reason we get an 1-char empty string as Subcategory somtimes. - string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " "; - string subcat = subprefix == "" ? "" : args.Subcategory; - - // FIXME: show more complicated args - if (args.LineNumber != 0){ - - if (args.ColumnNumber != 0 && !InEmacs) { - return String.Format ("{0}({1},{2}): {3}{4}warning {5}: {6}", - args.File, args.LineNumber, args.ColumnNumber, - subprefix, subcat, args.Code, args.Message); - } - return String.Format ("{0}({1}): {2}{3}warning {4}: {5}", - args.File, args.LineNumber, - subprefix, subcat, args.Code, args.Message); - } else { - return String.Format ("{0}: {1} warning {2}: {3}", args.File, args.Subcategory, args.Code, - args.Message); - } - } - - private bool IsMessageOk (BuildMessageEventArgs bsea) - { - if (bsea.Importance == MessageImportance.High && IsVerbosityGreaterOrEqual (LoggerVerbosity.Minimal)) { - return true; - } else if (bsea.Importance == MessageImportance.Normal && IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { - return true; - } else if (bsea.Importance == MessageImportance.Low && IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed)) { - return true; - } else - return false; - } - - private bool IsVerbosityGreaterOrEqual (LoggerVerbosity v) - { - if (v == LoggerVerbosity.Diagnostic) { - return LoggerVerbosity.Diagnostic <= verbosity; - } else if (v == LoggerVerbosity.Detailed) { - return LoggerVerbosity.Detailed <= verbosity; - } else if (v == LoggerVerbosity.Normal) { - return LoggerVerbosity.Normal <= verbosity; - } else if (v == LoggerVerbosity.Minimal) { - return LoggerVerbosity.Minimal <= verbosity; - } else if (v == LoggerVerbosity.Quiet) { - return true; - } else - return false; - } - - void DumpProperties (IEnumerable properties) - { - if (noItemAndPropertyList || !IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic)) - return; - - SetColor (eventColor); - WriteLine (String.Empty); - WriteLine ("Initial Properties:"); - ResetColor (); - - if (properties == null) - return; - - var dict = new SortedDictionary<string, string> (); - foreach (DictionaryEntry de in properties) - dict [(string)de.Key] = (string)de.Value; - - foreach (KeyValuePair<string, string> pair in dict) - WriteLine (String.Format ("{0} = {1}", pair.Key, pair.Value)); - } - - void DumpItems (IEnumerable items) - { - if (noItemAndPropertyList || !IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic) || items == null) - return; - - SetColor (eventColor); - WriteLine (String.Empty); - WriteLine ("Initial Items:"); - ResetColor (); - if (items == null) - return; - - var items_table = new SortedDictionary<string, List<ITaskItem>> (); - foreach (DictionaryEntry de in items) { - string key = (string)de.Key; - if (!items_table.ContainsKey (key)) - items_table [key] = new List<ITaskItem> (); - - items_table [key].Add ((ITaskItem) de.Value); - } - - foreach (string name in items_table.Keys) { - WriteLine (name); - indent ++; - foreach (ITaskItem item in items_table [name]) - WriteLine (item.ItemSpec); - indent--; - } - } - public string Parameters { get { return parameters; @@ -827,20 +414,13 @@ namespace Microsoft.Build.BuildEngine { if (value == null) throw new ArgumentNullException (); parameters = value; - } - } - - string EventsAsString { - get { - if (current_events_string == null) - current_events_string = EventsToString (); - return current_events_string; + ParseParameters (); } } public bool ShowSummary { - get { return showSummary; } - set { showSummary = value; } + get { return config.ShowSummary; } + set { config.ShowSummary = value; } } public bool SkipProjectStartedText { @@ -857,9 +437,561 @@ namespace Microsoft.Build.BuildEngine { get { return writeHandler; } set { writeHandler = value; } } + + class BuildRecord + { + readonly ConsoleLogger parent; + + readonly List<BuildEvent> events; + readonly Dictionary<string, List<string>> errorsTable; + readonly Dictionary<string, List<string>> warningsTable; + readonly SortedDictionary<string, PerfInfo> targetPerfTable, tasksPerfTable; + List<string> errors, warnings; + int indent; + int errorCount; + int warningCount; + bool projectFailed; + DateTime buildStart; + + string current_events_string; + + ConsoleColor eventColor { + get { return parent.eventColor; } + } + LoggerVerbosity verbosity { + get { return parent.Verbosity; } + } + + public BuildRecord (ConsoleLogger parent) + { + this.parent = parent; + + this.indent = 0; + this.errorCount = 0; + this.warningCount = 0; + errors = new List<string> (); + warnings = new List<string> (); + events = new List<BuildEvent> (); + errorsTable = new Dictionary<string, List<string>> (); + warningsTable = new Dictionary<string, List<string>> (); + targetPerfTable = new SortedDictionary<string, PerfInfo> (); + tasksPerfTable = new SortedDictionary<string, PerfInfo> (); + } + + internal void PushEvent<T> (object sender, T args) where T: BuildStatusEventArgs + { + BuildEvent be = new BuildEvent { + Sender = sender, + EventArgs = args, + StartHandlerHasExecuted = false, + ConsoleLogger = this.parent + }; + + events.Add (be); + current_events_string = null; + } + + void PopEvent<T> (object sender, T finished_args) where T: BuildStatusEventArgs + { + PopEvent (finished_args); + } + + internal void PopEvent<T> (T finished_args) where T: BuildStatusEventArgs + { + if (events.Count == 0) + throw new InvalidOperationException ("INTERNAL ERROR: Trying to pop from an empty events stack"); + + BuildEvent be = events [events.Count - 1]; + if (parent.config.PerformanceSummary || verbosity == LoggerVerbosity.Diagnostic) { + var args = be.EventArgs; + TargetStartedEventArgs tgt_args = args as TargetStartedEventArgs; + if (tgt_args != null) { + AddPerfInfo (tgt_args.TargetName, args.Timestamp, targetPerfTable); + } else { + TaskStartedEventArgs tsk_args = args as TaskStartedEventArgs; + if (tsk_args != null) + AddPerfInfo (tsk_args.TaskName, args.Timestamp, tasksPerfTable); + } + } + + be.ExecuteFinishedHandler (finished_args); + events.RemoveAt (events.Count - 1); + current_events_string = null; + } + + public void ResetBuildState () + { + // Reset + events.Clear (); + errorsTable.Clear (); + warningsTable.Clear (); + targetPerfTable.Clear (); + tasksPerfTable.Clear (); + errors.Clear (); + warnings.Clear (); + + indent = 0; + errorCount = 0; + warningCount = 0; + projectFailed = false; + } + + void AddPerfInfo (string name, DateTime start, IDictionary<string, PerfInfo> perf_table) + { + PerfInfo pi; + if (!perf_table.TryGetValue (name, out pi)) { + pi = new PerfInfo (); + perf_table [name] = pi; + } + + pi.Time += DateTime.Now - start; + pi.NumberOfCalls ++; + } + + public void BuildStartedHandler (object sender, BuildStartedEventArgs args) + { + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { + WriteLine (String.Empty); + WriteLine (String.Format ("Build started {0}.", args.Timestamp)); + WriteLine ("__________________________________________________"); + } + buildStart = args.Timestamp; + + PushEvent (sender, args); + } + + public void BuildFinishedHandler (BuildFinishedEventArgs args) + { + BuildFinishedHandlerActual (args); + + ResetBuildState (); + } + + void BuildFinishedHandlerActual (BuildFinishedEventArgs args) + { + if (!IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { + PopEvent (args); + return; + } + + TimeSpan timeElapsed = args.Timestamp - buildStart; + if (parent.config.PerformanceSummary || verbosity == LoggerVerbosity.Diagnostic) + DumpPerformanceSummary (); + + if (args.Succeeded == true && !projectFailed) { + WriteLine ("Build succeeded."); + } else { + WriteLine ("Build FAILED."); + } + if (warnings.Count > 0) { + WriteLine (Environment.NewLine + "Warnings:"); + SetColor (parent.warningColor); + + WriteLine (String.Empty); + foreach (KeyValuePair<string, List<string>> pair in warningsTable) { + if (!String.IsNullOrEmpty (pair.Key)) + WriteLine (pair.Key); + + string indent_str = String.IsNullOrEmpty (pair.Key) ? String.Empty : "\t"; + foreach (string msg in pair.Value) + WriteLine (String.Format ("{0}{1}", indent_str, msg)); + + WriteLine (String.Empty); + } + + ResetColor (); + } + + if (errors.Count > 0) { + WriteLine ("Errors:"); + SetColor (parent.errorColor); + + WriteLine (String.Empty); + foreach (KeyValuePair<string, List<string>> pair in errorsTable) { + if (!String.IsNullOrEmpty (pair.Key)) + WriteLine (pair.Key); + + string indent_str = String.IsNullOrEmpty (pair.Key) ? String.Empty : "\t"; + foreach (string msg in pair.Value) + WriteLine (String.Format ("{0}{1}", indent_str, msg)); + + WriteLine (String.Empty); + } + ResetColor (); + } + + if (parent.ShowSummary == true){ + WriteLine (String.Format ("\t {0} Warning(s)", warningCount)); + WriteLine (String.Format ("\t {0} Error(s)", errorCount)); + WriteLine (String.Empty); + WriteLine (String.Format ("Time Elapsed {0}", timeElapsed)); + } + + PopEvent (args); + } + + public void ProjectStartedHandler (ProjectStartedEventArgs args) + { + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { + SetColor (eventColor); + WriteLine (String.Format ("Project \"{0}\" ({1} target(s)):", args.ProjectFile, + String.IsNullOrEmpty (args.TargetNames) ? "default" : args.TargetNames)); + ResetColor (); + DumpProperties (args.Properties); + DumpItems (args.Items); + } + } + + public void ProjectFinishedHandler (ProjectFinishedEventArgs args) + { + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { + if (indent == 1) + indent --; + SetColor (eventColor); + WriteLine (String.Format ("Done building project \"{0}\".{1}", args.ProjectFile, + args.Succeeded ? String.Empty : "-- FAILED")); + ResetColor (); + WriteLine (String.Empty); + } + if (!projectFailed) + // no project has failed yet, so update the flag + projectFailed = !args.Succeeded; + } + + public void TargetStartedHandler (TargetStartedEventArgs args) + { + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { + indent++; + SetColor (eventColor); + WriteLine (String.Empty); + WriteLine (String.Format ("Target {0}:",args.TargetName)); + ResetColor (); + } + } + + public void TargetFinishedHandler (TargetFinishedEventArgs args) + { + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed) || + (!args.Succeeded && IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal))) { + SetColor (eventColor); + WriteLine (String.Format ("Done building target \"{0}\" in project \"{1}\".{2}", + args.TargetName, args.ProjectFile, + args.Succeeded ? String.Empty : "-- FAILED")); + ResetColor (); + WriteLine (String.Empty); + } + indent--; + } + + public void TaskStartedHandler (TaskStartedEventArgs args) + { + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed)) { + SetColor (eventColor); + WriteLine (String.Format ("Task \"{0}\"",args.TaskName)); + ResetColor (); + } + indent++; + } + + public void TaskFinishedHandler (TaskFinishedEventArgs args) + { + indent--; + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed) || + (!args.Succeeded && IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal))) { + SetColor (eventColor); + if (args.Succeeded) + WriteLine (String.Format ("Done executing task \"{0}\"", args.TaskName)); + else + WriteLine (String.Format ("Task \"{0}\" execution -- FAILED", args.TaskName)); + ResetColor (); + } + } + + public void MessageHandler (BuildMessageEventArgs args) + { + if (IsMessageOk (args)) { + if (parent.no_message_color) { + ExecutePendingEventHandlers (); + WriteLine (args.Message); + } else { + ExecutePendingEventHandlers (); + SetColor (args.Importance == MessageImportance.High ? parent.highMessageColor : parent.messageColor); + WriteLine (args.Message); + ResetColor (); + } + } + } + + public void WarningHandler (BuildWarningEventArgs args) + { + string msg = FormatWarningEvent (args); + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Quiet)) { + ExecutePendingEventHandlers (); + SetColor (parent.warningColor); + WriteLineWithoutIndent (msg); + ResetColor (); + } + warnings.Add (msg); + + List<string> list = null; + if (!warningsTable.TryGetValue (EventsAsString, out list)) + warningsTable [EventsAsString] = list = new List<string> (); + list.Add (msg); + + warningCount++; + } + + public void ErrorHandler (BuildErrorEventArgs args) + { + string msg = FormatErrorEvent (args); + if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Quiet)) { + ExecutePendingEventHandlers (); + SetColor (parent.errorColor); + WriteLineWithoutIndent (msg); + ResetColor (); + } + errors.Add (msg); + + List<string> list = null; + if (!errorsTable.TryGetValue (EventsAsString, out list)) + errorsTable [EventsAsString] = list = new List<string> (); + list.Add (msg); + errorCount++; + } + + public void CustomHandler (CustomBuildEventArgs args) + { + } + + private bool IsVerbosityGreaterOrEqual (LoggerVerbosity v) + { + if (v == LoggerVerbosity.Diagnostic) { + return LoggerVerbosity.Diagnostic <= verbosity; + } else if (v == LoggerVerbosity.Detailed) { + return LoggerVerbosity.Detailed <= verbosity; + } else if (v == LoggerVerbosity.Normal) { + return LoggerVerbosity.Normal <= verbosity; + } else if (v == LoggerVerbosity.Minimal) { + return LoggerVerbosity.Minimal <= verbosity; + } else if (v == LoggerVerbosity.Quiet) { + return true; + } else + return false; + } + + void DumpItems (IEnumerable items) + { + if (parent.config.NoItemAndPropertyList || !IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic) || items == null) + return; + + SetColor (eventColor); + WriteLine (String.Empty); + WriteLine ("Initial Items:"); + ResetColor (); + if (items == null) + return; + + var items_table = new SortedDictionary<string, List<ITaskItem>> (); + foreach (DictionaryEntry de in items) { + string key = (string)de.Key; + if (!items_table.ContainsKey (key)) + items_table [key] = new List<ITaskItem> (); + + items_table [key].Add ((ITaskItem) de.Value); + } + + foreach (string name in items_table.Keys) { + WriteLine (name); + indent ++; + foreach (ITaskItem item in items_table [name]) + WriteLine (item.ItemSpec); + indent--; + } + } + + string EventsAsString { + get { + if (current_events_string == null) + current_events_string = EventsToString (); + return current_events_string; + } + } + + private bool IsMessageOk (BuildMessageEventArgs bsea) + { + if (bsea.Importance == MessageImportance.High && IsVerbosityGreaterOrEqual (LoggerVerbosity.Minimal)) { + return true; + } else if (bsea.Importance == MessageImportance.Normal && IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) { + return true; + } else if (bsea.Importance == MessageImportance.Low && IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed)) { + return true; + } else + return false; + } + + void DumpProperties (IEnumerable properties) + { + if (parent.config.NoItemAndPropertyList || !IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic)) + return; + + SetColor (eventColor); + WriteLine (String.Empty); + WriteLine ("Initial Properties:"); + ResetColor (); + + if (properties == null) + return; + + var dict = new SortedDictionary<string, string> (); + foreach (DictionaryEntry de in properties) + dict [(string)de.Key] = (string)de.Value; + + foreach (KeyValuePair<string, string> pair in dict) + WriteLine (String.Format ("{0} = {1}", pair.Key, pair.Value)); + } + + private void WriteLine (string message) + { + if (indent > 0) { + StringBuilder sb = new StringBuilder (); + for (int i = 0; i < indent; i++) + sb.Append ('\t'); + + string indent_str = sb.ToString (); + + foreach (string line in message.Split (new string[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)) + parent.writeHandler (indent_str + line); + } else { + parent.writeHandler (message); + } + } + + void ExecutePendingEventHandlers () + { + foreach (var be in events) + be.ExecuteStartedHandler (); + } + + string EventsToString () + { + StringBuilder sb = new StringBuilder (); + + string last_imported_target_file = String.Empty; + for (int i = 0; i < events.Count; i ++) { + var args = events [i].EventArgs; + ProjectStartedEventArgs pargs = args as ProjectStartedEventArgs; + if (pargs != null) { + sb.AppendFormat ("{0} ({1}) ->\n", pargs.ProjectFile, + String.IsNullOrEmpty (pargs.TargetNames) ? + "default targets" : + pargs.TargetNames); + last_imported_target_file = String.Empty; + continue; + } + + TargetStartedEventArgs targs = args as TargetStartedEventArgs; + if (targs != null) { + if (targs.TargetFile != targs.ProjectFile && targs.TargetFile != last_imported_target_file) + // target from an imported file, + // and it hasn't been mentioned as yet + sb.AppendFormat ("{0} ", targs.TargetFile); + + last_imported_target_file = targs.TargetFile; + sb.AppendFormat ("({0} target) ->\n", targs.TargetName); + } + } + + return sb.ToString (); + } + + void DumpPerformanceSummary () + { + SetColor (eventColor); + WriteLine ("Target perfomance summary:"); + ResetColor (); + + foreach (var pi in targetPerfTable.OrderBy (pair => pair.Value.Time)) + WriteLine (String.Format ("{0,10:0.000} ms {1,-50} {2,5} calls", pi.Value.Time.TotalMilliseconds, pi.Key, pi.Value.NumberOfCalls)); + + WriteLine (String.Empty); + + SetColor (eventColor); + WriteLine ("Tasks perfomance summary:"); + ResetColor (); + + foreach (var pi in tasksPerfTable.OrderBy (pair => pair.Value.Time)) + WriteLine (String.Format ("{0,10:0.000} ms {1,-50} {2,5} calls", pi.Value.Time.TotalMilliseconds, pi.Key, pi.Value.NumberOfCalls)); + + WriteLine (String.Empty); + } + + private string FormatErrorEvent (BuildErrorEventArgs args) + { + // For some reason we get an 1-char empty string as Subcategory somtimes. + string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " "; + string subcat = subprefix == "" ? "" : args.Subcategory; + + if (args.LineNumber != 0){ + if (args.ColumnNumber != 0 && !InEmacs) + return String.Format ("{0}({1},{2}): {3}{4}error {5}: {6}", + args.File, args.LineNumber, args.ColumnNumber, + subprefix, subcat, args.Code, args.Message); + + return String.Format ("{0}({1}): {2}{3}error {4}: {5}", + args.File, args.LineNumber, + subprefix, subcat, args.Code, args.Message); + } else { + return String.Format ("{0}: {1}{2}error {3}: {4}", args.File, subprefix, subcat, args.Code, + args.Message); + } + } + + static bool InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t"; + + private string FormatWarningEvent (BuildWarningEventArgs args) + { + // For some reason we get an 1-char empty string as Subcategory somtimes. + string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " "; + string subcat = subprefix == "" ? "" : args.Subcategory; + + // FIXME: show more complicated args + if (args.LineNumber != 0){ + + if (args.ColumnNumber != 0 && !InEmacs) { + return String.Format ("{0}({1},{2}): {3}{4}warning {5}: {6}", + args.File, args.LineNumber, args.ColumnNumber, + subprefix, subcat, args.Code, args.Message); + } + return String.Format ("{0}({1}): {2}{3}warning {4}: {5}", + args.File, args.LineNumber, + subprefix, subcat, args.Code, args.Message); + } else { + return String.Format ("{0}: {1} warning {2}: {3}", args.File, args.Subcategory, args.Code, + args.Message); + } + } + + void SetColor (ConsoleColor color) + { + if (parent.use_colors) + parent.colorSet (color); + } + + void ResetColor () + { + if (parent.use_colors) + parent.colorReset (); + } + + private void WriteLineWithoutIndent (string message) + { + parent.writeHandler (message); + } + } } class BuildEvent { + public object Sender; public BuildStatusEventArgs EventArgs; public bool StartHandlerHasExecuted; public ConsoleLogger ConsoleLogger; @@ -870,11 +1002,11 @@ namespace Microsoft.Build.BuildEngine { return; if (EventArgs is ProjectStartedEventArgs) - ConsoleLogger.ProjectStartedHandler (null, (ProjectStartedEventArgs)EventArgs); + ConsoleLogger.ProjectStartedHandler (Sender, (ProjectStartedEventArgs)EventArgs); else if (EventArgs is TargetStartedEventArgs) - ConsoleLogger.TargetStartedHandler (null, (TargetStartedEventArgs)EventArgs); + ConsoleLogger.TargetStartedHandler (Sender, (TargetStartedEventArgs)EventArgs); else if (EventArgs is TaskStartedEventArgs) - ConsoleLogger.TaskStartedHandler (null, (TaskStartedEventArgs)EventArgs); + ConsoleLogger.TaskStartedHandler (Sender, (TaskStartedEventArgs)EventArgs); else if (!(EventArgs is BuildStartedEventArgs)) throw new InvalidOperationException ("Unexpected event on the stack, type: " + EventArgs.GetType ()); @@ -887,11 +1019,11 @@ namespace Microsoft.Build.BuildEngine { return; if (EventArgs is ProjectStartedEventArgs) - ConsoleLogger.ProjectFinishedHandler (null, finished_args as ProjectFinishedEventArgs); + ConsoleLogger.ProjectFinishedHandler (Sender, finished_args as ProjectFinishedEventArgs); else if (EventArgs is TargetStartedEventArgs) - ConsoleLogger.TargetFinishedHandler (null, finished_args as TargetFinishedEventArgs); + ConsoleLogger.TargetFinishedHandler (Sender, finished_args as TargetFinishedEventArgs); else if (EventArgs is TaskStartedEventArgs) - ConsoleLogger.TaskFinishedHandler (null, finished_args as TaskFinishedEventArgs); + ConsoleLogger.TaskFinishedHandler (Sender, finished_args as TaskFinishedEventArgs); else if (!(EventArgs is BuildStartedEventArgs)) throw new InvalidOperationException ("Unexpected event on the stack, type: " + EventArgs.GetType ()); } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs index 624bd71ac7..4636d27250 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs @@ -96,14 +96,17 @@ namespace Microsoft.Build.BuildEngine { return; int offset = 0; + string full_path; if (Path.IsPathRooted (name)) { + full_path = name; baseDirectory = new DirectoryInfo (Path.GetPathRoot (name)); if (IsRunningOnWindows) // skip the "drive:" offset = 1; + } else { + full_path = Path.GetFullPath (Path.Combine (Environment.CurrentDirectory, name)); } - string full_path = Path.GetFullPath (Path.Combine (Environment.CurrentDirectory, include_item.ItemSpec)); fileInfo = ParseIncludeExclude (separatedPath, offset, baseDirectory); int wildcard_offset = full_path.IndexOf ("**"); diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs index 51b9f4588a..cbb5fd6d05 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs @@ -118,6 +118,9 @@ namespace Microsoft.Build.BuildEngine { Toolsets.Add (new Toolset ("4.0", ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40))); #endif +#if XBUILD_12 + Toolsets.Add (new Toolset ("12.0", ToolLocationHelper.GetPathToBuildTools ("12.0"))); +#endif } [MonoTODO] diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/FileLogger.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/FileLogger.cs index 9e0f90703a..3a970f3013 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/FileLogger.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/FileLogger.cs @@ -32,7 +32,12 @@ using System.IO; using System.Text; using Microsoft.Build.Framework; -namespace Microsoft.Build.BuildEngine { +#if MICROSOFT_BUILD_DLL +namespace Microsoft.Build.Logging +#else +namespace Microsoft.Build.BuildEngine +#endif +{ public class FileLogger : ConsoleLogger { StreamWriter sw; string logfile; diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs index 653f4a80b2..351aea0208 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs @@ -159,12 +159,23 @@ namespace Microsoft.Build.BuildEngine { else base_dir_info = new DirectoryInfo (Directory.GetCurrentDirectory ()); - IEnumerable<string> extn_paths = has_extn_ref ? GetExtensionPaths (project) : new string [] {null}; + var importPaths = GetImportPathsFromString (project_attribute, project, base_dir_info); + var extensionPaths = GetExtensionPaths (project); + + if (!has_extn_ref) { + foreach (var importPath in importPaths) { + foreach (var extensionPath in extensionPaths) { + has_extn_ref = has_extn_ref || importPath.IndexOf (extensionPath) >= 0; + } + } + } + + IEnumerable<string> extn_paths = has_extn_ref ? extensionPaths : new string [] { null }; bool import_needed = false; var currentLoadSettings = project.ProjectLoadSettings; - + try { - foreach (var settings in new ProjectLoadSettings [] { ProjectLoadSettings.None, currentLoadSettings}) { + foreach (var settings in new ProjectLoadSettings [] { ProjectLoadSettings.None, currentLoadSettings }) { foreach (string path in extn_paths) { string extn_msg = null; if (has_extn_ref) { @@ -183,7 +194,7 @@ namespace Microsoft.Build.BuildEngine { // We stop if atleast one file got imported. // Remaining extension paths are *not* tried bool atleast_one = false; - foreach (string importPath in GetImportPathsFromString (project_attribute, project, base_dir_info)) { + foreach (string importPath in importPaths) { try { if (func (importPath, extn_msg)) atleast_one = true; diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs index 5b6d2553c8..c22b8c749c 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs @@ -38,6 +38,7 @@ using System.Text; using System.Xml; using System.Xml.Schema; using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; using Mono.XBuild.Framework; using Mono.XBuild.CommandLine; @@ -937,6 +938,9 @@ namespace Microsoft.Build.BuildEngine { case "Import": AddImport (xe, ip, true); break; + case "ImportGroup": + AddImportGroup (xe, ip, true); + break; case "ItemGroup": AddItemGroup (xe, ip); break; @@ -947,7 +951,7 @@ namespace Microsoft.Build.BuildEngine { AddChoose (xe, ip); break; default: - throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file.", xe.Name)); + throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file '{1}'.", xe.Name, ip.FullFileName)); } } } @@ -1029,7 +1033,17 @@ namespace Microsoft.Build.BuildEngine { SetExtensionsPathProperties (DefaultExtensionsPath); evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved)); evaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment)); +#if XBUILD_12 + // see http://msdn.microsoft.com/en-us/library/vstudio/hh162058(v=vs.120).aspx + if (effective_tools_version == "12.0") { + evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath32", toolsPath, PropertyType.Reserved)); + + var frameworkToolsPath = ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version451); + evaluatedProperties.AddProperty (new BuildProperty ("MSBuildFrameworkToolsPath", frameworkToolsPath, PropertyType.Reserved)); + evaluatedProperties.AddProperty (new BuildProperty ("MSBuildFrameworkToolsPath32", frameworkToolsPath, PropertyType.Reserved)); + } +#endif // FIXME: make some internal method that will work like GetDirectoryName but output String.Empty on null/String.Empty string projectDir; if (FullFileName == String.Empty) @@ -1104,9 +1118,10 @@ namespace Microsoft.Build.BuildEngine { void AddImport (XmlElement xmlElement, ImportedProject importingProject, bool evaluate_properties) { // eval all the properties etc till the import - if (evaluate_properties) + if (evaluate_properties) { groupingCollection.Evaluate (EvaluationType.Property); - + groupingCollection.Evaluate (EvaluationType.Choose); + } try { PushThisFileProperty (importingProject != null ? importingProject.FullFileName : FullFileName); @@ -1121,6 +1136,30 @@ namespace Microsoft.Build.BuildEngine { } } + void AddImportGroup (XmlElement xmlElement, ImportedProject importedProject, bool evaluate_properties) + { + // eval all the properties etc till the import group + if (evaluate_properties) { + groupingCollection.Evaluate (EvaluationType.Property); + groupingCollection.Evaluate (EvaluationType.Choose); + } + string condition_attribute = xmlElement.GetAttribute ("Condition"); + if (!ConditionParser.ParseAndEvaluate (condition_attribute, this)) + return; + foreach (XmlNode xn in xmlElement.ChildNodes) { + if (xn is XmlElement) { + XmlElement xe = (XmlElement) xn; + switch (xe.Name) { + case "Import": + AddImport (xe, importedProject, evaluate_properties); + break; + default: + throw new InvalidProjectFileException(String.Format("Invalid element '{0}' inside ImportGroup in project file '{1}'.", xe.Name, importedProject.FullFileName)); + } + } + } + } + bool AddSingleImport (XmlElement xmlElement, string projectPath, ImportedProject importingProject, string from_source_msg) { Import import = new Import (xmlElement, projectPath, this, importingProject); diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs index 250c7942bd..630cb4a46e 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs @@ -128,15 +128,23 @@ namespace Microsoft.Build.BuildEngine { internal bool Build (string built_targets_key) { bool executeOnErrors; - return Build (built_targets_key, out executeOnErrors); + return Build (built_targets_key, null, out executeOnErrors); } - bool Build (string built_targets_key, out bool executeOnErrors) + bool Build (string built_targets_key, string parentTarget, out bool executeOnErrors) { + string message; + if (parentTarget != null) + message = string.Format ("\"{0}\" in project \"{1}\" (\"{2}\"); \"{3}\" depends on it", Name, project.FullFileName, TargetFile, parentTarget); + else + message = string.Format ("\"{0}\" in project \"{1}\" (\"{2}\")", Name, project.FullFileName, TargetFile); + project.PushThisFileProperty (TargetFile); try { + LogMessage (MessageImportance.Low, "Building target {0}.", message); return BuildActual (built_targets_key, out executeOnErrors); } finally { + LogMessage (MessageImportance.Low, "Done building target {0}.", message); project.PopThisFileProperty (); } } @@ -256,7 +264,7 @@ namespace Microsoft.Build.BuildEngine { } if (t.BuildState == BuildState.NotStarted) - if (!t.Build (null, out executeOnErrors)) + if (!t.Build (null, Name, out executeOnErrors)) return false; if (t.BuildState == BuildState.Started) @@ -403,9 +411,12 @@ namespace Microsoft.Build.BuildEngine { ITaskItem [] OutputsAsITaskItems { get { - string outputs = targetElement.GetAttribute ("Outputs"); - if (outputs == String.Empty) - return new ITaskItem [0]; + var outputs = targetElement.GetAttribute ("Returns"); + if (string.IsNullOrEmpty (outputs)) { + outputs = targetElement.GetAttribute ("Outputs"); + if (string.IsNullOrEmpty (outputs)) + return new ITaskItem [0]; + } Expression e = new Expression (); e.Parse (outputs, ParseOptions.AllowItemsNoMetadataAndSplit); diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs index 5db46fcbfb..895bbeebf7 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs @@ -37,7 +37,7 @@ namespace Microsoft.Build.BuildEngine ToolsPath = toolsPath; BuildProperties = buildProperties; } - + public Toolset (string toolsVersion, string toolsPath) : this (toolsVersion, toolsPath, null) { diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/WriteHandler.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/WriteHandler.cs index d60bd5be68..a7575519ca 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/WriteHandler.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/WriteHandler.cs @@ -25,6 +25,11 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -namespace Microsoft.Build.BuildEngine { +#if MICROSOFT_BUILD_DLL +namespace Microsoft.Build.Logging +#else +namespace Microsoft.Build.BuildEngine +#endif +{ public delegate void WriteHandler (string message); } diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources index 9081b936b5..3a9d701993 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources @@ -1,5 +1,6 @@ ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs +../../tools/xbuild/XBuildConsts.cs Assembly/AssemblyInfo.cs ../Microsoft.Build.Framework/Mono.XBuild.Framework/AssemblyLoadInfo.cs ../Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs index e580d358ed..918c3ff8ae 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs @@ -285,6 +285,40 @@ namespace MonoTests.Microsoft.Build.BuildEngine { } [Test] + public void GetMetadata_UnescapedItemSpec () + { + string itemInclude = "a;b;c"; + string escapedItemInclude = Utilities.Escape (itemInclude); + + item = new BuildItem ("name", itemInclude); + Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a"); + Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b"); + + Assert.AreEqual (itemInclude, item.GetMetadata ("FileName"), "#2b"); + Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b"); + + Assert.AreEqual (itemInclude, item.GetMetadata ("Identity"), "#3a"); + Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("Identity"), "#3b"); + } + + [Test] + public void GetMetadata_EscapedItemSpec () + { + string itemInclude = "a;b;c"; + string escapedItemInclude = Utilities.Escape (itemInclude); + + item = new BuildItem ("name", escapedItemInclude); + Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a"); + Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b"); + + Assert.AreEqual (escapedItemInclude, item.GetMetadata ("FileName"), "#2b"); + Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b"); + + Assert.AreEqual (escapedItemInclude, item.GetMetadata ("Identity"), "#3a"); + Assert.AreEqual ("a;b;c", item.GetEvaluatedMetadata ("Identity"), "#3b"); + } + + [Test] [ExpectedException (typeof (ArgumentNullException))] public void TestGetMetadata2 () { diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs index 31a160850a..8db3be70a9 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs @@ -38,16 +38,42 @@ public static class Consts { public static string BinPath { get { - if (RunningOnMono ()) - return "../../tools/xbuild/xbuild"; - else + if (RunningOnMono ()) { +#if XBUILD_12 + string profile = "xbuild_12"; +#elif NET_4_5 + string profile = "net_4_5"; +#elif NET_4_0 + string profile = "net_4_0"; +#elif NET_3_5 + string profile = "net_3_5"; +#else + string profile = "net_2_0"; +#endif + var corlib = typeof (object).Assembly.Location; + var lib = Path.GetDirectoryName (Path.GetDirectoryName (corlib)); + return Path.Combine (lib, profile); + } else { +#if XBUILD_12 + return ToolLocationHelper.GetPathToBuildTools ("12.0"); +#elif NET_4_5 + return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version45); +#elif NET_4_0 + return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40); +#elif NET_3_5 + return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35); +#else return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20); +#endif + } } } public static string ToolsVersionString { get { -#if NET_4_0 +#if XBUILD_12 + return " ToolsVersion='12.0'"; +#elif NET_4_0 return " ToolsVersion='4.0'"; #elif NET_3_5 return " ToolsVersion='3.5'"; @@ -59,12 +85,14 @@ public static class Consts { public static string GetTasksAsmPath () { -#if NET_4_0 - return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40), "Microsoft.Build.Tasks.v4.0.dll"); +#if XBUILD_12 + return Path.Combine (BinPath, "Microsoft.Build.Tasks.v12.0.dll"); +#elif NET_4_0 + return Path.Combine (BinPath, "Microsoft.Build.Tasks.v4.0.dll"); #elif NET_3_5 - return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35), "Microsoft.Build.Tasks.v3.5.dll"); + return Path.Combine (BinPath, "Microsoft.Build.Tasks.v3.5.dll"); #else - return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), "Microsoft.Build.Tasks.dll"); + return Path.Combine (BinPath, "Microsoft.Build.Tasks.dll"); #endif } } diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs index 2cced758f0..738cd2a258 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs @@ -403,6 +403,11 @@ namespace MonoTests.Microsoft.Build.BuildEngine { void ItemGroupInsideTarget (string xml, params string[] messages) { + ItemGroupInsideTarget (xml, 1, messages); + } + + void ItemGroupInsideTarget (string xml, int expectedTargetCount, params string[] messages) + { var logger = CreateLogger (xml); try @@ -411,9 +416,10 @@ namespace MonoTests.Microsoft.Build.BuildEngine { for (int i = 0; i < messages.Length; i++) logger.CheckLoggedMessageHead (messages [i], i.ToString ()); Assert.AreEqual(0, logger.NormalMessageCount, "Extra messages found"); + Assert.AreEqual(0, logger.WarningMessageCount, "Extra warningmessages found"); - Assert.AreEqual(1, logger.TargetStarted, "TargetStarted count"); - Assert.AreEqual(1, logger.TargetFinished, "TargetFinished count"); + Assert.AreEqual(expectedTargetCount, logger.TargetStarted, "TargetStarted count"); + Assert.AreEqual(expectedTargetCount, logger.TargetFinished, "TargetFinished count"); Assert.AreEqual(messages.Length, logger.TaskStarted, "TaskStarted count"); Assert.AreEqual(messages.Length, logger.TaskFinished, "TaskFinished count"); } @@ -727,6 +733,59 @@ namespace MonoTests.Microsoft.Build.BuildEngine { </Target> </Project>", "Sun", "Rain"); } + + [Test] + public void PropertyGroupInsideTarget_Condition () + { + ItemGroupInsideTarget ( + @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0""> + <ItemGroup> + <Shells Include=""/bin/sh;/bin/bash;/bin/false"" /> + </ItemGroup> + + <Target Name='Main'> + <PropertyGroup> + <HasBash Condition=""'%(Shells.Filename)' == 'bash'"">true</HasBash> + </PropertyGroup> + + <ItemGroup Condition=""'$(HasBash)' == 'true'""> + <Weather Include='Rain' /> + </ItemGroup> + <Message Text='%(Weather.Identity)' /> + </Target> + </Project>", "Rain"); + } + + [Test] + // Bug #14661 + public void ItemGroupInsideTarget_Expression_in_Metadata () + { + ItemGroupInsideTarget ( + @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0""> + <ItemGroup> + <Foo Include='output1'> + <Inputs>input1a;input1b</Inputs> + </Foo> + <Foo Include='output2'> + <Inputs>input2a;input2b</Inputs> + </Foo> + </ItemGroup> + + <Target Name='Main' DependsOnTargets='_PrepareItems' Inputs='@(_Foo)' Outputs='%(Result)'> + <Message Text='COMPILE: @(_Foo) - %(_Foo.Result)' /> + </Target> + + <Target Name='_PrepareItems'> + <ItemGroup> + <_Foo Include='%(Foo.Inputs)'> + <Result>%(Foo.Identity)</Result> + </_Foo> + </ItemGroup> + </Target> + </Project>", + 3, "COMPILE: input1a;input1b - output1", "COMPILE: input2a;input2b - output2"); + } + #endif [Test] @@ -905,5 +964,26 @@ namespace MonoTests.Microsoft.Build.BuildEngine { } #endif + [Test] + public void TestTargetReturns () + { + engine = new Engine (Consts.BinPath); + project = engine.CreateNewProject (); + project.Load (Path.Combine ("Test", Path.Combine ("resources", "TestReturns.csproj"))); + + var logger = new TestMessageLogger (); + engine.RegisterLogger (logger); + + bool result = project.Build ("Main"); + if (!result) { + logger.DumpMessages (); + Assert.Fail ("Build failed"); + } + + logger.CheckLoggedMessageHead ("Result: Bar", "A1"); + + Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found"); + } + } } diff --git a/mcs/class/Microsoft.Build.Engine/Test/resources/TestReturns.csproj b/mcs/class/Microsoft.Build.Engine/Test/resources/TestReturns.csproj new file mode 100644 index 0000000000..a71ea5db7e --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/resources/TestReturns.csproj @@ -0,0 +1,13 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> + + <Target Name="GetFoo" Outputs="Out" Returns="Bar" /> + + <Target Name="Main"> + <MSBuild Projects="TestReturns.csproj" Targets="GetFoo"> + <Output TaskParameter="TargetOutputs" ItemName="FooResult"/> + </MSBuild> + + <Message Text="Result: %(FooResult.Identity)" /> + </Target> + +</Project> diff --git a/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-3.5 b/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-3.5 deleted file mode 100644 index 7756bca8df..0000000000 --- a/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-3.5 +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version ="1.0"?> -<configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> - <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> - <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/> - </dependentAssembly> - </assemblyBinding> - </runtime> -</configuration> diff --git a/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-4.0 b/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-4.0 deleted file mode 100644 index 3c78f3b4ec..0000000000 --- a/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-4.0 +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version ="1.0"?> -<configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> - <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> - <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/> - </dependentAssembly> - </assemblyBinding> - </runtime> -</configuration> diff --git a/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs index 1c7777bfa7..2110fd0668 100644 --- a/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs @@ -44,9 +44,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany (Consts.MonoCompany)] [assembly: AssemblyProduct (Consts.MonoProduct)] [assembly: AssemblyCopyright (Consts.MonoCopyright)] -[assembly: AssemblyVersion (Consts.FxVersion)] -[assembly: SatelliteContractVersion (Consts.FxVersion)] -[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyVersion (XBuildConsts.AssemblyVersion)] +[assembly: SatelliteContractVersion (XBuildConsts.AssemblyVersion)] +[assembly: AssemblyInformationalVersion (XBuildConsts.FileVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -56,5 +56,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (XBuildConsts.FileVersion)] diff --git a/mcs/class/Microsoft.Build.Framework/Makefile b/mcs/class/Microsoft.Build.Framework/Makefile index 0cb68bfac6..73f43fb74c 100644 --- a/mcs/class/Microsoft.Build.Framework/Makefile +++ b/mcs/class/Microsoft.Build.Framework/Makefile @@ -2,24 +2,17 @@ thisdir = class/Microsoft.Build.Framework SUBDIRS = include ../../build/rules.make -LIBRARY = Microsoft.Build.Framework.dll +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make -ifeq (1.0, $(FRAMEWORK_VERSION)) -LIBRARY_NAME = dummy-Microsoft.Build.Framework.dll -NO_INSTALL = yes -NO_TEST = yes -NO_SIGN_ASSEMBLY = yes -endif +LIBRARY = Microsoft.Build.Framework.dll LIB_MCS_FLAGS = \ /r:$(corlib) \ /r:System.dll -include ../../build/library.make - -export TESTING_MONO=a -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make - EXTRA_DISTFILES = \ Mono.XBuild.Framework/AssemblyLoadInfo.cs + +include ../../build/library.make +include $(XBUILD_DIR)/xbuild_test.make diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources index 3b83e2da7b..bb3c1d6d07 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources @@ -1,10 +1,13 @@ ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs +../../tools/xbuild/XBuildConsts.cs Assembly/AssemblyInfo.cs Microsoft.Build.Framework/AnyEventHandler.cs +Microsoft.Build.Framework/BuildEngineResult.cs Microsoft.Build.Framework/BuildErrorEventArgs.cs Microsoft.Build.Framework/BuildErrorEventHandler.cs Microsoft.Build.Framework/BuildEventArgs.cs +Microsoft.Build.Framework/BuildEventContext.cs Microsoft.Build.Framework/BuildFinishedEventArgs.cs Microsoft.Build.Framework/BuildFinishedEventHandler.cs Microsoft.Build.Framework/BuildMessageEventArgs.cs @@ -21,14 +24,21 @@ Microsoft.Build.Framework/ExternalProjectFinishedEventArgs.cs Microsoft.Build.Framework/ExternalProjectStartedEventArgs.cs Microsoft.Build.Framework/IBuildEngine.cs Microsoft.Build.Framework/IBuildEngine2.cs +Microsoft.Build.Framework/IBuildEngine3.cs +Microsoft.Build.Framework/IBuildEngine4.cs Microsoft.Build.Framework/ICancelableTask.cs +Microsoft.Build.Framework/IEventRedirector.cs Microsoft.Build.Framework/IEventSource.cs +Microsoft.Build.Framework/IForwardingLogger.cs Microsoft.Build.Framework/ILogger.cs Microsoft.Build.Framework/INodeLogger.cs Microsoft.Build.Framework/ITask.cs +Microsoft.Build.Framework/ITaskFactory.cs +Microsoft.Build.Framework/ITaskFactory2.cs Microsoft.Build.Framework/ITaskHost.cs Microsoft.Build.Framework/ITaskItem.cs Microsoft.Build.Framework/ITaskItem2.cs +Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs Microsoft.Build.Framework/LoadInSeparateAppDomainAttribute.cs Microsoft.Build.Framework/LoggerException.cs Microsoft.Build.Framework/LoggerVerbosity.cs @@ -38,6 +48,7 @@ Microsoft.Build.Framework/ProjectFinishedEventArgs.cs Microsoft.Build.Framework/ProjectFinishedEventHandler.cs Microsoft.Build.Framework/ProjectStartedEventArgs.cs Microsoft.Build.Framework/ProjectStartedEventHandler.cs +Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs Microsoft.Build.Framework/RequiredAttribute.cs Microsoft.Build.Framework/TargetFinishedEventArgs.cs Microsoft.Build.Framework/TargetFinishedEventHandler.cs @@ -46,5 +57,7 @@ Microsoft.Build.Framework/TargetStartedEventHandler.cs Microsoft.Build.Framework/TaskCommandLineEventArgs.cs Microsoft.Build.Framework/TaskFinishedEventArgs.cs Microsoft.Build.Framework/TaskFinishedEventHandler.cs +Microsoft.Build.Framework/TaskPropertyInfo.cs Microsoft.Build.Framework/TaskStartedEventArgs.cs Microsoft.Build.Framework/TaskStartedEventHandler.cs + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEngineResult.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEngineResult.cs new file mode 100644 index 0000000000..05b65f1bb4 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEngineResult.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + [SerializableAttribute] + public struct BuildEngineResult + { + public BuildEngineResult (bool result, List<IDictionary<string, ITaskItem[]>> targetOutputsPerProject) + { + this.result = result; + this.outputs = targetOutputsPerProject; + } + + readonly bool result; + public bool Result { + get { return result; } + } + + readonly IList<IDictionary<string, ITaskItem[]>> outputs; + public IList<IDictionary<string, ITaskItem[]>> TargetOutputsPerProject { + get { return outputs; } + } + } +} diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs index 60be917bf4..fd2c709dd0 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs @@ -41,7 +41,8 @@ namespace Microsoft.Build.Framework string senderName; int threadId; DateTime timestamp; - + BuildEventContext context; + protected BuildEventArgs () : this (null, null, null) { @@ -49,12 +50,19 @@ namespace Microsoft.Build.Framework protected BuildEventArgs (string message, string helpKeyword, string senderName) + : this (message, helpKeyword, senderName, DateTime.Now) + { + } + + protected BuildEventArgs (string message, string helpKeyword, + string senderName, DateTime eventTimestamp) { this.message = message; this.helpKeyword = helpKeyword; this.senderName = senderName; this.threadId = Thread.CurrentThread.GetHashCode (); - this.timestamp = DateTime.Now; + this.timestamp = eventTimestamp; + this.context = BuildEventContext.NewInstance (); } public string HelpKeyword { @@ -87,7 +95,16 @@ namespace Microsoft.Build.Framework return timestamp; } } + + public BuildEventContext BuildEventContext { + get { return context; } + set { + if (value == null) + throw new ArgumentNullException ("value"); + context = value; + } + } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs new file mode 100644 index 0000000000..2a550f46dc --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs @@ -0,0 +1,94 @@ +using System; + + +namespace Microsoft.Build.Framework +{ + [Serializable] + public class BuildEventContext + { + static readonly Random rnd = new Random (); + + public static BuildEventContext Invalid = new BuildEventContext ( + InvalidSubmissionId, + InvalidNodeId, + InvalidProjectInstanceId, + InvalidTargetId, + InvalidProjectContextId, + InvalidTaskId); + + internal static BuildEventContext NewInstance () + { + return new BuildEventContext (rnd.Next (), rnd.Next (), rnd.Next (), rnd.Next ()); + } + + public BuildEventContext (int nodeId, int targetId, int projectContextId, int taskId) + : this (nodeId, rnd.Next (), targetId, projectContextId, taskId) + { + } + + public BuildEventContext (int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId) + : this (rnd.Next (), nodeId, projectInstanceId, targetId, projectContextId, taskId) + { + } + + public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId) + { + SubmissionId = submissionId; + NodeId = nodeId; + ProjectInstanceId = projectInstanceId; + TargetId = targetId; + ProjectContextId = projectContextId; + TaskId = taskId; + } + + public const int InvalidSubmissionId = -1; + public const int InvalidNodeId = -2; + public const int InvalidProjectInstanceId = -1; + public const int InvalidTargetId = -1; + public const int InvalidProjectContextId = -2; + public const int InvalidTaskId = -1; + + public int SubmissionId { get; private set; } + public int NodeId { get; private set; } + public int ProjectInstanceId { get; private set; } + public int TargetId { get; private set; } + public int ProjectContextId { get; private set; } + public int TaskId { get; private set; } + + // MSDN document says "true if the references are equal, false otherwise." but that doesn't make sense. + public override bool Equals (object other) + { + var o = other as BuildEventContext; + return (object) o != null && + o.NodeId == NodeId && + o.ProjectContextId == ProjectContextId && + o.ProjectInstanceId == ProjectInstanceId && + o.SubmissionId == SubmissionId && + o.TargetId == TargetId && + o.TaskId == TaskId; + } + + public override int GetHashCode () + { + return + (NodeId << 5) + + (ProjectContextId << 4) + + (ProjectInstanceId << 3) + + (SubmissionId << 2) + + (TargetId << 1) + + TaskId; + } + + public static bool operator == (BuildEventContext left, BuildEventContext right) + { + return (object) left == null ? (object)right == null : left.Equals (right); + } + + public static bool operator != (BuildEventContext left, BuildEventContext right) + { + return (object) left == null ? (object)right != null : !left.Equals (right); + } + } +} + + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs index 6397a9e0d1..6595f05f0d 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs @@ -43,7 +43,25 @@ namespace Microsoft.Build.Framework { public BuildFinishedEventArgs (string message, string helpKeyword, bool succeeded) - : base (message, helpKeyword, null) + : this (message, helpKeyword, succeeded, DateTime.Now) + { + } + + public BuildFinishedEventArgs (string message, + string helpKeyword, + bool succeeded, + DateTime eventTimestamp) + : base (message, helpKeyword, null, eventTimestamp) + { + this.succeeded = succeeded; + } + + public BuildFinishedEventArgs (string message, + string helpKeyword, + bool succeeded, + DateTime eventTimestamp, + params object [] messageArgs) + : base (message, helpKeyword, null, eventTimestamp, messageArgs) { this.succeeded = succeeded; } @@ -56,4 +74,4 @@ namespace Microsoft.Build.Framework { } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs index 8a48d844cc..54b0303b30 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs @@ -29,6 +29,7 @@ #if NET_2_0 using System; +using System.Collections.Generic; namespace Microsoft.Build.Framework { [Serializable] @@ -40,10 +41,34 @@ namespace Microsoft.Build.Framework { public BuildStartedEventArgs (string message, string helpKeyword) + : this (message, helpKeyword, DateTime.Now) + { + } + + public BuildStartedEventArgs (string message, + string helpKeyword, + IDictionary<string, string> environmentOfBuild) : base (message, helpKeyword, null) { + // deal with environmentOfBuild + throw new NotImplementedException (); + } + + public BuildStartedEventArgs (string message, + string helpKeyword, + DateTime eventTimestamp) + : base (message, helpKeyword, null, eventTimestamp) + { + } + + public BuildStartedEventArgs (string message, + string helpKeyword, + DateTime eventTimestamp, + params object [] messageArgs) + : base (message, helpKeyword, null, eventTimestamp, messageArgs) + { } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs index e3bf6c235d..cad96026ff 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs @@ -33,7 +33,7 @@ using System; namespace Microsoft.Build.Framework { [Serializable] - public abstract class BuildStatusEventArgs : BuildEventArgs { + public abstract class BuildStatusEventArgs : LazyFormattedBuildEventArgs { protected BuildStatusEventArgs () { @@ -45,7 +45,24 @@ namespace Microsoft.Build.Framework : base (message, helpKeyword, senderName) { } + + protected BuildStatusEventArgs (string message, + string helpKeyword, + string senderName, + DateTime eventTimestamp) + : base (message, helpKeyword, senderName, eventTimestamp) + { + } + + protected BuildStatusEventArgs (string message, + string helpKeyword, + string senderName, + DateTime eventTimestamp, + params object [] messageArgs) + : base (message, helpKeyword, senderName, eventTimestamp, messageArgs) + { + } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine3.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine3.cs new file mode 100644 index 0000000000..b4ce06a39e --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine3.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + [MonoTODO] + public interface IBuildEngine3 : IBuildEngine2 + { + BuildEngineResult BuildProjectFilesInParallel ( + string[] projectFileNames, + string[] targetNames, + IDictionary[] globalProperties, + IList<string>[] removeGlobalProperties, + string[] toolsVersion, + bool returnTargetOutputs + ); + void Reacquire (); + void Yield (); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine4.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine4.cs new file mode 100644 index 0000000000..c2c16b4501 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine4.cs @@ -0,0 +1,15 @@ +#if NET_4_5 +using System; + +namespace Microsoft.Build.Framework +{ + [MonoTODO] + public interface IBuildEngine4 : IBuildEngine3 + { + object GetRegisteredTaskObject (object key, RegisteredTaskObjectLifetime lifetime); + void RegisterTaskObject (object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection); + object UnregisterTaskObject (object key, RegisteredTaskObjectLifetime lifetime); + } +} + +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IEventRedirector.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IEventRedirector.cs new file mode 100644 index 0000000000..3078c209d1 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IEventRedirector.cs @@ -0,0 +1,10 @@ +using System; + +namespace Microsoft.Build.Framework +{ + public interface IEventRedirector + { + void ForwardEvent (BuildEventArgs buildEvent); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IForwardingLogger.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IForwardingLogger.cs new file mode 100644 index 0000000000..4b08961e0f --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IForwardingLogger.cs @@ -0,0 +1,15 @@ +using System; + +#if NET_4_0 + +namespace Microsoft.Build.Framework +{ + public interface IForwardingLogger : INodeLogger, ILogger + { + IEventRedirector BuildEventRedirector { get; set; } + int NodeId { get; set; } + } +} + +#endif + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory.cs new file mode 100644 index 0000000000..0d6820b8dc --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + public interface ITaskFactory + { + string FactoryName { get; } + Type TaskType { get; } + void CleanupTask (ITask task); + ITask CreateTask (IBuildEngine taskFactoryLoggingHost); + TaskPropertyInfo [] GetTaskParameters (); + bool Initialize (string taskName, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory2.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory2.cs new file mode 100644 index 0000000000..9b53560ec7 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory2.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + public interface ITaskFactory2 : ITaskFactory + { + ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary<string, string> taskIdentityParameters); + bool Initialize (string taskName, IDictionary<string, string> factoryIdentityParameters, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs new file mode 100644 index 0000000000..398578430f --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs @@ -0,0 +1,55 @@ +// +// LazyFormattedBuildEventArgs.cs +// +// Author: +// Atsushi Enomoto <atsushi@xamarin.com> +// +// (C) 2013 Xamarin Inc. +// +// 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. + +using System; +using System.Threading; + +namespace Microsoft.Build.Framework +{ + [Serializable] + public abstract class LazyFormattedBuildEventArgs : BuildEventArgs + { + + protected LazyFormattedBuildEventArgs () + : this (null, null, null) + { + } + + protected LazyFormattedBuildEventArgs (string message, string helpKeyword, + string senderName) + : this (message, helpKeyword, senderName, DateTime.Now) + { + } + + protected LazyFormattedBuildEventArgs (string message, string helpKeyword, + string senderName, DateTime eventTimestamp, + params object [] messageArgs) + : base (string.Format (message, messageArgs), helpKeyword, senderName, eventTimestamp) + { + } + } +} diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs new file mode 100644 index 0000000000..121107824c --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs @@ -0,0 +1,11 @@ +#if NET_4_5 +namespace Microsoft.Build.Framework +{ + public enum RegisteredTaskObjectLifetime + { + AppDomain, + Build + } +} +#endif + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/TaskPropertyInfo.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/TaskPropertyInfo.cs new file mode 100644 index 0000000000..a6fbfaaf63 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/TaskPropertyInfo.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + [Serializable] + public class TaskPropertyInfo + { + public TaskPropertyInfo (string name, Type typeOfParameter, bool output, bool required) + { + Name = name; + PropertyType = typeOfParameter; + Output = output; + Required = required; + } + + public string Name { get; private set; } + public bool Output { get; private set; } + public Type PropertyType { get; private set; } + public bool Required { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources index 45374e536e..b7c639277a 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources @@ -1,5 +1,6 @@ Microsoft.Build.Framework/BuildErrorEventArgsTest.cs Microsoft.Build.Framework/BuildEventArgsTest.cs +Microsoft.Build.Framework/BuildEventContextTest.cs Microsoft.Build.Framework/BuildFinishedEventArgsTest.cs Microsoft.Build.Framework/BuildMessageEventArgsTest.cs Microsoft.Build.Framework/BuildStartedEventArgsTest.cs diff --git a/mcs/class/Microsoft.Build.Framework/Test/Microsoft.Build.Framework/BuildEventContextTest.cs b/mcs/class/Microsoft.Build.Framework/Test/Microsoft.Build.Framework/BuildEventContextTest.cs new file mode 100644 index 0000000000..ea8ff11abd --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Test/Microsoft.Build.Framework/BuildEventContextTest.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.Build.Framework; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Framework +{ + [TestFixture] + public class BuildEventContextTest + { + [Test] + public void Compare () + { + Assert.IsTrue (BuildEventContext.Invalid == BuildEventContext.Invalid, "#1"); + Assert.IsFalse (BuildEventContext.Invalid != BuildEventContext.Invalid, "#2"); + var inst = new BuildEventContext (0, 0, 0, 0); + Assert.IsFalse (BuildEventContext.Invalid == inst, "#3"); + Assert.IsTrue (BuildEventContext.Invalid != inst, "#4"); + Assert.IsFalse (BuildEventContext.Invalid == null, "#5"); + Assert.IsTrue (BuildEventContext.Invalid != null, "#6"); + Assert.IsFalse (BuildEventContext.Invalid.Equals (null), "#7"); + Assert.IsFalse (BuildEventContext.Invalid.Equals (inst), "#8"); + Assert.IsTrue (BuildEventContext.Invalid.Equals (BuildEventContext.Invalid), "#9"); + Assert.IsFalse (inst.Equals (null), "#10"); + Assert.IsTrue (inst.Equals (inst), "#11"); + Assert.IsFalse (inst.Equals (BuildEventContext.Invalid), "#12"); + } + } +} + diff --git a/mcs/class/Microsoft.Build.Tasks/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build.Tasks/Assembly/AssemblyInfo.cs index 25dc0b7ec1..172f71e95b 100644 --- a/mcs/class/Microsoft.Build.Tasks/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build.Tasks/Assembly/AssemblyInfo.cs @@ -44,9 +44,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany (Consts.MonoCompany)] [assembly: AssemblyProduct (Consts.MonoProduct)] [assembly: AssemblyCopyright (Consts.MonoCopyright)] -[assembly: AssemblyVersion (Consts.FxVersion)] -[assembly: SatelliteContractVersion (Consts.FxVersion)] -[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyVersion (XBuildConsts.AssemblyVersion)] +[assembly: SatelliteContractVersion (XBuildConsts.AssemblyVersion)] +[assembly: AssemblyInformationalVersion (XBuildConsts.FileVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -56,4 +56,4 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (XBuildConsts.FileVersion)] diff --git a/mcs/class/Microsoft.Build.Tasks/Makefile b/mcs/class/Microsoft.Build.Tasks/Makefile index 18288e0117..d8e93372f4 100644 --- a/mcs/class/Microsoft.Build.Tasks/Makefile +++ b/mcs/class/Microsoft.Build.Tasks/Makefile @@ -1,23 +1,11 @@ thisdir = class/Microsoft.Build.Tasks -SUBDIRS = +SUBDIRS = include ../../build/rules.make -LIBRARY = Microsoft.Build.Tasks.dll -BUILD_FRAMEWORK = Microsoft.Build.Framework.dll -BUILD_ENGINE = Microsoft.Build.Engine.dll - -ifeq (3.5, $(FRAMEWORK_VERSION)) -NAME_SUFFIX = .v3.5 -BUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/$(BUILD_FRAMEWORK) -BUILD_ENGINE := $(topdir)/class/lib/$(PROFILE)/$(BUILD_ENGINE) -else -ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) -NAME_SUFFIX = .v4.0 -endif -endif +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make -# Some tests are explicitly testing Microsoft.Build.Tasks.v3.5.dll -TEST_MONO_PATH = $(topdir)/class/lib/net_3_5$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0 +LIBRARY = Microsoft.Build.Tasks.dll LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll @@ -27,14 +15,16 @@ LIB_MCS_FLAGS = \ /r:System.Core.dll \ /r:System.Xml.dll \ /r:System.Windows.Forms.dll \ - /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll \ - /r:$(BUILD_FRAMEWORK) \ - /r:$(BUILD_ENGINE) + /r:$(XBUILD_UTILITIES) \ + /r:$(XBUILD_FRAMEWORK) \ + /r:$(XBUILD_ENGINE) \ + /r:$(XBUILD_TASKS) TEST_MCS_FLAGS = \ - /r:$(BUILD_ENGINE) \ - /r:$(BUILD_FRAMEWORK) \ - /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll \ + /r:$(XBUILD_ENGINE) \ + /r:$(XBUILD_FRAMEWORK) \ + /r:$(XBUILD_TASKS) \ + /r:$(XBUILD_UTILITIES) \ /r:System.Core.dll EXTRA_DISTFILES = \ @@ -44,37 +34,15 @@ EXTRA_DISTFILES = \ Test/resources/junk.txt \ Test/test-config-file* -test-local: Test/resources/test.dll - Test/resources/test.dll: Test/resources/test.cs $(CSCOMPILE) -target:library Test/resources/test.cs -clean-local: clean-test-dll - -clean-test-dll: +clean-test-resources: rm -f Test/resources/test.dll -test-local: copy-config - -ifeq (net_4_5, $(PROFILE)) -copy-config: - cp Test/test-config-file-net-4.0 $(test_lib).config -else -ifeq (net_4_0, $(PROFILE)) -copy-config: - cp Test/test-config-file-net-4.0 $(test_lib).config -else -ifeq (net_3_5, $(PROFILE)) -copy-config: - cp Test/test-config-file-net-3.5 $(test_lib).config -else -copy-config: -endif -endif -endif +test-local: Test/resources/test.dll -export TESTING_MONO=a -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make +clean-local: clean-test-resources +include $(XBUILD_DIR)/xbuild_test.make include ../../build/library.make diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources index fb30b46bc2..6785e5ef88 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources @@ -1,6 +1,7 @@ Assembly/AssemblyInfo.cs ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs +../../tools/xbuild/XBuildConsts.cs Microsoft.Build.Tasks/AL.cs Microsoft.Build.Tasks/AppDomainIsolatedTaskExtension.cs Microsoft.Build.Tasks/AspNetCompiler.cs @@ -87,8 +88,6 @@ Microsoft.Build.Tasks/MakeDir.cs Microsoft.Build.Tasks/ManagedCompiler.cs Microsoft.Build.Tasks/Message.cs Microsoft.Build.Tasks/MSBuild.cs -Microsoft.Build.Tasks/PcFileCache.cs -Microsoft.Build.Tasks/LibraryPcFileCache.cs Microsoft.Build.Tasks/ReadLinesFromFile.cs Microsoft.Build.Tasks/RegisterAssembly.cs Microsoft.Build.Tasks/RemoveDir.cs diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs index 98f614613c..60dd7a68c4 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs @@ -82,7 +82,7 @@ namespace Microsoft.Build.Tasks { result &= CompileResourceFile (sourceFile, outputFile); ITaskItem newItem = new TaskItem (source); - source.ItemSpec = outputFile; + newItem.ItemSpec = outputFile; temporaryFilesWritten.Add (newItem); } diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs index 730216cf8c..7b386c2edd 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs @@ -408,7 +408,7 @@ namespace Microsoft.Build.Tasks { return; foreach (string ext in allowedRelatedFileExtensions) { - string rfile = filename + ext; + string rfile = Path.ChangeExtension (filename, ext); if (File.Exists (rfile)) { ITaskItem item = new TaskItem (rfile); SetCopyLocal (item, parent_copy_local); diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs index 2e457d5716..1461e176b4 100755 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs @@ -369,7 +369,8 @@ namespace MonoTests.Microsoft.Build.Tasks CheckLoggedMessageAny (testLogger, "Number: 2 Color: Red-- Items in ExampColl: ExampColl2: Item5", "A3"); CheckLoggedMessageAny (testLogger, "Number: 3 Color: Green-- Items in ExampColl: ExampColl2: Item6", "A4"); CheckLoggedMessageAny (testLogger, "Number: 2 Color: -- Items in ExampColl: Item2 ExampColl2: ", "A5"); - Assert.AreEqual (0, testLogger.Count, "A6"); + Assert.AreEqual (0, testLogger.NormalMessageCount, "A6"); + Assert.AreEqual (0, testLogger.WarningMessageCount, "A7"); CheckEngineEventCounts (testLogger, 1, 1, 4, 4); } @@ -459,7 +460,8 @@ namespace MonoTests.Microsoft.Build.Tasks CheckLoggedMessageAny (testLogger, "Identity: Item4 -- Items in ExampColl: Item4;Item4", "A5"); CheckLoggedMessageAny (testLogger, "Identity: Item5 -- Items in ExampColl: Item5", "A6"); CheckLoggedMessageAny (testLogger, "Identity: Item6 -- Items in ExampColl: Item6", "A7"); - Assert.AreEqual (0, testLogger.Count, "A8"); + Assert.AreEqual (0, testLogger.NormalMessageCount, "A8"); + Assert.AreEqual (0, testLogger.WarningMessageCount, "A7"); CheckEngineEventCounts (testLogger, 1, 1, 6, 6); } diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs index 364b575ebe..c6ca1a2390 100644 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs @@ -129,6 +129,18 @@ namespace MonoTests.Microsoft.Build.Tasks } } + public int WarningMessageCount { + get { + int count = 0, i = 0; + while (i++ < messages.Count) { + var importance = messages [i - 1].Importance; + if (importance == MessageImportance.High) + count++; + } + return count; + } + } + public int CheckHead (string text, MessageImportance importance) { string actual_msg; diff --git a/mcs/class/Microsoft.Build.Utilities/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build.Utilities/Assembly/AssemblyInfo.cs index 90933c5a29..2f80ed7552 100644 --- a/mcs/class/Microsoft.Build.Utilities/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build.Utilities/Assembly/AssemblyInfo.cs @@ -46,9 +46,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany (Consts.MonoCompany)] [assembly: AssemblyProduct (Consts.MonoProduct)] [assembly: AssemblyCopyright (Consts.MonoCopyright)] -[assembly: AssemblyVersion (Consts.FxVersion)] -[assembly: SatelliteContractVersion (Consts.FxVersion)] -[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyVersion (XBuildConsts.AssemblyVersion)] +[assembly: SatelliteContractVersion (XBuildConsts.AssemblyVersion)] +[assembly: AssemblyInformationalVersion (XBuildConsts.FileVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -57,6 +57,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (XBuildConsts.FileVersion)] #endif diff --git a/mcs/class/Microsoft.Build.Utilities/Makefile b/mcs/class/Microsoft.Build.Utilities/Makefile index 32f34e3f40..0951df6adb 100644 --- a/mcs/class/Microsoft.Build.Utilities/Makefile +++ b/mcs/class/Microsoft.Build.Utilities/Makefile @@ -2,27 +2,18 @@ thisdir = class/Microsoft.Build.Utilities SUBDIRS = include ../../build/rules.make -LIBRARY = Microsoft.Build.Utilities.dll -BUILD_FRAMEWORK = Microsoft.Build.Framework.dll +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make -ifeq (3.5, $(FRAMEWORK_VERSION)) -LIBRARY_NAME = Microsoft.Build.Utilities.v3.5.dll -BUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/$(BUILD_FRAMEWORK) -else -ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) -LIBRARY_NAME = Microsoft.Build.Utilities.v4.0.dll -endif -endif +LIBRARY = Microsoft.Build.Utilities.dll +LIBRARY_NAME = Microsoft.Build.Utilities$(NAME_SUFFIX).dll LIB_MCS_FLAGS = \ /r:$(corlib) \ /r:System.dll \ - /r:$(BUILD_FRAMEWORK) - -TEST_MCS_FLAGS = /r:$(BUILD_FRAMEWORK) -r:System.dll + /r:$(XBUILD_FRAMEWORK) -export TESTING_MONO=a -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make +TEST_MCS_FLAGS = /r:$(XBUILD_ENGINE) /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll +include $(XBUILD_DIR)/xbuild_test.make include ../../build/library.make diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities.dll.sources b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities.dll.sources index c377282586..deb3e77ec9 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities.dll.sources +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities.dll.sources @@ -1,5 +1,6 @@ ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs +../../tools/xbuild/XBuildConsts.cs Assembly/AssemblyInfo.cs Microsoft.Build.Utilities/AppDomainIsolatedTask.cs Microsoft.Build.Utilities/CommandLineBuilder.cs diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ProcessService.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ProcessService.cs index 3de4979772..d022ea16c0 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ProcessService.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ProcessService.cs @@ -117,6 +117,7 @@ namespace Microsoft.Build.Utilities startInfo.RedirectStandardError = true; startInfo.RedirectStandardInput = redirectStandardInput; startInfo.UseShellExecute = false; + startInfo.CreateNoWindow = true; return startInfo; } diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs index 4401042a60..04940d5e8b 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs @@ -31,7 +31,12 @@ namespace Microsoft.Build.Utilities { // If changing something here then update // ToolLocationHelper.GetPathToDotNetFramework also - public enum TargetDotNetFrameworkVersion + #if MICROSOFT_BUILD_DLL + internal + #else + public + #endif + enum TargetDotNetFrameworkVersion { Version11, Version20, @@ -43,8 +48,13 @@ namespace Microsoft.Build.Utilities #if NET_4_5 Version45, #endif +#if XBUILD_12 + Version451, +#endif -#if NET_4_5 +#if XBUILD_12 + VersionLatest = Version451 +#elif NET_4_5 VersionLatest = Version45 #elif NET_4_0 VersionLatest = Version40 diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs index d917d3e6a3..03c018a54d 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs @@ -36,7 +36,10 @@ using Mono.XBuild.Utilities; namespace Microsoft.Build.Utilities { - public sealed class TaskItem : MarshalByRefObject, ITaskItem +#if !MICROSOFT_BUILD_DLL + public +#endif + sealed class TaskItem : MarshalByRefObject, ITaskItem { IDictionary metadata; string itemSpec; @@ -61,7 +64,6 @@ namespace Microsoft.Build.Utilities if (itemSpec == null) throw new ArgumentNullException ("itemSpec"); - this.itemSpec = itemSpec; this.metadata = CollectionsUtil.CreateCaseInsensitiveHashtable (); // FIXME: hack @@ -105,9 +107,9 @@ namespace Microsoft.Build.Utilities public string GetMetadata (string metadataName) { if (ReservedNameUtils.IsReservedMetadataName (metadataName)) - return ReservedNameUtils.GetReservedMetadata (ItemSpec, metadataName, metadata); + return MSBuildUtils.Unescape (ReservedNameUtils.GetReservedMetadata (ItemSpec, metadataName, metadata)); else if (metadata.Contains (metadataName)) - return (string) metadata [metadataName]; + return MSBuildUtils.Unescape ((string)metadata [metadataName]); else return String.Empty; } @@ -150,7 +152,7 @@ namespace Microsoft.Build.Utilities } public string ItemSpec { - get { return itemSpec; } + get { return MSBuildUtils.Unescape (itemSpec); } set { itemSpec = value; } } diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs index cc5b84cb90..91441df066 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs @@ -30,10 +30,16 @@ using System.IO; namespace Microsoft.Build.Utilities { - public static class ToolLocationHelper + #if MICROSOFT_BUILD_DLL + internal + #else + public + #endif + static class ToolLocationHelper { static string lib_mono_dir; static string [] mono_dir; + static bool runningOnDotNet; static ToolLocationHelper () { @@ -48,23 +54,45 @@ namespace Microsoft.Build.Utilities t2 = t1.Parent; lib_mono_dir = t2.FullName; + +#if NET_4_0 + var windowsPath = Environment.GetFolderPath (Environment.SpecialFolder.Windows); + runningOnDotNet = !string.IsNullOrEmpty (windowsPath) && lib_mono_dir.StartsWith (windowsPath); +#endif + if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) { mono_dir = new string [] { Path.Combine (lib_mono_dir, "net_1_0"), Path.Combine (lib_mono_dir, "net_2_0"), Path.Combine (lib_mono_dir, "net_2_0"), Path.Combine (lib_mono_dir, "net_3_5"), - Path.Combine (lib_mono_dir, "net_4_0"), + // mono's 4.0 is not an actual framework directory with all tools etc + // it's simply reference assemblies. So like .NET we consider 4.5 to + // be a complete replacement for 4.0. + Path.Combine (lib_mono_dir, "net_4_5"), + Path.Combine (lib_mono_dir, "net_4_5"), Path.Combine (lib_mono_dir, "net_4_5") }; + } else if (runningOnDotNet) { + mono_dir = new string [] { + Path.Combine (lib_mono_dir, "v1.0.3705"), + Path.Combine (lib_mono_dir, "v2.0.50727"), + Path.Combine (lib_mono_dir, "v2.0.50727"), + Path.Combine (lib_mono_dir, "v3.5"), + Path.Combine (lib_mono_dir, "v4.0.30319"), + Path.Combine (lib_mono_dir, "v4.0.30319"), + Path.Combine (lib_mono_dir, "v4.0.30319") + }; } else { mono_dir = new string [] { Path.Combine (lib_mono_dir, "1.0"), Path.Combine (lib_mono_dir, "2.0"), Path.Combine (lib_mono_dir, "2.0"), Path.Combine (lib_mono_dir, "3.5"), - Path.Combine (lib_mono_dir, "4.0"), - Path.Combine (lib_mono_dir, "4.5") + // see comment above regarding 4.0/4.5 + Path.Combine (lib_mono_dir, "4.5"), + Path.Combine (lib_mono_dir, "4.5"), + Path.Combine (lib_mono_dir, "4.5"), }; } @@ -124,5 +152,30 @@ namespace Microsoft.Build.Utilities throw new NotImplementedException (); } } + +#if XBUILD_12 + public static string CurrentToolsVersion { + get { + return XBuildConsts.Version; + } + } + + public static string GetPathToBuildTools (string toolsVersion) + { + if (toolsVersion != "12.0") + return null; + + if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) + return Path.Combine (lib_mono_dir, "xbuild_12"); + + if (runningOnDotNet) { + //see http://msdn.microsoft.com/en-us/library/vstudio/bb397428(v=vs.120).aspx + var programFiles = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86); + return Path.Combine (programFiles, "MSBuild", toolsVersion, "bin"); + } + + return Path.Combine (lib_mono_dir, "xbuild", toolsVersion, "bin"); + } +#endif } } diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs index 4094c122e3..01a7c453ae 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs @@ -298,6 +298,7 @@ namespace Microsoft.Build.Utilities pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory; pinfo.UseShellExecute = false; + pinfo.CreateNoWindow = true; pinfo.RedirectStandardOutput = true; pinfo.RedirectStandardError = true; @@ -464,13 +465,25 @@ namespace Microsoft.Build.Utilities } } - // Snatched from our codedom code, with some changes to make it compatible with csc - // (the line+column group is optional is csc) + // Keep in sync with mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs + const string ErrorRegexPattern = @" + ^ + (\s*(?<file>[^\(]+) # filename (optional) + (\((?<line>\d*)(,(?<column>\d*[\+]*))?\))? # line+column (optional) + :\s+)? + (?<level>\w+) # error|warning + \s+ + (?<number>[^:]*\d) # CS1234 + : + \s* + (?<message>.*)$"; + static Regex errorRegex; static Regex CscErrorRegex { get { if (errorRegex == null) - errorRegex = new Regex (@"^(\s*(?<file>[^\(]+)(\((?<line>\d*)(,(?<column>\d*[\+]*))?\))?:\s+)*(?<level>\w+)\s+(?<number>.*\d):\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture); + errorRegex = new Regex (ErrorRegexPattern, + RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace); return errorRegex; } } diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities_test.dll.sources b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities_test.dll.sources index 8f797a06ec..b1a3758e98 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities_test.dll.sources +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities_test.dll.sources @@ -2,3 +2,4 @@ Microsoft.Build.Utilities/CommandLineBuilderTest.cs Microsoft.Build.Utilities/LoggerTest.cs Microsoft.Build.Utilities/TaskItemTest.cs Microsoft.Build.Utilities/TaskLoggingHelperTest.cs +Microsoft.Build.Utilities/ToolTaskTest.cs diff --git a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs index f2712566d5..6789cfbd92 100644 --- a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs +++ b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs @@ -77,7 +77,8 @@ namespace Mono.XBuild.Utilities { switch (metadataName.ToLowerInvariant ()) { case "fullpath": - return Path.GetFullPath (itemSpec); + var unescapedItemSpec = MSBuildUtils.Unescape (itemSpec); + return MSBuildUtils.Escape (Path.GetFullPath (unescapedItemSpec)); case "rootdir": if (Path.IsPathRooted (itemSpec)) return Path.GetPathRoot (itemSpec); diff --git a/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/TaskItemTest.cs b/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/TaskItemTest.cs index 2032f7c357..79e2eff5f6 100644 --- a/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/TaskItemTest.cs +++ b/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/TaskItemTest.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Specialized; +using System.IO; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using NUnit.Framework; @@ -116,6 +117,50 @@ namespace MonoTests.Microsoft.Build.Utilities { } [Test] + public void TestCtor_EscapedSpecialChar () + { + // If we instantiate with the *escaped* metadata, it's unescaped automatically + var metadata = "foo@2x.png"; + var escapedMetadata = global::Microsoft.Build.BuildEngine.Utilities.Escape ("foo@2x.png"); + var item = new TaskItem (escapedMetadata); + item.SetMetadata ("mine", escapedMetadata); + + Assert.AreEqual (metadata, item.ItemSpec, "#1"); + Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2"); + Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3"); + Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4"); + Assert.AreEqual (metadata, item.GetMetadata ("mine"), "#5"); + } + + [Test] + public void TestCtor_EscapedSpecialChar_BrokenEscaping () + { + // This is badly escaped, but MSBuild does not care. + var metadata = "foo%4@2x.png"; + var item = new TaskItem (metadata); + + Assert.AreEqual (metadata, item.ItemSpec, "#1"); + Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2"); + Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3"); + Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4"); + } + + [Test] + public void TestCtor_UnescapedSpecialChar () + { + // If we instantiate with unescaped metadata, we get the same value back + var metadata = "foo@2x.png"; + var item = new TaskItem (metadata); + item.SetMetadata ("mine", metadata); + + Assert.AreEqual (metadata, item.ItemSpec, "#1"); + Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2"); + Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3"); + Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4"); + Assert.AreEqual (metadata, item.GetMetadata ("mine"), "#5"); + } + + [Test] public void TestCopyConstructor () { item1 = new TaskItem ("itemSpec"); @@ -240,5 +285,19 @@ namespace MonoTests.Microsoft.Build.Utilities { item = new TaskItem ("lalala"); item.SetMetadata ("Identity", "some value"); } + + [Test] + public void TestSetItemSpec () + { + var itemSpec = "foo@2x.png"; + var escapedItemSpec = global::Microsoft.Build.BuildEngine.Utilities.Escape (itemSpec); + + var item = new TaskItem ("foo"); + item.ItemSpec = itemSpec; + Assert.AreEqual (itemSpec, item.ItemSpec, "#1"); + + item.ItemSpec = escapedItemSpec; + Assert.AreEqual (itemSpec, item.ItemSpec, "#2"); + } } } diff --git a/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/ToolTaskTest.cs b/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/ToolTaskTest.cs new file mode 100644 index 0000000000..8b3ae6e69c --- /dev/null +++ b/mcs/class/Microsoft.Build.Utilities/Test/Microsoft.Build.Utilities/ToolTaskTest.cs @@ -0,0 +1,141 @@ +// +// ToolTaskTest.cs: +// +// Author: +// Jonathan Pryor (jonp@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Utilities { + + [TestFixture] + public class ToolTaskTest { + + [Test] + public void LogEventsFromTextOutput () + { + var messages = new[] { + new {Code = "CS0152", Line = "class1.cs(16,4): error CS0152: The label `case 1:' already occurs in this switch statement" }, + }; + + var task = new LogEventsFromTextOutputToolTask (); + foreach (var m in messages) { + task.LogEventsFromTextOutput (m.Line); + Assert.IsTrue (task.Codes.Count > 0, "No error logged for line: {0}", m.Line); + Assert.AreEqual (m.Code, task.Codes [0]); + task.Codes.Clear (); + } + } + } + + class LogEventsFromTextOutputToolTask : ToolTask { + + public List<string> Codes { + get {return engine.Codes;} + } + + CodeLoggingBuildEngine engine = new CodeLoggingBuildEngine (); + + public LogEventsFromTextOutputToolTask () + { + BuildEngine = engine; + } + + protected override string GenerateFullPathToTool () + { + throw new NotImplementedException (); + } + + protected override string ToolName { + get {throw new NotImplementedException ();} + } + + public void LogEventsFromTextOutput (string line) + { + base.LogEventsFromTextOutput (line, MessageImportance.Normal); + } + } + + class CodeLoggingBuildEngine : IBuildEngine { + + public List<string> Codes = new List<string> (); + + public int ColumnNumberOfTaskNode { + get { + throw new NotImplementedException (); + } + } + + public bool ContinueOnError { + get { + throw new NotImplementedException (); + } + } + + public int LineNumberOfTaskNode { + get { + throw new NotImplementedException (); + } + } + + public string ProjectFileOfTaskNode { + get { + throw new NotImplementedException (); + } + } + + public bool BuildProjectFile (string projectFileName, string[] targetNames, System.Collections.IDictionary globalProperties, System.Collections.IDictionary targetOutputs) + { + throw new NotImplementedException (); + } + + public void LogCustomEvent (CustomBuildEventArgs e) + { + } + + public void LogErrorEvent (BuildErrorEventArgs e) + { + Codes.Add (e.Code); + } + + public void LogMessageEvent (BuildMessageEventArgs e) + { + } + + public void LogWarningEvent (BuildWarningEventArgs e) + { + Codes.Add (e.Code); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs index edc155a8af..e14ad00346 100644 --- a/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs @@ -46,9 +46,9 @@ using System.Runtime.Versioning; [assembly: AssemblyCompany (Consts.MonoCompany)] [assembly: AssemblyProduct (Consts.MonoProduct)] [assembly: AssemblyCopyright (Consts.MonoCopyright)] -[assembly: AssemblyVersion (Consts.FxVersion)] -[assembly: SatelliteContractVersion (Consts.FxVersion)] -[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyVersion (XBuildConsts.AssemblyVersion)] +[assembly: SatelliteContractVersion (XBuildConsts.AssemblyVersion)] +[assembly: AssemblyInformationalVersion (XBuildConsts.FileVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -57,6 +57,6 @@ using System.Runtime.Versioning; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (XBuildConsts.FileVersion)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/Microsoft.Build/Makefile b/mcs/class/Microsoft.Build/Makefile index 173638c983..931b9fc7e5 100644 --- a/mcs/class/Microsoft.Build/Makefile +++ b/mcs/class/Microsoft.Build/Makefile @@ -2,14 +2,10 @@ thisdir = class/Microsoft.Build SUBDIRS = include ../../build/rules.make -LIBRARY = Microsoft.Build.dll +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make -ifneq (4, $(FRAMEWORK_VERSION_MAJOR)) -LIBRARY_NAME = dummy-Microsoft.Build.dll -NO_INSTALL = yes -NO_TEST = yes -NO_SIGN_ASSEMBLY = yes -endif +LIBRARY = Microsoft.Build.dll LIB_MCS_FLAGS = \ /r:$(corlib) \ @@ -17,18 +13,26 @@ LIB_MCS_FLAGS = \ /r:System.Core.dll \ /r:System.Xml.dll \ /r:Microsoft.Build.Engine.dll \ - /r:Microsoft.Build.Framework.dll + /r:Microsoft.Build.Framework.dll \ + /d:MICROSOFT_BUILD_DLL -TEST_MCS_FLAGS = /r:System.Core.dll +TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = \ + Microsoft.Build.Internal/ExpressionParser.jay \ Test/FunctionalTestReferenceProject.csproj \ Test/FunctionalTestReferenceProject3.csproj \ Test/Microsoft.Build.Test.csproj \ Test/Microsoft.Build.csproj +EXPR_PARSER = Microsoft.Build.Internal/ExpressionParser + +$(EXPR_PARSER).cs: $(EXPR_PARSER).jay $(topdir)/jay/skeleton.cs + (cd Microsoft.Build.Internal; $(topdir)/../jay/jay -ctv < $(topdir)/../jay/skeleton.cs ExpressionParser.jay > ExpressionParser.cs) + +BUILT_SOURCES = $(EXPR_PARSER).cs + include ../../build/library.make -export TESTING_MONO=a -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make +XBUILD_FRAMEWORK_FOLDERS_PATH=xbuild-testing +include $(XBUILD_DIR)/xbuild_test.make diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs index 43f20dad9b..15fe431cec 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs @@ -1,10 +1,10 @@ // -// ProjectItemDefinitionInstance.cs +// ElementLocation.cs // // Author: -// Atsushi Enomoto (atsushi@veritas-vos-liberabit.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2012 Xamarin Inc. +// Copyright (C) 2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_5 using Microsoft.Build.Framework; using System; @@ -35,7 +34,10 @@ using System.Collections.Generic; namespace Microsoft.Build.Construction { [Serializable] - public abstract class ElementLocation +#if NET_4_5 + public +#endif + abstract class ElementLocation { public abstract int Column { get; } public abstract string File { get; } @@ -44,7 +46,16 @@ namespace Microsoft.Build.Construction public string LocationString { get { return Line == 0 ? File : String.Format ("{0} ({1}{2})", File, Line, Column != 0 ? "," + Column : String.Empty); } } + + public override bool Equals (object other) + { + var o = other as ElementLocation; + return (object) o != null && o.File == File && o.Line == Line && o.Column == Column; + } + + public override int GetHashCode () + { + return (File.GetHashCode () << 16) + (Line << 8) + Column; + } } } - -#endif diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectChooseElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectChooseElement.cs index 551a67b4c5..d5a52d9b78 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectChooseElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectChooseElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Exceptions; using Microsoft.Build.Internal; @@ -54,8 +55,9 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return "Choose"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { + var name = reader.LocalName; switch (name) { case "Otherwise": var other = ContainingProject.CreateOtherwiseElement (); diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectCommentElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectCommentElement.cs index 23666183d1..36dc17a4fb 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectCommentElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectCommentElement.cs @@ -47,6 +47,7 @@ namespace Microsoft.Build.Construction internal override void Load (XmlReader reader) { + FillLocation (reader); LoadValue (reader); } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElement.cs index 7454665b7e..6a3cd8f2f3 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElement.cs @@ -35,6 +35,8 @@ namespace Microsoft.Build.Construction { public abstract class ProjectElement { + internal const string MSBuildNamespace = "http://schemas.microsoft.com/developer/msbuild/2003"; + internal ProjectElement () { linkedListNode = new LinkedListNode<ProjectElement> (this); @@ -67,9 +69,11 @@ namespace Microsoft.Build.Construction internal virtual void Load (XmlReader reader) { reader.ReadToFollowing (XmlName); + FillLocation (reader); while (reader.MoveToNextAttribute ()) { LoadAttribute (reader.Name, reader.Value); } + reader.MoveToElement (); LoadValue (reader); } internal virtual void LoadAttribute (string name, string value) @@ -84,7 +88,7 @@ namespace Microsoft.Build.Construction Condition = value; break; default: - throw new InvalidProjectFileException (string.Format ( + throw new InvalidProjectFileException (Location, null, string.Format ( "Attribute \"{0}\" is not known on node \"{1}\" [type {2}].", name, XmlName, GetType ())); } @@ -109,5 +113,52 @@ namespace Microsoft.Build.Construction if (!string.IsNullOrWhiteSpace (attributeValue)) writer.WriteAttributeString (attributeName, attributeValue); } + +#if NET_4_5 + public ElementLocation Location { get; private set; } + public ElementLocation LabelLocation { get; private set; } + public ElementLocation ConditionLocation { get; private set; } +#else + internal ElementLocation Location { get; private set; } + internal ElementLocation LabelLocation { get; private set; } + internal ElementLocation ConditionLocation { get; private set; } +#endif + + internal void FillLocation (XmlReader reader) + { + var l = reader as IXmlLineInfo; + if (l != null && l.HasLineInfo ()) + Location = new ProjectElementLocation (reader.BaseURI, l); + if (reader.MoveToAttribute ("Condition") && l.HasLineInfo ()) + ConditionLocation = new ProjectElementLocation (reader.BaseURI, l); + if (reader.MoveToAttribute ("Label") && l.HasLineInfo ()) + LabelLocation = new ProjectElementLocation (reader.BaseURI, l); + reader.MoveToElement (); + } + + class ProjectElementLocation : ElementLocation + { + public ProjectElementLocation (string file, IXmlLineInfo li) + { + this.file = file; + this.line = li.LineNumber; + this.column = li.LinePosition; + } + + string file; + int line; + int column; + + public override string File { get { return file; } } + public override int Line { get { return line; } } + public override int Column { get { return column; } } + } + + internal InvalidProjectFileException CreateError (XmlReader reader, string message, int columnOffset = 0) + { + var li = reader as IXmlLineInfo; + bool valid = li != null && li.HasLineInfo (); + throw new InvalidProjectFileException (reader.BaseURI, valid ? li.LineNumber : 0, valid ? li.LinePosition + columnOffset : 0, 0, 0, message, null, null, null); + } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElementContainer.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElementContainer.cs index eb9f59e875..1f1619bbd5 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElementContainer.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectElementContainer.cs @@ -29,6 +29,7 @@ using System.Collections.Generic; using System.Linq; using System.Xml; +using Microsoft.Build.Exceptions; using Microsoft.Build.Internal; namespace Microsoft.Build.Construction @@ -123,11 +124,25 @@ namespace Microsoft.Build.Construction child.Save (writer); } + internal override void Load (XmlReader reader) + { + reader.Read (); + reader.MoveToContent (); + FillLocation (reader); + if (reader.LocalName != XmlName || reader.NamespaceURI != MSBuildNamespace) + throw CreateError (reader, string.Format ("Unexpected XML {0} \"{1}\" in namespace \"{2}\" appeared, while \"{3}\" in namespace \"{4}\" is expected.", + reader.NodeType, reader.LocalName, reader.NamespaceURI, XmlName, MSBuildNamespace), -1); + while (reader.MoveToNextAttribute ()) { + LoadAttribute (reader.Name, reader.Value); + } + LoadValue (reader); + } + internal override void LoadValue (XmlReader reader) { while (reader.Read ()) { if (reader.NodeType == XmlNodeType.Element) { - var child = LoadChildElement (reader.Name); + var child = LoadChildElement (reader); child.Load (reader.ReadSubtree ()); } else if (reader.NodeType == XmlNodeType.Comment) { var commentElement = new ProjectCommentElement (ContainingProject); @@ -137,6 +152,6 @@ namespace Microsoft.Build.Construction } } - internal abstract ProjectElement LoadChildElement (string name); + internal abstract ProjectElement LoadChildElement (XmlReader reader); } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectExtensionsElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectExtensionsElement.cs index d6bcbbb12b..48d35f4f0f 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectExtensionsElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectExtensionsElement.cs @@ -71,6 +71,7 @@ namespace Microsoft.Build.Construction { while (reader.Read () && reader.NodeType != XmlNodeType.Element) ; + FillLocation (reader); using (XmlReader subReader = reader.ReadSubtree ()) { document = new XmlDocument (); document.Load (subReader); diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportElement.cs index d824cc7ee3..8895348390 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportElement.cs @@ -28,6 +28,9 @@ using System; using System.Xml; +using Microsoft.Build.Exceptions; + + namespace Microsoft.Build.Construction { [System.Diagnostics.DebuggerDisplayAttribute ("Project={Project} Condition={Condition}")] @@ -56,6 +59,13 @@ namespace Microsoft.Build.Construction SaveAttribute (writer, "Project", Project); base.SaveValue (writer); } + + internal override void LoadValue (XmlReader reader) + { + if (string.IsNullOrWhiteSpace (Project)) + throw new InvalidProjectFileException (Location, null, "Project attribute is null or empty on an Import element"); + base.LoadValue (reader); + } internal override void LoadAttribute (string name, string value) { diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportGroupElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportGroupElement.cs index 9223b5dc4b..bd346f772a 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportGroupElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectImportGroupElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using Microsoft.Build.Internal; +using System.Xml; namespace Microsoft.Build.Construction { @@ -50,7 +51,7 @@ namespace Microsoft.Build.Construction return import; } internal override string XmlName { get { return "ImportGroup"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { return AddImport (null); } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionElement.cs index 283e8b700c..497f631a07 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Internal; namespace Microsoft.Build.Construction @@ -56,9 +57,9 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return ItemType; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - return AddMetadata (name, null); + return AddMetadata (reader.LocalName, null); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionGroupElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionGroupElement.cs index 43570e828e..1d74932b2c 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionGroupElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemDefinitionGroupElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Internal; namespace Microsoft.Build.Construction @@ -53,9 +54,9 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return "ItemDefinitionGroup"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - return AddItemDefinition (name); + return AddItemDefinition (reader.LocalName); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs index 02a1a6ec49..5b13e20240 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Build.Internal; using System.Xml; +using Microsoft.Build.Exceptions; namespace Microsoft.Build.Construction { @@ -61,6 +62,14 @@ namespace Microsoft.Build.Construction } string @remove; public string Remove { get { return @remove ?? String.Empty; } set { @remove = value; } } + #if NET_4_5 + string keepDuplicates; + public string KeepDuplicates { get { return keepDuplicates ?? String.Empty; } set { keepDuplicates = value; } } + string keepMetadata; + public string KeepMetadata { get { return keepMetadata ?? String.Empty; } set { keepMetadata = value; } } + string removeMetadata; + public string RemoveMetadata { get { return removeMetadata ?? String.Empty; } set { removeMetadata = value; } } + #endif public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue) { var metadata = ContainingProject.CreateMetadataElement (name, unevaluatedValue); @@ -74,9 +83,15 @@ namespace Microsoft.Build.Construction { SaveAttribute (writer, "Include", Include); SaveAttribute (writer, "Exclude", Exclude); +#if NET_4_5 + SaveAttribute (writer, "KeepDuplicates", KeepDuplicates); + SaveAttribute (writer, "KeepMetadata", KeepMetadata); + SaveAttribute (writer, "RemoveMetadata", RemoveMetadata); +#endif SaveAttribute (writer, "Remove", Remove); base.SaveValue (writer); } + internal override void LoadAttribute (string name, string value) { switch (name) { @@ -86,6 +101,17 @@ namespace Microsoft.Build.Construction case "Exclude": Exclude = value; break; +#if NET_4_5 + case "KeepDuplicates": + KeepDuplicates = value; + break; + case "KeepMetadata": + KeepMetadata = value; + break; + case "RemoveMetadata": + RemoveMetadata = value; + break; +#endif case "Remove": Remove = value; break; @@ -94,11 +120,30 @@ namespace Microsoft.Build.Construction break; } } - internal override ProjectElement LoadChildElement (string name) + internal override void LoadValue (XmlReader reader) + { + if (string.IsNullOrWhiteSpace (Include) && string.IsNullOrEmpty (Remove)) + throw new InvalidProjectFileException (Location, null, string.Format ("Both Include and Remove attribute are null or empty on '{0}' item", ItemType)); + base.LoadValue (reader); + } + internal override ProjectElement LoadChildElement (XmlReader reader) { - var metadata = ContainingProject.CreateMetadataElement (name); + var metadata = ContainingProject.CreateMetadataElement (reader.LocalName); AppendChild (metadata); return metadata; } +#if NET_4_5 + public ElementLocation ExcludeLocation { get; private set; } + public ElementLocation IncludeLocation { get; private set; } + public ElementLocation KeepDuplicatesLocation { get; private set; } + public ElementLocation RemoveLocation { get; private set; } + public ElementLocation RemoveMetadataLocation { get; private set; } +#else + ElementLocation ExcludeLocation { get; set; } + ElementLocation IncludeLocation { get; set; } + ElementLocation KeepDuplicatesLocation { get; set; } + ElementLocation RemoveLocation { get; set; } + ElementLocation RemoveMetadataLocation { get; set; } +#endif } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemGroupElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemGroupElement.cs index 5cece6419c..f0bce4361b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemGroupElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemGroupElement.cs @@ -26,10 +26,11 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Internal; -using System; namespace Microsoft.Build.Construction { @@ -84,9 +85,9 @@ namespace Microsoft.Build.Construction get { return "ItemGroup"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - var item = ContainingProject.CreateItemElement (name); + var item = ContainingProject.CreateItemElement (reader.LocalName); AppendChild (item); return item; } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOnErrorElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOnErrorElement.cs index 5d6b75a59f..1590189e75 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOnErrorElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOnErrorElement.cs @@ -61,5 +61,10 @@ namespace Microsoft.Build.Construction break; } } + + #if NET_4_5 + public + #endif + ElementLocation ExecuteTargetsAttributeLocation { get; set; } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOtherwiseElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOtherwiseElement.cs index 9c25e50658..b8a2d6bec0 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOtherwiseElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOtherwiseElement.cs @@ -29,6 +29,7 @@ using System.Collections.Generic; using System; using System.Linq; +using System.Xml; using Microsoft.Build.Exceptions; using Microsoft.Build.Internal; @@ -62,9 +63,9 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return "Otherwise"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - switch (name) { + switch (reader.LocalName) { case "PropertyGroup": var property = ContainingProject.CreatePropertyGroupElement (); AppendChild (property); @@ -79,7 +80,7 @@ namespace Microsoft.Build.Construction return when; default: throw new InvalidProjectFileException (string.Format ( - "Child \"{0}\" is not a known node type.", name)); + "Child \"{0}\" is not a known node type.", reader.LocalName)); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOutputElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOutputElement.cs index bb5693758d..98d9cb849b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOutputElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectOutputElement.cs @@ -57,6 +57,13 @@ namespace Microsoft.Build.Construction get { return taskParameter ?? String.Empty; } set { taskParameter = value; } } + #if NET_4_5 + ElementLocation taskParameterLocation; + public ElementLocation TaskParameterLocation { + get { return taskParameterLocation; } + set { taskParameterLocation = value; } + } + #endif internal override string XmlName { get { return "Output"; } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs index 0050ff5fee..4cee2f9d98 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs @@ -76,9 +76,15 @@ namespace Microsoft.Build.Construction get { return "PropertyGroup"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - return AddProperty (name, null); + switch (reader.LocalName) { + case "ItemGroup": + case "PropertyGroup": + throw CreateError (reader, string.Format ("{0} is a reserved name that cannot be used for a property.", reader.LocalName)); + // others need to be checked too, but things like "Project" are somehow allowed... + } + return AddProperty (reader.LocalName, null); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs index ddbed1f42c..d7d5d77249 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs @@ -63,8 +63,8 @@ namespace Microsoft.Build.Construction string directoryPath; public string DirectoryPath { - get { return directoryPath ?? String.Empty; } - internal set { directoryPath = value; } + get { return directoryPath ?? Directory.GetCurrentDirectory (); } + set { directoryPath = value; } } public ICollection<ProjectPropertyElement> Properties { @@ -170,7 +170,7 @@ namespace Microsoft.Build.Construction string toolsVersion; public string ToolsVersion { - get { return toolsVersion ?? "4.0"; } + get { return toolsVersion ?? string.Empty; } set { toolsVersion = value; } } @@ -185,6 +185,7 @@ namespace Microsoft.Build.Construction ProjectRootElement (ProjectCollection projectCollection) { + ToolsVersion = "4.0"; } public static ProjectRootElement Create () @@ -216,8 +217,9 @@ namespace Microsoft.Build.Construction public static ProjectRootElement Create (XmlReader xmlReader, ProjectCollection projectCollection) { - // yes, this should create en empty project var result = Create (projectCollection); + result.ToolsVersion = null; + result.Load (xmlReader); return result; } @@ -467,6 +469,8 @@ namespace Microsoft.Build.Construction public void Save () { + if (FullPath == null) + throw new InvalidOperationException ("This project was not given the file path to write to."); Save (Encoding); } @@ -518,9 +522,9 @@ namespace Microsoft.Build.Construction } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - switch (name) { + switch (reader.LocalName) { case "PropertyGroup": var prop = CreatePropertyGroupElement (); AppendChild (prop); @@ -538,7 +542,8 @@ namespace Microsoft.Build.Construction AppendChild (def); return def; case "UsingTask": - return AddUsingTask (null, null, null); + var ut = AddUsingTask (null, null, null); + return ut; case "Choose": var choose = CreateChooseElement (); AppendChild (choose); @@ -548,8 +553,7 @@ namespace Microsoft.Build.Construction AppendChild (ext); return ext; default: - throw new InvalidProjectFileException (string.Format ( - "Child \"{0}\" is not a known node type.", name)); + throw CreateError (reader, string.Format ("Child \"{0}\" is not a known node type.", reader.LocalName), -1); } } @@ -573,7 +577,7 @@ namespace Microsoft.Build.Construction internal override void Save (XmlWriter writer) { - writer.WriteStartElement (XmlName, "http://schemas.microsoft.com/developer/msbuild/2003"); + writer.WriteStartElement (XmlName, MSBuildNamespace); SaveValue (writer); writer.WriteEndElement (); } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTargetElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTargetElement.cs index 66129eb7da..cfaaa60c18 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTargetElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTargetElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Internal; namespace Microsoft.Build.Construction @@ -111,9 +112,30 @@ namespace Microsoft.Build.Construction get { return "Target"; } } - internal override ProjectElement LoadChildElement (string name) +#if NET_4_5 + public ElementLocation AfterTargetsLocation { get; private set; } + public ElementLocation BeforeTargetsLocation { get; private set; } + public ElementLocation DependsOnTargetsLocation { get; private set; } + public ElementLocation InputsLocation { get; private set; } + public ElementLocation KeepDuplicateOutputsLocation { get; private set; } + public ElementLocation NameLocation { get; private set; } + public ElementLocation OutputsLocation { get; private set; } + public ElementLocation ReturnsLocation { get; private set; } +#else + internal ElementLocation AfterTargetsLocation { get; set; } + internal ElementLocation BeforeTargetsLocation { get; set; } + internal ElementLocation DependsOnTargetsLocation { get; set; } + internal ElementLocation InputsLocation { get; set; } + internal ElementLocation KeepDuplicateOutputsLocation { get; set; } + internal ElementLocation LabelLocation { get; set; } + internal ElementLocation NameLocation { get; set; } + internal ElementLocation OutputsLocation { get; set; } + internal ElementLocation ReturnsLocation { get; set; } +#endif + + internal override ProjectElement LoadChildElement (XmlReader reader) { - switch (name) { + switch (reader.LocalName) { case "OnError": var error = new ProjectOnErrorElement (ContainingProject); AppendChild (error); @@ -123,9 +145,10 @@ namespace Microsoft.Build.Construction case "ItemGroup": return AddItemGroup (); default: - return AddTask (name); + return AddTask (reader.LocalName); } } + // This seriously needs to change to become able to fill ElementLocation... internal override void LoadAttribute (string name, string value) { switch (name) { diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTaskElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTaskElement.cs index 00e0654526..fffe68eb1f 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTaskElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectTaskElement.cs @@ -109,16 +109,16 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return Name; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - switch (name) { + switch (reader.LocalName) { case "Output": var output = ContainingProject.CreateOutputElement (null, null, null); AppendChild (output); return output; default: throw new InvalidProjectFileException (string.Format ( - "Child \"{0}\" is not a known node type.", name)); + "Child \"{0}\" is not a known node type.", reader.LocalName)); } } internal override void LoadAttribute (string name, string value) @@ -127,6 +127,17 @@ namespace Microsoft.Build.Construction case "ContinueOnError": ContinueOnError = value; break; +#if NET_4_5 + case "ExecuteTargets": + ExecuteTargets = value; + break; + case "MSBuildArchitecture": + MSBuildArchitecture = value; + break; + case "MSBuildRuntime": + MSBuildRuntime = value; + break; +#endif case "xmlns": break; case "Label": @@ -149,5 +160,15 @@ namespace Microsoft.Build.Construction base.SaveValue (writer); } private Dictionary<string, string> parameters = new Dictionary<string, string> (); + + public string ExecuteTargets { get; set; } + #if NET_4_5 + public ElementLocation ExecuteTargetsLocation { get; set; } + public ElementLocation ContinueOnErrorLocation { get; set; } + public string MSBuildArchitecture { get; set; } + public ElementLocation MSBuildArchitectureLocation { get; set; } + public string MSBuildRuntime { get; set; } + public ElementLocation MSBuildRuntimeLocation { get; set; } + #endif } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskBodyElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskBodyElement.cs index eecc92aa27..36c889dad5 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskBodyElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskBodyElement.cs @@ -68,7 +68,6 @@ namespace Microsoft.Build.Construction } internal override void LoadValue (XmlReader reader) { - reader.MoveToElement (); TaskBody = reader.ReadInnerXml (); } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskElement.cs index 83a5d60749..52a1dad01b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectUsingTaskElement.cs @@ -27,6 +27,7 @@ // using System; +using System.Xml; using Microsoft.Build.Exceptions; namespace Microsoft.Build.Construction @@ -107,16 +108,16 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return "UsingTask"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - switch (name) { + switch (reader.LocalName) { case "ParameterGroup": return AddParameterGroup (); case "Task": return AddUsingTaskBody (null, null); default: throw new InvalidProjectFileException (string.Format ( - "Child \"{0}\" is not a known node type.", name)); + "Child \"{0}\" is not a known node type.", reader.LocalName)); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectWhenElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectWhenElement.cs index 68040f52c2..0d7331afcb 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectWhenElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectWhenElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Exceptions; using Microsoft.Build.Internal; @@ -57,9 +58,9 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return "When"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - switch (name) { + switch (reader.LocalName) { case "PropertyGroup": var property = ContainingProject.CreatePropertyGroupElement (); AppendChild (property); @@ -74,7 +75,7 @@ namespace Microsoft.Build.Construction return when; default: throw new InvalidProjectFileException (string.Format ( - "Child \"{0}\" is not a known node type.", name)); + "Child \"{0}\" is not a known node type.", reader.LocalName)); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/UsingTaskParameterGroupElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/UsingTaskParameterGroupElement.cs index 8dd13943aa..ee808a170b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/UsingTaskParameterGroupElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/UsingTaskParameterGroupElement.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using Microsoft.Build.Internal; namespace Microsoft.Build.Construction @@ -61,9 +62,9 @@ namespace Microsoft.Build.Construction internal override string XmlName { get { return "ParameterGroup"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - return AddParameter (name); + return AddParameter (reader.LocalName); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Project.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Project.cs index c87ae5c3df..d384456d52 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Project.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Project.cs @@ -4,9 +4,10 @@ // Author: // Leszek Ciesielski (skolima@gmail.com) // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // // (C) 2011 Leszek Ciesielski -// Copyright (C) 2011 Xamarin Inc. (http://www.xamarin.com) +// Copyright (C) 2011,2013 Xamarin Inc. (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -36,383 +37,674 @@ using System.Linq; using System.Text; using System.Xml; using Microsoft.Build.Construction; -using Microsoft.Build.Internal; +using Microsoft.Build.Exceptions; using Microsoft.Build.Execution; using Microsoft.Build.Framework; +using Microsoft.Build.Internal; +using Microsoft.Build.Internal.Expressions; using Microsoft.Build.Logging; +using System.Collections; + +// Basically there are two semantic Project object models and their relationship is not obvious +// (apart from Microsoft.Build.Construction.ProjectRootElement which is a "construction rule"). +// +// Microsoft.Build.Evaluation.Project holds some "editable" project model, and it supports +// detailed loader API (such as Items and AllEvaluatedItems). +// ProjectPoperty holds UnevaluatedValue and gives EvaluatedValue too. +// +// Microsoft.Build.Execution.ProjectInstance holds "snapshot" of a project, and it lacks +// detailed loader API. It does not give us Unevaluated property value. +// On the other hand, it supports Targets object model. What Microsoft.Build.Evaluation.Project +// offers there is actually a list of Microsoft.Build.Execution.ProjectInstance objects. +// It should be also noted that only ProjectInstance has Evaluate() method (Project doesn't). +// +// And both API holds different set of descendant types for each and cannot really share the +// loader code. That is lame. +// +// So, can either of them be used to construct the other model? Both API models share the same +// "governor", which is Microsoft.Build.Evaluation.ProjectCollection/ Project is added to +// its LoadedProjects list, while ProjectInstance isn't. Project cannot be loaded to load +// a ProjectInstance, at least within the same ProjectCollection. +// +// On the other hand, can ProjectInstance be used to load a Project? Maybe. Since Project and +// its descendants need Microsoft.Build.Construction.ProjectElement family as its API model +// is part of the public API. Then I still have to understand how those AllEvaluatedItems/ +// AllEvaluatedProperties members make sense. EvaluationCounter is another propery in question. namespace Microsoft.Build.Evaluation { - [DebuggerDisplay("{FullPath} EffectiveToolsVersion={ToolsVersion} #GlobalProperties=" - +"{data.globalProperties.Count} #Properties={data.Properties.Count} #ItemTypes=" - +"{data.ItemTypes.Count} #ItemDefinitions={data.ItemDefinitions.Count} #Items=" - +"{data.Items.Count} #Targets={data.Targets.Count}")] - public class Project - { + [DebuggerDisplay ("{FullPath} EffectiveToolsVersion={ToolsVersion} #GlobalProperties=" + + "{data.globalProperties.Count} #Properties={data.Properties.Count} #ItemTypes=" + + "{data.ItemTypes.Count} #ItemDefinitions={data.ItemDefinitions.Count} #Items=" + + "{data.Items.Count} #Targets={data.Targets.Count}")] + public class Project + { public Project (XmlReader xml) : this (ProjectRootElement.Create (xml)) { } - public Project (XmlReader xml, IDictionary<string, string> globalProperties, - string toolsVersion) + + public Project (XmlReader xml, IDictionary<string, string> globalProperties, + string toolsVersion) : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion) { } - public Project (XmlReader xml, IDictionary<string, string> globalProperties, - string toolsVersion, ProjectCollection projectCollection) + + public Project (XmlReader xml, IDictionary<string, string> globalProperties, + string toolsVersion, ProjectCollection projectCollection) : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion, projectCollection) { } - public Project (XmlReader xml, IDictionary<string, string> globalProperties, - string toolsVersion, ProjectCollection projectCollection, - ProjectLoadSettings loadSettings) + + public Project (XmlReader xml, IDictionary<string, string> globalProperties, + string toolsVersion, ProjectCollection projectCollection, + ProjectLoadSettings loadSettings) : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion, projectCollection, loadSettings) { } - public Project (ProjectRootElement xml) : this(xml, null, null) - { - } - public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties, - string toolsVersion) - : this(xml, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection) - { - } - public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties, - string toolsVersion, ProjectCollection projectCollection) - : this(xml, globalProperties, toolsVersion, projectCollection, ProjectLoadSettings.Default) - { - } - - public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties, - string toolsVersion, ProjectCollection projectCollection, - ProjectLoadSettings loadSettings) - { - ProjectCollection = projectCollection; - Xml = xml; - GlobalProperties = globalProperties; - ToolsVersion = toolsVersion; - } - - public Project (string projectFile) : this(projectFile, null, null) - { - } - - public Project (string projectFile, IDictionary<string, string> globalProperties, - string toolsVersion) - : this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection, ProjectLoadSettings.Default) - { - } - - public Project (string projectFile, IDictionary<string, string> globalProperties, - string toolsVersion, ProjectCollection projectCollection) - : this(projectFile, globalProperties, toolsVersion, projectCollection, ProjectLoadSettings.Default) - { - } - - public Project (string projectFile, IDictionary<string, string> globalProperties, - string toolsVersion, ProjectCollection projectCollection, - ProjectLoadSettings loadSettings) - { - throw new NotImplementedException (); - } - - public IDictionary<string, string> GlobalProperties { get; private set; } - public ProjectCollection ProjectCollection { get; private set; } - public string ToolsVersion { get; private set; } - public ProjectRootElement Xml { get; private set; } - - public ICollection<ProjectItem> GetItemsIgnoringCondition (string itemType) - { - return new CollectionFromEnumerable<ProjectItem> ( - new FilteredEnumerable<ProjectItemElement> (Xml.Items). - Where (p => p.ItemType.Equals (itemType, StringComparison.OrdinalIgnoreCase)). - Select (p => new ProjectItem(p))); - } - public void RemoveItems (IEnumerable<ProjectItem> items) - { - var removal = new List<ProjectItem> (items); - foreach (var item in removal) { - var parent = item.Xml.Parent; - parent.RemoveChild (item.Xml); - if (parent.Count == 0) - parent.Parent.RemoveChild (parent); - } - } - - public IList<ProjectItem> AddItem (string itemType, string unevaluatedInclude) - { - throw new NotImplementedException (); - } - - public IList<ProjectItem> AddItem (string itemType, string unevaluatedInclude, - IEnumerable<KeyValuePair<string, string>> metadata) - { - throw new NotImplementedException (); - } - - public IList<ProjectItem> AddItemFast (string itemType, string unevaluatedInclude) - { - throw new NotImplementedException (); - } - - public IList<ProjectItem> AddItemFast (string itemType, string unevaluatedInclude, - IEnumerable<KeyValuePair<string, string>> metadata) - { - throw new NotImplementedException (); - } - - public bool Build () - { - throw new NotImplementedException (); - } - - public bool Build (IEnumerable<ILogger> loggers) - { - throw new NotImplementedException (); - } - - public bool Build (string target) - { - throw new NotImplementedException (); - } - - public bool Build (string[] targets) - { - throw new NotImplementedException (); - } - - public bool Build (ILogger logger) - { - throw new NotImplementedException (); - } - - public bool Build (string[] targets, IEnumerable<ILogger> loggers) - { - throw new NotImplementedException (); - } - - public bool Build (IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) - { - throw new NotImplementedException (); - } - - public bool Build (string target, IEnumerable<ILogger> loggers) - { - throw new NotImplementedException (); - } - - public bool Build (string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) - { - throw new NotImplementedException (); - } - - public bool Build (string target, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) - { - throw new NotImplementedException (); - } - - public ProjectInstance CreateProjectInstance () - { - throw new NotImplementedException (); - } - - public string ExpandString (string unexpandedValue) - { - throw new NotImplementedException (); - } - - public static string GetEvaluatedItemIncludeEscaped (ProjectItem item) - { - throw new NotImplementedException (); - } - - public static string GetEvaluatedItemIncludeEscaped (ProjectItemDefinition item) - { - throw new NotImplementedException (); - } - - public ICollection<ProjectItem> GetItems (string itemType) - { - throw new NotImplementedException (); - } - - public ICollection<ProjectItem> GetItemsByEvaluatedInclude (string evaluatedInclude) - { - throw new NotImplementedException (); - } - - public IEnumerable<ProjectElement> GetLogicalProject () - { - throw new NotImplementedException (); - } - - public static string GetMetadataValueEscaped (ProjectMetadata metadatum) - { - throw new NotImplementedException (); - } - - public static string GetMetadataValueEscaped (ProjectItem item, string name) - { - throw new NotImplementedException (); - } - - public static string GetMetadataValueEscaped (ProjectItemDefinition item, string name) - { - throw new NotImplementedException (); - } - - public string GetPropertyValue (string name) - { - throw new NotImplementedException (); - } - - public static string GetPropertyValueEscaped (ProjectProperty property) - { - throw new NotImplementedException (); - } - - public ProjectProperty GetProperty (string name) - { - throw new NotImplementedException (); - } - - public void MarkDirty () - { - throw new NotImplementedException (); - } - - public void ReevaluateIfNecessary () - { - throw new NotImplementedException (); - } - - public bool RemoveGlobalProperty (string name) - { - throw new NotImplementedException (); - } - - public bool RemoveItem (ProjectItem item) - { - throw new NotImplementedException (); - } - - public bool RemoveProperty (ProjectProperty property) - { - throw new NotImplementedException (); - } - - public void Save () - { - throw new NotImplementedException (); - } - - public void Save (TextWriter writer) - { - throw new NotImplementedException (); - } - - public void Save (string path) - { - throw new NotImplementedException (); - } - - public void Save (Encoding encoding) - { - throw new NotImplementedException (); - } - - public void Save (string path, Encoding encoding) - { - throw new NotImplementedException (); - } - - public void SaveLogicalProject (TextWriter writer) - { - throw new NotImplementedException (); - } - - public bool SetGlobalProperty (string name, string escapedValue) - { - throw new NotImplementedException (); - } - - public ProjectProperty SetProperty (string name, string unevaluatedValue) - { - throw new NotImplementedException (); - } - - public ICollection<ProjectMetadata> AllEvaluatedItemDefinitionMetadata { - get { throw new NotImplementedException (); } - } - - public ICollection<ProjectItem> AllEvaluatedItems { - get { throw new NotImplementedException (); } - } - - public ICollection<ProjectProperty> AllEvaluatedProperties { - get { throw new NotImplementedException (); } - } - - public IDictionary<string, List<string>> ConditionedProperties { - get { throw new NotImplementedException (); } - } - - public string DirectoryPath { - get { throw new NotImplementedException (); } - } - - public bool DisableMarkDirty { get; set; } - - public int EvaluationCounter { - get { throw new NotImplementedException (); } - } - - public string FullPath { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public IList<ResolvedImport> Imports { - get { throw new NotImplementedException (); } - } - - public IList<ResolvedImport> ImportsIncludingDuplicates { - get { throw new NotImplementedException (); } - } - - public bool IsBuildEnabled { - get { throw new NotImplementedException (); } - } - - public bool IsDirty { - get { throw new NotImplementedException (); } - } - - public IDictionary<string, ProjectItemDefinition> ItemDefinitions { - get { throw new NotImplementedException (); } - } - - public ICollection<ProjectItem> Items { - get { throw new NotImplementedException (); } - } - - public ICollection<ProjectItem> ItemsIgnoringCondition { - get { throw new NotImplementedException (); } - } - - public ICollection<string> ItemTypes { - get { throw new NotImplementedException (); } - } - - public ICollection<ProjectProperty> Properties { - get { throw new NotImplementedException (); } - } - - public bool SkipEvaluation { get; set; } - - public IDictionary<string, ProjectTargetInstance> Targets { - get { throw new NotImplementedException (); } - } - } + public Project (ProjectRootElement xml) : this (xml, null, null) + { + } + + public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties, + string toolsVersion) + : this (xml, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection) + { + } + + public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties, + string toolsVersion, ProjectCollection projectCollection) + : this (xml, globalProperties, toolsVersion, projectCollection, ProjectLoadSettings.Default) + { + } + + public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties, + string toolsVersion, ProjectCollection projectCollection, + ProjectLoadSettings loadSettings) + { + if (projectCollection == null) + throw new ArgumentNullException ("projectCollection"); + this.Xml = xml; + this.GlobalProperties = globalProperties ?? new Dictionary<string, string> (); + this.ToolsVersion = toolsVersion; + this.ProjectCollection = projectCollection; + this.load_settings = loadSettings; + + Initialize (null); + } + + Project (ProjectRootElement imported, Project parent) + { + this.Xml = imported; + this.GlobalProperties = parent.GlobalProperties; + this.ToolsVersion = parent.ToolsVersion; + this.ProjectCollection = parent.ProjectCollection; + this.load_settings = parent.load_settings; + + Initialize (parent); + } + + public Project (string projectFile) + : this (projectFile, null, null) + { + } + + public Project (string projectFile, IDictionary<string, string> globalProperties, + string toolsVersion) + : this (projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection, ProjectLoadSettings.Default) + { + } + + public Project (string projectFile, IDictionary<string, string> globalProperties, + string toolsVersion, ProjectCollection projectCollection) + : this (projectFile, globalProperties, toolsVersion, projectCollection, ProjectLoadSettings.Default) + { + } + + public Project (string projectFile, IDictionary<string, string> globalProperties, + string toolsVersion, ProjectCollection projectCollection, + ProjectLoadSettings loadSettings) + : this (ProjectRootElement.Create (projectFile), globalProperties, toolsVersion, projectCollection, loadSettings) + { + } + + ProjectLoadSettings load_settings; + + public IDictionary<string, string> GlobalProperties { get; private set; } + + public ProjectCollection ProjectCollection { get; private set; } + + public string ToolsVersion { get; private set; } + + public ProjectRootElement Xml { get; private set; } + + string dir_path; + Dictionary<string, ProjectItemDefinition> item_definitions; + List<ResolvedImport> raw_imports; + List<ProjectItem> raw_items; + List<ProjectItem> all_evaluated_items; + List<ProjectProperty> properties; + Dictionary<string, ProjectTargetInstance> targets; + + void Initialize (Project parent) + { + dir_path = Directory.GetCurrentDirectory (); + raw_imports = new List<ResolvedImport> (); + item_definitions = new Dictionary<string, ProjectItemDefinition> (); + targets = new Dictionary<string, ProjectTargetInstance> (); + raw_items = new List<ProjectItem> (); + + // FIXME: this is likely hack. Test ImportedProject.Properties to see what exactly should happen. + if (parent != null) { + properties = parent.properties; + } else { + properties = new List<ProjectProperty> (); + + foreach (DictionaryEntry p in Environment.GetEnvironmentVariables ()) + // FIXME: this is kind of workaround for unavoidable issue that PLATFORM=* is actually given + // on some platforms and that prevents setting default "PLATFORM=AnyCPU" property. + if (!string.Equals ("PLATFORM", (string) p.Key, StringComparison.OrdinalIgnoreCase)) + this.properties.Add (new EnvironmentProjectProperty (this, (string)p.Key, (string)p.Value)); + foreach (var p in GlobalProperties) + this.properties.Add (new GlobalProjectProperty (this, p.Key, p.Value)); + var tools = ProjectCollection.GetToolset (this.ToolsVersion) ?? ProjectCollection.GetToolset (this.ProjectCollection.DefaultToolsVersion); + foreach (var p in ProjectCollection.GetReservedProperties (tools, this)) + this.properties.Add (p); + foreach (var p in ProjectCollection.GetWellKnownProperties (this)) + this.properties.Add (p); + } + + ProcessXml (parent); + + ProjectCollection.AddProject (this); + } + + void ProcessXml (Project parent) + { + // this needs to be initialized here (regardless of that items won't be evaluated at property evaluation; + // Conditions could incorrectly reference items and lack of this list causes NRE. + all_evaluated_items = new List<ProjectItem> (); + + // property evaluation happens couple of times. + // At first step, all non-imported properties are evaluated TOO, WHILE those properties are being evaluated. + // This means, Include and IncludeGroup elements with Condition attribute MAY contain references to + // properties and they will be expanded. + var elements = EvaluatePropertiesAndImports (Xml.Children).ToArray (); // ToArray(): to not lazily evaluate elements. + + // next, evaluate items + EvaluateItems (elements); + + // finally, evaluate targets and tasks + EvaluateTargets (elements); + } + + IEnumerable<ProjectElement> EvaluatePropertiesAndImports (IEnumerable<ProjectElement> elements) + { + // First step: evaluate Properties + foreach (var child in elements) { + yield return child; + var pge = child as ProjectPropertyGroupElement; + if (pge != null && Evaluate (pge.Condition)) + foreach (var p in pge.Properties) + // do not allow overwriting reserved or well-known properties by user + if (!this.properties.Any (_ => (_.IsReservedProperty || _.IsWellKnownProperty) && _.Name.Equals (p.Name, StringComparison.InvariantCultureIgnoreCase))) + if (Evaluate (p.Condition)) + this.properties.Add (new XmlProjectProperty (this, p, PropertyType.Normal, ProjectCollection.OngoingImports.Any ())); + + var ige = child as ProjectImportGroupElement; + if (ige != null && Evaluate (ige.Condition)) { + foreach (var incc in ige.Imports) { + foreach (var e in Import (incc)) + yield return e; + } + } + var inc = child as ProjectImportElement; + if (inc != null && Evaluate (inc.Condition)) + foreach (var e in Import (inc)) + yield return e; + } + } + + internal IEnumerable<T> GetAllItems<T> (string include, string exclude, Func<string,T> creator, Func<string,ITaskItem> taskItemCreator, Func<string,bool> itemTypeCheck, Action<T,string> assignRecurse) + { + return ProjectCollection.GetAllItems<T> (ExpandString, include, exclude, creator, taskItemCreator, DirectoryPath, assignRecurse, + t => all_evaluated_items.Any (i => i.EvaluatedInclude == t.ItemSpec && itemTypeCheck (i.ItemType))); + } + + void EvaluateItems (IEnumerable<ProjectElement> elements) + { + foreach (var child in elements) { + var ige = child as ProjectItemGroupElement; + if (ige != null) { + foreach (var p in ige.Items) { + if (!Evaluate (ige.Condition) || !Evaluate (p.Condition)) + continue; + Func<string,ProjectItem> creator = s => new ProjectItem (this, p, s); + foreach (var item in GetAllItems<ProjectItem> (p.Include, p.Exclude, creator, s => new ProjectTaskItem (p, s), it => string.Equals (it, p.ItemType, StringComparison.OrdinalIgnoreCase), (t, s) => t.RecursiveDir = s)) { + raw_items.Add (item); + all_evaluated_items.Add (item); + } + } + } + var def = child as ProjectItemDefinitionGroupElement; + if (def != null) { + foreach (var p in def.ItemDefinitions) { + if (Evaluate (p.Condition)) { + ProjectItemDefinition existing; + if (!item_definitions.TryGetValue (p.ItemType, out existing)) + item_definitions.Add (p.ItemType, (existing = new ProjectItemDefinition (this, p.ItemType))); + existing.AddItems (p); + } + } + } + } + all_evaluated_items.Sort ((p1, p2) => string.Compare (p1.ItemType, p2.ItemType, StringComparison.OrdinalIgnoreCase)); + } + + void EvaluateTargets (IEnumerable<ProjectElement> elements) + { + foreach (var child in elements) { + var te = child as ProjectTargetElement; + if (te != null) + this.targets.Add (te.Name, new ProjectTargetInstance (te)); + } + } + + IEnumerable<ProjectElement> Import (ProjectImportElement import) + { + string dir = ProjectCollection.GetEvaluationTimeThisFileDirectory (() => FullPath); + string path = WindowsCompatibilityExtensions.NormalizeFilePath (ExpandString (import.Project)); + path = Path.IsPathRooted (path) ? path : dir != null ? Path.Combine (dir, path) : Path.GetFullPath (path); + if (ProjectCollection.OngoingImports.Contains (path)) { + switch (load_settings) { + case ProjectLoadSettings.RejectCircularImports: + throw new InvalidProjectFileException (import.Location, null, string.Format ("Circular imports was detected: {0} (resolved as \"{1}\") is already on \"importing\" stack", import.Project, path)); + } + return new ProjectElement [0]; // do not import circular references + } + ProjectCollection.OngoingImports.Push (path); + try { + using (var reader = XmlReader.Create (path)) { + var root = ProjectRootElement.Create (reader, ProjectCollection); + raw_imports.Add (new ResolvedImport (import, root, true)); + return this.EvaluatePropertiesAndImports (root.Children).ToArray (); + } + } finally { + ProjectCollection.OngoingImports.Pop (); + } + } + + public ICollection<ProjectItem> GetItemsIgnoringCondition (string itemType) + { + return new CollectionFromEnumerable<ProjectItem> (raw_items.Where (p => p.ItemType.Equals (itemType, StringComparison.OrdinalIgnoreCase))); + } + + public void RemoveItems (IEnumerable<ProjectItem> items) + { + var removal = new List<ProjectItem> (items); + foreach (var item in removal) { + var parent = item.Xml.Parent; + parent.RemoveChild (item.Xml); + if (parent.Count == 0) + parent.Parent.RemoveChild (parent); + } + } + + static readonly Dictionary<string, string> empty_metadata = new Dictionary<string, string> (); + + public IList<ProjectItem> AddItem (string itemType, string unevaluatedInclude) + { + return AddItem (itemType, unevaluatedInclude, empty_metadata); + } + + public IList<ProjectItem> AddItem (string itemType, string unevaluatedInclude, + IEnumerable<KeyValuePair<string, string>> metadata) + { + // FIXME: needs several check that AddItemFast() does not process (see MSDN for details). + + return AddItemFast (itemType, unevaluatedInclude, metadata); + } + + public IList<ProjectItem> AddItemFast (string itemType, string unevaluatedInclude) + { + return AddItemFast (itemType, unevaluatedInclude, empty_metadata); + } + + public IList<ProjectItem> AddItemFast (string itemType, string unevaluatedInclude, + IEnumerable<KeyValuePair<string, string>> metadata) + { + throw new NotImplementedException (); + } + + static readonly char [] target_sep = new char[] {';'}; + + public bool Build () + { + return Build (Xml.DefaultTargets.Split (target_sep, StringSplitOptions.RemoveEmptyEntries)); + } + + public bool Build (IEnumerable<ILogger> loggers) + { + return Build (Xml.DefaultTargets.Split (target_sep, StringSplitOptions.RemoveEmptyEntries), loggers); + } + + public bool Build (string target) + { + return string.IsNullOrWhiteSpace (target) ? Build () : Build (new string [] {target}); + } + + public bool Build (string[] targets) + { + return Build (targets, new ILogger [0]); + } + + public bool Build (ILogger logger) + { + return Build (Xml.DefaultTargets.Split (target_sep, StringSplitOptions.RemoveEmptyEntries), new ILogger [] {logger}); + } + + public bool Build (string[] targets, IEnumerable<ILogger> loggers) + { + return Build (targets, loggers, new ForwardingLoggerRecord [0]); + } + + public bool Build (IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) + { + return Build (Xml.DefaultTargets.Split (target_sep, StringSplitOptions.RemoveEmptyEntries), loggers, remoteLoggers); + } + + public bool Build (string target, IEnumerable<ILogger> loggers) + { + return Build (new string [] { target }, loggers); + } + + public bool Build (string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) + { + // Unlike ProjectInstance.Build(), there is no place to fill outputs by targets, so ignore them + // (i.e. we don't use the overload with output). + // + // This does not check FullPath, so don't call GetProjectInstanceForBuild() directly. + return new BuildManager ().GetProjectInstanceForBuildInternal (this).Build (targets, loggers, remoteLoggers); + } + + public bool Build (string target, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) + { + return Build (new string [] { target }, loggers, remoteLoggers); + } + + public ProjectInstance CreateProjectInstance () + { + var ret = new ProjectInstance (Xml, GlobalProperties, ToolsVersion, ProjectCollection); + // FIXME: maybe fill other properties to the result. + return ret; + } + + bool Evaluate (string unexpandedValue) + { + return string.IsNullOrWhiteSpace (unexpandedValue) || new ExpressionEvaluator (this, null).EvaluateAsBoolean (unexpandedValue); + } + + public string ExpandString (string unexpandedValue) + { + return ExpandString (unexpandedValue, null); + } + + string ExpandString (string unexpandedValue, string replacementForMissingStuff) + { + return new ExpressionEvaluator (this, replacementForMissingStuff).Evaluate (unexpandedValue); + } + + public static string GetEvaluatedItemIncludeEscaped (ProjectItem item) + { + return ProjectCollection.Escape (item.EvaluatedInclude); + } + + public static string GetEvaluatedItemIncludeEscaped (ProjectItemDefinition item) + { + // ?? ItemDefinition does not have Include attribute. What's the point here? + throw new NotImplementedException (); + } + + public ICollection<ProjectItem> GetItems (string itemType) + { + return new CollectionFromEnumerable<ProjectItem> (Items.Where (p => p.ItemType.Equals (itemType, StringComparison.OrdinalIgnoreCase))); + } + + public ICollection<ProjectItem> GetItemsByEvaluatedInclude (string evaluatedInclude) + { + return new CollectionFromEnumerable<ProjectItem> (Items.Where (p => p.EvaluatedInclude.Equals (evaluatedInclude, StringComparison.OrdinalIgnoreCase))); + } + + public IEnumerable<ProjectElement> GetLogicalProject () + { + throw new NotImplementedException (); + } + + public static string GetMetadataValueEscaped (ProjectMetadata metadatum) + { + return ProjectCollection.Escape (metadatum.EvaluatedValue); + } + + public static string GetMetadataValueEscaped (ProjectItem item, string name) + { + var md = item.Metadata.FirstOrDefault (m => m.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + return md != null ? ProjectCollection.Escape (md.EvaluatedValue) : null; + } + + public static string GetMetadataValueEscaped (ProjectItemDefinition item, string name) + { + var md = item.Metadata.FirstOrDefault (m => m.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + return md != null ? ProjectCollection.Escape (md.EvaluatedValue) : null; + } + + public string GetPropertyValue (string name) + { + var prop = GetProperty (name); + return prop != null ? prop.EvaluatedValue : string.Empty; + } + + public static string GetPropertyValueEscaped (ProjectProperty property) + { + // WTF happens here. + //return ProjectCollection.Escape (property.EvaluatedValue); + return property.EvaluatedValue; + } + + public ProjectProperty GetProperty (string name) + { + return properties.FirstOrDefault (p => p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + } + + public void MarkDirty () + { + if (!DisableMarkDirty) + is_dirty = true; + } + + public void ReevaluateIfNecessary () + { + throw new NotImplementedException (); + } + + public bool RemoveGlobalProperty (string name) + { + throw new NotImplementedException (); + } + + public bool RemoveItem (ProjectItem item) + { + throw new NotImplementedException (); + } + + public bool RemoveProperty (ProjectProperty property) + { + var removed = properties.FirstOrDefault (p => p.Name.Equals (property.Name, StringComparison.OrdinalIgnoreCase)); + if (removed == null) + return false; + properties.Remove (removed); + return true; + } + + public void Save () + { + Xml.Save (); + } + + public void Save (TextWriter writer) + { + Xml.Save (writer); + } + + public void Save (string path) + { + Save (path, Encoding.Default); + } + + public void Save (Encoding encoding) + { + Save (FullPath, encoding); + } + + public void Save (string path, Encoding encoding) + { + using (var writer = new StreamWriter (path, false, encoding)) + Save (writer); + } + + public void SaveLogicalProject (TextWriter writer) + { + throw new NotImplementedException (); + } + + public bool SetGlobalProperty (string name, string escapedValue) + { + throw new NotImplementedException (); + } + + public ProjectProperty SetProperty (string name, string unevaluatedValue) + { + var p = new ManuallyAddedProjectProperty (this, name, unevaluatedValue); + properties.Add (p); + return p; + } + + public ICollection<ProjectMetadata> AllEvaluatedItemDefinitionMetadata { + get { throw new NotImplementedException (); } + } + + public ICollection<ProjectItem> AllEvaluatedItems { + get { return all_evaluated_items; } + } + + public ICollection<ProjectProperty> AllEvaluatedProperties { + get { return properties; } + } + + public IDictionary<string, List<string>> ConditionedProperties { + get { + // this property returns different instances every time. + var dic = new Dictionary<string, List<string>> (); + + // but I dunno HOW this evaluates + + throw new NotImplementedException (); + } + } + + public string DirectoryPath { + get { return dir_path; } + } + + public bool DisableMarkDirty { get; set; } + + public int EvaluationCounter { + get { throw new NotImplementedException (); } + } + + public string FullPath { + get { return Xml.FullPath; } + set { Xml.FullPath = value; } + } + + class ResolvedImportComparer : IEqualityComparer<ResolvedImport> + { + public static ResolvedImportComparer Instance = new ResolvedImportComparer (); + + public bool Equals (ResolvedImport x, ResolvedImport y) + { + return x.ImportedProject.FullPath.Equals (y.ImportedProject.FullPath); + } + public int GetHashCode (ResolvedImport obj) + { + return obj.ImportedProject.FullPath.GetHashCode (); + } + } + + public IList<ResolvedImport> Imports { + get { return raw_imports.Distinct (ResolvedImportComparer.Instance).ToList (); } + } + + public IList<ResolvedImport> ImportsIncludingDuplicates { + get { return raw_imports; } + } + + public bool IsBuildEnabled { + get { return ProjectCollection.IsBuildEnabled; } + } + + bool is_dirty; + public bool IsDirty { + get { return is_dirty; } + } + + public IDictionary<string, ProjectItemDefinition> ItemDefinitions { + get { return item_definitions; } + } + + [MonoTODO ("should be different from AllEvaluatedItems")] + public ICollection<ProjectItem> Items { + get { return AllEvaluatedItems; } + } + + public ICollection<ProjectItem> ItemsIgnoringCondition { + get { return raw_items; } + } + + public ICollection<string> ItemTypes { + get { return new CollectionFromEnumerable<string> (raw_items.Select (i => i.ItemType).Distinct ()); } + } + + [MonoTODO ("should be different from AllEvaluatedProperties")] + public ICollection<ProjectProperty> Properties { + get { return AllEvaluatedProperties; } + } + + public bool SkipEvaluation { get; set; } + + public IDictionary<string, ProjectTargetInstance> Targets { + get { return targets; } + } + + // These are required for reserved property, represents dynamically changing property values. + // This should resolve to either the project file path or that of the imported file. + internal string GetEvaluationTimeThisFileDirectory () + { + var file = GetEvaluationTimeThisFile (); + var dir = Path.IsPathRooted (file) ? Path.GetDirectoryName (file) : Directory.GetCurrentDirectory (); + return dir + Path.DirectorySeparatorChar; + } + + internal string GetEvaluationTimeThisFile () + { + return ProjectCollection.OngoingImports.Count > 0 ? ProjectCollection.OngoingImports.Peek () : FullPath ?? string.Empty; + } + + internal string GetFullPath (string pathRelativeToProject) + { + if (Path.IsPathRooted (pathRelativeToProject)) + return pathRelativeToProject; + return Path.GetFullPath (Path.Combine (DirectoryPath, pathRelativeToProject)); + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/WriteHandler.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectChangedEventArgs.cs index 29ce75c414..5372642ae0 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/WriteHandler.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectChangedEventArgs.cs @@ -1,9 +1,10 @@ -// WriteHandler.cs +// +// ProjectChangedEventArgs.cs // // Author: -// Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto <atsushi@xamarin.com> // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -15,7 +16,7 @@ // // 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 @@ -25,8 +26,17 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace Microsoft.Build.Logging +using System; +using System.Linq; + +namespace Microsoft.Build.Evaluation { - public delegate void WriteHandler (string message); + public class ProjectChangedEventArgs : EventArgs + { + internal ProjectChangedEventArgs (Project project) + { + Project = project; + } + public Project Project { get; private set; } + } } - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs index f5b2826961..ab3ee06638 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs @@ -4,9 +4,10 @@ // Author: // Leszek Ciesielski (skolima@gmail.com) // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // // (C) 2011 Leszek Ciesielski -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -29,97 +30,468 @@ // using Microsoft.Build.Construction; +using Microsoft.Build.Execution; using Microsoft.Build.Framework; using Microsoft.Build.Logging; - +using Microsoft.Build.Utilities; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Xml; +using System.Reflection; +using System.Globalization; namespace Microsoft.Build.Evaluation { - public class ProjectCollection : IDisposable - { - public ProjectCollection () - { - } - - public ProjectCollection (IDictionary<string, string> globalProperties) - : this (globalProperties, null, ToolsetDefinitionLocations.Registry | ToolsetDefinitionLocations.ConfigurationFile) - { - } - - public ProjectCollection (ToolsetDefinitionLocations toolsetDefinitionLocations) - : this (null, null, toolsetDefinitionLocations) - { - } - - public ProjectCollection (IDictionary<string, string> globalProperties, IEnumerable<ILogger> loggers, - ToolsetDefinitionLocations toolsetDefinitionLocations) - : this (globalProperties, loggers, null, toolsetDefinitionLocations, 1, false) - { - } - - public ProjectCollection (IDictionary<string, string> globalProperties, - IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, - ToolsetDefinitionLocations toolsetDefinitionLocations, - int maxNodeCount, bool onlyLogCriticalEvents) - { - throw new NotImplementedException (); - } - - public static string Escape (string unescapedString) - { - return unescapedString; - } - - public static ProjectCollection GlobalProjectCollection { - get { return globalProjectCollection; } - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (disposing) { - } - } - - static ProjectCollection globalProjectCollection = new ProjectCollection (); - - public ICollection<Project> GetLoadedProjects (string fullPath) - { - throw new NotImplementedException (); - } - - public ToolsetDefinitionLocations ToolsetLocations { - get { throw new NotImplementedException (); } - } + public class ProjectCollection : IDisposable + { + public delegate void ProjectAddedEventHandler (object target, ProjectAddedToProjectCollectionEventArgs args); + + public class ProjectAddedToProjectCollectionEventArgs : EventArgs + { + public ProjectAddedToProjectCollectionEventArgs (ProjectRootElement project) + { + if (project == null) + throw new ArgumentNullException ("project"); + ProjectRootElement = project; + } + + public ProjectRootElement ProjectRootElement { get; private set; } + } + + // static members + + static readonly ProjectCollection global_project_collection; + + static ProjectCollection () + { + #if NET_4_5 + global_project_collection = new ProjectCollection (new ReadOnlyDictionary<string, string> (new Dictionary<string, string> ())); + #else + global_project_collection = new ProjectCollection (new Dictionary<string, string> ()); + #endif + } + + public static string Escape (string unescapedString) + { + return Mono.XBuild.Utilities.MSBuildUtils.Escape (unescapedString); + } + + public static string Unescape (string escapedString) + { + return Mono.XBuild.Utilities.MSBuildUtils.Unescape (escapedString); + } + + public static ProjectCollection GlobalProjectCollection { + get { return global_project_collection; } + } + + // semantic model part + + public ProjectCollection () + : this (null) + { + } + + public ProjectCollection (IDictionary<string, string> globalProperties) + : this (globalProperties, null, ToolsetDefinitionLocations.Registry | ToolsetDefinitionLocations.ConfigurationFile) + { + } + public ProjectCollection (ToolsetDefinitionLocations toolsetDefinitionLocations) + : this (null, null, toolsetDefinitionLocations) + { + } + + public ProjectCollection (IDictionary<string, string> globalProperties, IEnumerable<ILogger> loggers, + ToolsetDefinitionLocations toolsetDefinitionLocations) + : this (globalProperties, loggers, null, toolsetDefinitionLocations, 1, false) + { + } + + public ProjectCollection (IDictionary<string, string> globalProperties, + IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, + ToolsetDefinitionLocations toolsetDefinitionLocations, + int maxNodeCount, bool onlyLogCriticalEvents) + { + global_properties = globalProperties ?? new Dictionary<string, string> (); + this.loggers = loggers != null ? loggers.ToList () : new List<ILogger> (); + toolset_locations = toolsetDefinitionLocations; + MaxNodeCount = maxNodeCount; + OnlyLogCriticalEvents = onlyLogCriticalEvents; + + LoadDefaultToolsets (); + } + + [MonoTODO ("not fired yet")] + public event ProjectAddedEventHandler ProjectAdded; + [MonoTODO ("not fired yet")] + public event EventHandler<ProjectChangedEventArgs> ProjectChanged; + [MonoTODO ("not fired yet")] + public event EventHandler<ProjectCollectionChangedEventArgs> ProjectCollectionChanged; + [MonoTODO ("not fired yet")] + public event EventHandler<ProjectXmlChangedEventArgs> ProjectXmlChanged; + + public void AddProject (Project project) + { + this.loaded_projects.Add (project); + if (ProjectAdded != null) + ProjectAdded (this, new ProjectAddedToProjectCollectionEventArgs (project.Xml)); + } + + public int Count { + get { return loaded_projects.Count; } + } + + string default_tools_version; + public string DefaultToolsVersion { + get { return default_tools_version; } + set { + if (GetToolset (value) == null) + throw new InvalidOperationException (string.Format ("Toolset '{0}' does not exist", value)); + default_tools_version = value; + } + } + + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + if (disposing) { + } + } + + public ICollection<Project> GetLoadedProjects (string fullPath) + { + return LoadedProjects.Where (p => p.FullPath != null && Path.GetFullPath (p.FullPath) == Path.GetFullPath (fullPath)).ToList (); + } + + readonly IDictionary<string, string> global_properties; + + public IDictionary<string, string> GlobalProperties { + get { return global_properties; } + } + + readonly List<Project> loaded_projects = new List<Project> (); + + public Project LoadProject (string fileName) + { + return LoadProject (fileName, DefaultToolsVersion); + } + + public Project LoadProject (string fileName, string toolsVersion) + { + return LoadProject (fileName, null, toolsVersion); + } + + public Project LoadProject (string fileName, IDictionary<string,string> globalProperties, string toolsVersion) + { + var ret = new Project (fileName, globalProperties, toolsVersion); + loaded_projects.Add (ret); + return ret; + } + + // These methods somehow don't add the project to ProjectCollection... + public Project LoadProject (XmlReader xmlReader) + { + return LoadProject (xmlReader, DefaultToolsVersion); + } + + public Project LoadProject (XmlReader xmlReader, string toolsVersion) + { + return LoadProject (xmlReader, null, toolsVersion); + } + + public Project LoadProject (XmlReader xmlReader, IDictionary<string,string> globalProperties, string toolsVersion) + { + return new Project (xmlReader, globalProperties, toolsVersion); + } + + public ICollection<Project> LoadedProjects { + get { return loaded_projects; } + } + + readonly List<ILogger> loggers = new List<ILogger> (); + [MonoTODO] + public ICollection<ILogger> Loggers { + get { return loggers; } + } + + [MonoTODO] + public bool OnlyLogCriticalEvents { get; set; } + + [MonoTODO] + public bool SkipEvaluation { get; set; } + + readonly ToolsetDefinitionLocations toolset_locations; + public ToolsetDefinitionLocations ToolsetLocations { + get { return toolset_locations; } + } + + readonly List<Toolset> toolsets = new List<Toolset> (); + // so what should we do without ToolLocationHelper in Microsoft.Build.Utilities.dll? There is no reference to it in this dll. public ICollection<Toolset> Toolsets { - get { throw new NotImplementedException (); } - } + // For ConfigurationFile and None, they cannot be added externally. + get { return (ToolsetLocations & ToolsetDefinitionLocations.Registry) != 0 ? toolsets : toolsets.ToList (); } + } + + public Toolset GetToolset (string toolsVersion) + { + return Toolsets.FirstOrDefault (t => t.ToolsVersion == toolsVersion); + } + + //FIXME: should also support config file, depending on ToolsetLocations + void LoadDefaultToolsets () + { + AddToolset (new Toolset ("2.0", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), this, null)); + AddToolset (new Toolset ("3.0", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version30), this, null)); + AddToolset (new Toolset ("3.5", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35), this, null)); +#if NET_4_0 + AddToolset (new Toolset ("4.0", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40), this, null)); +#endif +#if XBUILD_12 + AddToolset (new Toolset ("12.0", ToolLocationHelper.GetPathToBuildTools ("12.0"), this, null)); +#endif + default_tools_version = toolsets.First ().ToolsVersion; + } + + [MonoTODO ("not verified at all")] + public void AddToolset (Toolset toolset) + { + toolsets.Add (toolset); + } + + [MonoTODO ("not verified at all")] + public void RemoveAllToolsets () + { + toolsets.Clear (); + } + + [MonoTODO ("not verified at all")] + public void RegisterLogger (ILogger logger) + { + loggers.Add (logger); + } + + [MonoTODO ("not verified at all")] + public void RegisterLoggers (IEnumerable<ILogger> loggers) + { + foreach (var logger in loggers) + this.loggers.Add (logger); + } public void UnloadAllProjects () { - throw new NotImplementedException (); + throw new NotImplementedException (); } + [MonoTODO ("Not verified at all")] public void UnloadProject (Project project) { - throw new NotImplementedException (); + this.loaded_projects.Remove (project); } + [MonoTODO ("Not verified at all")] public void UnloadProject (ProjectRootElement projectRootElement) { - throw new NotImplementedException (); + foreach (var proj in loaded_projects.Where (p => p.Xml == projectRootElement).ToArray ()) + UnloadProject (proj); } public static Version Version { - get { throw new NotImplementedException (); } - } - } + get { throw new NotImplementedException (); } + } + + // Execution part + + [MonoTODO] + public bool DisableMarkDirty { get; set; } + + [MonoTODO] + public HostServices HostServices { get; set; } + + [MonoTODO] + public bool IsBuildEnabled { get; set; } + + internal string BuildStartupDirectory { get; set; } + + internal int MaxNodeCount { get; private set; } + + Stack<string> ongoing_imports = new Stack<string> (); + + internal Stack<string> OngoingImports { + get { return ongoing_imports; } + } + + // common part + internal static IEnumerable<EnvironmentProjectProperty> GetWellKnownProperties (Project project) + { + Func<string,string,EnvironmentProjectProperty> create = (name, value) => new EnvironmentProjectProperty (project, name, value, true); + return GetWellKnownProperties (create); + } + + internal static IEnumerable<ProjectPropertyInstance> GetWellKnownProperties (ProjectInstance project) + { + Func<string,string,ProjectPropertyInstance> create = (name, value) => new ProjectPropertyInstance (name, true, value); + return GetWellKnownProperties (create); + } + + static IEnumerable<T> GetWellKnownProperties<T> (Func<string,string,T> create) + { + var ext = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath") ?? DefaultExtensionsPath; + yield return create ("MSBuildExtensionsPath", ext); + var ext32 = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath32") ?? DefaultExtensionsPath; + yield return create ("MSBuildExtensionsPath32", ext32); + var ext64 = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath64") ?? DefaultExtensionsPath; + yield return create ("MSBuildExtensionsPath64", ext64); + } + + static string extensions_path; + internal static string DefaultExtensionsPath { + get { + if (extensions_path == null) { + // NOTE: code from mcs/tools/gacutil/driver.cs + PropertyInfo gac = typeof (System.Environment).GetProperty ( + "GacPath", BindingFlags.Static | BindingFlags.NonPublic); + + if (gac != null) { + MethodInfo get_gac = gac.GetGetMethod (true); + string gac_path = (string) get_gac.Invoke (null, null); + extensions_path = Path.GetFullPath (Path.Combine ( + gac_path, Path.Combine ("..", "xbuild"))); + } + } + return extensions_path; + } + } + + internal IEnumerable<ReservedProjectProperty> GetReservedProperties (Toolset toolset, Project project) + { + Func<string,Func<string>,ReservedProjectProperty> create = (name, value) => new ReservedProjectProperty (project, name, value); + return GetReservedProperties<ReservedProjectProperty> (toolset, project.Xml, create, () => project.FullPath); + } + + internal IEnumerable<ProjectPropertyInstance> GetReservedProperties (Toolset toolset, ProjectInstance project, ProjectRootElement xml) + { + Func<string,Func<string>,ProjectPropertyInstance> create = (name, value) => new ProjectPropertyInstance (name, true, null, value); + return GetReservedProperties<ProjectPropertyInstance> (toolset, xml, create, () => project.FullPath); + } + + // seealso http://msdn.microsoft.com/en-us/library/ms164309.aspx + IEnumerable<T> GetReservedProperties<T> (Toolset toolset, ProjectRootElement project, Func<string,Func<string>,T> create, Func<string> projectFullPath) + { + yield return create ("MSBuildBinPath", () => toolset.ToolsPath); + // FIXME: add MSBuildLastTaskResult + // FIXME: add MSBuildNodeCount + // FIXME: add MSBuildProgramFiles32 + yield return create ("MSBuildProjectDefaultTargets", () => project.DefaultTargets); + yield return create ("MSBuildProjectDirectory", () => project.DirectoryPath + Path.DirectorySeparatorChar); + yield return create ("MSBuildProjectDirectoryNoRoot", () => project.DirectoryPath.Substring (Path.GetPathRoot (project.DirectoryPath).Length)); + yield return create ("MSBuildProjectExtension", () => Path.GetExtension (project.FullPath)); + yield return create ("MSBuildProjectFile", () => Path.GetFileName (project.FullPath)); + yield return create ("MSBuildProjectFullPath", () => project.FullPath); + yield return create ("MSBuildProjectName", () => Path.GetFileNameWithoutExtension (project.FullPath)); + yield return create ("MSBuildStartupDirectory", () => BuildStartupDirectory); + yield return create ("MSBuildThisFile", () => Path.GetFileName (GetEvaluationTimeThisFile (projectFullPath))); + yield return create ("MSBuildThisFileFullPath", () => GetEvaluationTimeThisFile (projectFullPath)); + yield return create ("MSBuildThisFileName", () => Path.GetFileNameWithoutExtension (GetEvaluationTimeThisFile (projectFullPath))); + yield return create ("MSBuildThisFileExtension", () => Path.GetExtension (GetEvaluationTimeThisFile (projectFullPath))); + + yield return create ("MSBuildThisFileDirectory", () => Path.GetDirectoryName (GetEvaluationTimeThisFileDirectory (projectFullPath))); + yield return create ("MSBuildThisFileDirectoryNoRoot", () => { + string dir = GetEvaluationTimeThisFileDirectory (projectFullPath) + Path.DirectorySeparatorChar; + return dir.Substring (Path.GetPathRoot (dir).Length); + }); + yield return create ("MSBuildToolsPath", () => toolset.ToolsPath); + yield return create ("MSBuildToolsVersion", () => toolset.ToolsVersion); + } + + // These are required for reserved property, represents dynamically changing property values. + // This should resolve to either the project file path or that of the imported file. + internal string GetEvaluationTimeThisFileDirectory (Func<string> nonImportingTimeFullPath) + { + var file = GetEvaluationTimeThisFile (nonImportingTimeFullPath); + var dir = Path.IsPathRooted (file) ? Path.GetDirectoryName (file) : Directory.GetCurrentDirectory (); + return dir + Path.DirectorySeparatorChar; + } + + internal string GetEvaluationTimeThisFile (Func<string> nonImportingTimeFullPath) + { + return OngoingImports.Count > 0 ? OngoingImports.Peek () : (nonImportingTimeFullPath () ?? string.Empty); + } + + static readonly char [] item_target_sep = {';'}; + + internal static IEnumerable<T> GetAllItems<T> (Func<string,string> expandString, string include, string exclude, Func<string,T> creator, Func<string,ITaskItem> taskItemCreator, string directory, Action<T,string> assignRecurse, Func<ITaskItem,bool> isDuplicate) + { + var includes = expandString (include).Trim ().Split (item_target_sep, StringSplitOptions.RemoveEmptyEntries); + var excludes = expandString (exclude).Trim ().Split (item_target_sep, StringSplitOptions.RemoveEmptyEntries); + + if (includes.Length == 0) + yield break; + if (includes.Length == 1 && includes [0].IndexOf ('*') < 0 && excludes.Length == 0) { + // for most case - shortcut. + var item = creator (includes [0]); + yield return item; + } else { + var ds = new Microsoft.Build.BuildEngine.DirectoryScanner () { + BaseDirectory = new DirectoryInfo (directory), + Includes = includes.Where (s => !string.IsNullOrWhiteSpace (s)).Select (i => taskItemCreator (i)).ToArray (), + Excludes = excludes.Where (s => !string.IsNullOrWhiteSpace (s)).Select (e => taskItemCreator (e)).ToArray (), + }; + ds.Scan (); + foreach (var taskItem in ds.MatchedItems) { + if (isDuplicate (taskItem)) + continue; // skip duplicate + var item = creator (taskItem.ItemSpec); + string recurse = taskItem.GetMetadata ("RecursiveDir"); + assignRecurse (item, recurse); + yield return item; + } + } + } + + static readonly char [] path_sep = {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}; + + internal static string GetWellKnownMetadata (string name, string file, Func<string,string> getFullPath, string recursiveDir) + { + switch (name.ToLower (CultureInfo.InvariantCulture)) { + case "fullpath": + return getFullPath (file); + case "rootdir": + return Path.GetPathRoot (getFullPath (file)); + case "filename": + return Path.GetFileNameWithoutExtension (file); + case "extension": + return Path.GetExtension (file); + case "relativedir": + var idx = file.LastIndexOfAny (path_sep); + return idx < 0 ? string.Empty : file.Substring (0, idx + 1); + case "directory": + var fp = getFullPath (file); + return Path.GetDirectoryName (fp).Substring (Path.GetPathRoot (fp).Length); + case "recursivedir": + return recursiveDir; + case "identity": + return file; + case "modifiedtime": + return new FileInfo (getFullPath (file)).LastWriteTime.ToString ("yyyy-MM-dd HH:mm:ss.fffffff"); + case "createdtime": + return new FileInfo (getFullPath (file)).CreationTime.ToString ("yyyy-MM-dd HH:mm:ss.fffffff"); + case "accessedtime": + return new FileInfo (getFullPath (file)).LastAccessTime.ToString ("yyyy-MM-dd HH:mm:ss.fffffff"); + } + return null; + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollectionChangedEventArgs.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollectionChangedEventArgs.cs new file mode 100644 index 0000000000..a4e8ee90d7 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollectionChangedEventArgs.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Evaluation +{ + public class ProjectCollectionChangedEventArgs : EventArgs + { + public ProjectCollectionChangedEventArgs (ProjectCollectionChangedState state) + { + State = state; + } + + public ProjectCollectionChangedState State { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollectionChangedState.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollectionChangedState.cs new file mode 100644 index 0000000000..683080f13e --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollectionChangedState.cs @@ -0,0 +1,19 @@ +using System; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Evaluation +{ + public enum ProjectCollectionChangedState + { + DefaultToolsVersion, + DisableMarkDirty, + GlobalProperties, + HostServices, + IsBuildEnabled, + Loggers, + OnlyLogCriticalEvents, + SkipEvaluation, + Toolsets + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItem.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItem.cs index 393995e80c..cc187f9b94 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItem.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItem.cs @@ -4,9 +4,10 @@ // Author: // Leszek Ciesielski (skolima@gmail.com) // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // // (C) 2011 Leszek Ciesielski -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -31,88 +32,126 @@ using System; using System.Collections.Generic; using System.Diagnostics; - +using System.Linq; using Microsoft.Build.Construction; +using System.IO; +using Microsoft.Build.Framework; namespace Microsoft.Build.Evaluation { - [DebuggerDisplay("{ItemType}={EvaluatedInclude} [{UnevaluatedInclude}] #DirectMetadata={DirectMetadataCount}")] - public class ProjectItem - { - internal ProjectItem (ProjectItemElement xml) - { - Xml = xml; - } - - public ProjectMetadata GetMetadata (string name) - { - throw new NotImplementedException (); - } - - public string GetMetadataValue (string name) - { - throw new NotImplementedException (); - } - - public bool HasMetadata (string name) - { - throw new NotImplementedException (); - } - - public bool RemoveMetadata (string name) - { - throw new NotImplementedException (); - } - - public void Rename (string name) - { - throw new NotImplementedException (); - } - - public void SetMetadataValue (string name, string unevaluatedValue) - { - throw new NotImplementedException (); - } - - public IEnumerable<ProjectMetadata> DirectMetadata { - get { throw new NotImplementedException (); } - } - - public int DirectMetadataCount { - get { throw new NotImplementedException (); } - } - - public string EvaluatedInclude { - get { throw new NotImplementedException (); } - } - - public bool IsImported { - get { throw new NotImplementedException (); } - } - - public string ItemType { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public ICollection<ProjectMetadata> Metadata { - get { throw new NotImplementedException (); } - } - - public int MetadataCount { - get { throw new NotImplementedException (); } - } - - public Project Project { - get { throw new NotImplementedException (); } - } - - public string UnevaluatedInclude { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public ProjectItemElement Xml { get; private set; } - - } + [DebuggerDisplay ("{ItemType}={EvaluatedInclude} [{UnevaluatedInclude}] #DirectMetadata={DirectMetadataCount}")] + public class ProjectItem + { + internal ProjectItem (Project project, ProjectItemElement xml, string evaluatedInclude) + { + this.project = project; + this.xml = xml; + if (project.ItemDefinitions.ContainsKey (ItemType)) + foreach (var md in project.ItemDefinitions [ItemType].Metadata) + metadata.Add (md); + foreach (var md in xml.Metadata) + metadata.Add (new ProjectMetadata (project, ItemType, metadata, m => metadata.Remove (m), md)); + this.evaluated_include = evaluatedInclude; + is_imported = project.ProjectCollection.OngoingImports.Any (); + } + + readonly Project project; + readonly ProjectItemElement xml; + readonly List<ProjectMetadata> metadata = new List<ProjectMetadata> (); + readonly bool is_imported; + readonly string evaluated_include; + + internal string RecursiveDir { get; set; } + + public ProjectMetadata GetMetadata (string name) + { + return metadata.FirstOrDefault (m => m.Name == name); + } + + public string GetMetadataValue (string name) + { + if (name == null) + throw new ArgumentNullException ("name"); + var wk = ProjectCollection.GetWellKnownMetadata (name, EvaluatedInclude, project.GetFullPath, RecursiveDir); + if (wk != null) + return wk; + var m = GetMetadata (name); + return m != null ? m.EvaluatedValue : string.Empty; + } + + public bool HasMetadata (string name) + { + return GetMetadata (name) != null; + } + + public bool RemoveMetadata (string name) + { + var m = GetMetadata (name); + if (m == null) + return false; + return metadata.Remove (m); + } + + public void Rename (string name) + { + throw new NotImplementedException (); + } + + public ProjectMetadata SetMetadataValue (string name, string unevaluatedValue) + { + // This has to do several tasks: + // - it cannot directly change Xml.Metadata because the ProjectItemElement might be shared + // among multiple ProjectItems. + // - hence it has to create another ProjectItemElement instance and add it to the project + // XML construction, with specific Include value that is assigned to this instance, and + // metadata values that are assigned to this instance. + throw new NotImplementedException (); + } + + public IEnumerable<ProjectMetadata> DirectMetadata { + get { + var list = new List<ProjectMetadata> (); + foreach (var xm in xml.Metadata) + yield return new ProjectMetadata (project, ItemType, list, p => list.Remove (p), xm); + } + } + + public int DirectMetadataCount { + get { return xml.Metadata.Count; } + } + + public string EvaluatedInclude { + get { return evaluated_include; } + } + + public bool IsImported { + get { return is_imported; } + } + + public string ItemType { + get { return Xml.ItemType; } + set { Xml.ItemType = value; } + } + + public ICollection<ProjectMetadata> Metadata { + get { return metadata; } + } + + public int MetadataCount { + get { return metadata.Count; } + } + + public Project Project { + get { return project; } + } + + public string UnevaluatedInclude { + get { return Xml.Include; } + set { Xml.Include = value; } + } + + public ProjectItemElement Xml { + get { return xml; } + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItemDefinition.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItemDefinition.cs index 13ef541bc6..faa880603b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItemDefinition.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectItemDefinition.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,15 +27,43 @@ // using System; +using System.Collections.Generic; +using Microsoft.Build.Construction; namespace Microsoft.Build.Evaluation { - public class ProjectItemDefinition - { - private ProjectItemDefinition () - { - throw new NotImplementedException (); - } - } -} + public class ProjectItemDefinition + { + internal ProjectItemDefinition (Project project, string itemType) + { + this.project = project; + this.item_type = itemType; + } + + Project project; + string item_type; + List<ProjectMetadata> metadata = new List<ProjectMetadata> (); + + public string ItemType { + get { return item_type; } + } + public IEnumerable<ProjectMetadata> Metadata { + get { return metadata; } + } + + public int MetadataCount { + get { return metadata.Count; } + } + + public Project Project { + get { return project; } + } + + internal void AddItems (ProjectItemDefinitionElement xml) + { + foreach (var item in xml.Metadata) + metadata.Add (new ProjectMetadata (project, ItemType, metadata, m => metadata.Remove (m), item)); + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs index 45001f61a2..880a0e336b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,49 +27,62 @@ // using Microsoft.Build.Construction; - using System; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Build.Evaluation { - public class ProjectMetadata - { - private ProjectMetadata () - { - throw new NotImplementedException (); - } + public class ProjectMetadata + { + internal ProjectMetadata (Project project, string itemType, IEnumerable<ProjectMetadata> existingMetadata, Action<ProjectMetadata> remover, ProjectMetadataElement xml) + { + this.xml = xml; + this.project = project; + item_type = itemType; + predecessor = existingMetadata.FirstOrDefault (m => m.Name == xml.Name); + if (predecessor != null) + remover (predecessor); + is_imported = Project.ProjectCollection.OngoingImports.Any (); + } + + readonly Project project; + readonly string item_type; + readonly ProjectMetadataElement xml; + readonly ProjectMetadata predecessor; + readonly bool is_imported; - public string EvaluatedValue { - get { throw new NotImplementedException (); } - } + public string EvaluatedValue { + get { return project.ExpandString (xml.Value); } + } - public bool IsImported { - get { throw new NotImplementedException (); } - } + public bool IsImported { + get { return is_imported; } + } - public string ItemType { - get { throw new NotImplementedException (); } - } + public string ItemType { + get { return item_type; } + } - public string Name { - get { throw new NotImplementedException (); } - } + public string Name { + get { return xml.Name; } + } - public ProjectMetadata Predecessor { - get { throw new NotImplementedException (); } - } + public ProjectMetadata Predecessor { + get { return predecessor; } + } - public Project Project { - get { throw new NotImplementedException (); } - } + public Project Project { + get { return project; } + } - public string UnevaluatedValue { - get { throw new NotImplementedException (); } - } + public string UnevaluatedValue { + get { return xml.Value; } + } - public ProjectMetadataElement Xml { - get { throw new NotImplementedException (); } - } - } + public ProjectMetadataElement Xml { + get { return xml; } + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectProperty.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectProperty.cs index e9d557f3e0..757b40f3ce 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectProperty.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectProperty.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,7 +27,12 @@ // using System; +using System.Linq; using Microsoft.Build.Construction; +using Microsoft.Build.Internal; +using System.Collections.Generic; +using System.Reflection; +using System.IO; namespace Microsoft.Build.Evaluation { @@ -34,39 +40,249 @@ namespace Microsoft.Build.Evaluation // members are abstract and had been there since 4.0. // I take this as doc bug, as non-abstract to abstract is a // breaking change and I'd rather believe API designer's sanity. - public abstract class ProjectProperty - { - internal ProjectProperty () // hide default ctor + public abstract class ProjectProperty + { + internal ProjectProperty (Project project) // hide default ctor { + Project = project; } - public string EvaluatedValue { - get { - throw new NotImplementedException (); - } - } + public string EvaluatedValue { + get { return InternalEvaluatedValue; } + } public abstract bool IsEnvironmentProperty { get; } + public abstract bool IsGlobalProperty { get; } + + [MonoTODO] public abstract bool IsImported { get; } + public abstract bool IsReservedProperty { get; } - public string Name { - get { - throw new NotImplementedException (); - } + internal virtual bool IsWellKnownProperty { + get { return false; } } + public abstract string Name { get; } + public abstract ProjectProperty Predecessor { get; } - public Project Project { + public Project Project { get; private set; } + + public abstract string UnevaluatedValue { get; set; } + + public abstract ProjectPropertyElement Xml { get; } + + internal abstract string InternalEvaluatedValue { get; } + } + + // copy from MS.Build.Engine/BuildProperty.cs + internal enum PropertyType { + Reserved, + Global, + Normal, + Environment + } + + internal abstract class BaseProjectProperty : ProjectProperty + { + public BaseProjectProperty (Project project, PropertyType propertyType, string name) + : base (project) + { + property_type = propertyType; + this.name = name; + predecessor = project.Properties.FirstOrDefault (p => p.Name == name); + if (predecessor != null) + project.RemoveProperty (predecessor); + } + + PropertyType property_type; + + readonly string name; + public override string Name { + get { return name; } + } + + public override bool IsEnvironmentProperty { + get { return property_type == PropertyType.Environment; } + } + public override bool IsGlobalProperty { + get { return property_type == PropertyType.Global; } + } + public override bool IsImported { + get { return false; } + } + public override bool IsReservedProperty { + get { return property_type == PropertyType.Reserved; } + } + readonly ProjectProperty predecessor; + public override ProjectProperty Predecessor { + get { return predecessor; } + } + } + + internal abstract class ImmutableProjectProperty : BaseProjectProperty + { + public ImmutableProjectProperty (Project project, PropertyType propertyType, string name) + : base (project, propertyType, name) + { + } + + internal override string InternalEvaluatedValue { + get { return UnevaluatedValue; } + } + } + + internal abstract class MutableProjectProperty : BaseProjectProperty + { + public MutableProjectProperty (Project project, PropertyType propertyType, string name) + : base (project, propertyType, name) + { + } + + string evaluated_value; // see UpdateEvaluatedValue(). + internal void UpdateEvaluatedValue () + { + evaluated_value = Project.ExpandString (UnevaluatedValue); + } + + internal override string InternalEvaluatedValue { + get { return evaluated_value; } + } + } + + internal class XmlProjectProperty : MutableProjectProperty + { + public XmlProjectProperty (Project project, ProjectPropertyElement xml, PropertyType propertyType, bool isImported) + : base (project, propertyType, xml.Name) + { + this.xml = xml; + this.is_imported = isImported; + UpdateEvaluatedValue (); + } + + readonly ProjectPropertyElement xml; + readonly bool is_imported; + + public override bool IsImported { + get { return is_imported; } + } + + public override string UnevaluatedValue { + get { return xml.Value; } + set { xml.Value = value; } + } + + public override ProjectPropertyElement Xml { + get { return xml; } + } + } + + internal class EnvironmentProjectProperty : ImmutableProjectProperty + { + static string extensions_path; + internal static string DefaultExtensionsPath { get { - throw new NotImplementedException (); + if (extensions_path == null) { + // NOTE: code from mcs/tools/gacutil/driver.cs + PropertyInfo gac = typeof (System.Environment).GetProperty ( + "GacPath", BindingFlags.Static | BindingFlags.NonPublic); + + if (gac != null) { + MethodInfo get_gac = gac.GetGetMethod (true); + string gac_path = (string) get_gac.Invoke (null, null); + extensions_path = Path.GetFullPath (Path.Combine ( + gac_path, Path.Combine ("..", "xbuild"))); + } + } + return extensions_path; } } + + public EnvironmentProjectProperty (Project project, string name, string value, bool wellknown = false) + : base (project, PropertyType.Environment, name) + { + this.value = value; + this.wellknown = wellknown; + } + + readonly string value; + readonly bool wellknown; - public abstract string UnevaluatedValue { get; set; } - public abstract ProjectPropertyElement Xml { get; } - } -} + internal override bool IsWellKnownProperty { + get { return wellknown; } + } + // It can override possible another environment vairable property BUT never gives Predecessor. + public override ProjectProperty Predecessor { + get { return null; } + } + + public override string UnevaluatedValue { + get { return value; } + set { throw new InvalidOperationException (string.Format ("You cannot change value of environment property '{0}'.", Name)); } + } + public override ProjectPropertyElement Xml { + get { return null; } + } + } + + internal class GlobalProjectProperty : ImmutableProjectProperty + { + public GlobalProjectProperty (Project project, string name, string value) + : base (project, PropertyType.Global, name) + { + this.value = value; + } + + readonly string value; + + public override string UnevaluatedValue { + get { return value; } + set { throw new InvalidOperationException (string.Format ("You cannot change value of global property '{0}'.", Name)); } + } + public override ProjectPropertyElement Xml { + get { return null; } + } + } + + internal class ManuallyAddedProjectProperty : MutableProjectProperty + { + public ManuallyAddedProjectProperty (Project project, string name, string value) + : base (project, PropertyType.Normal, name) + { + this.UnevaluatedValue = value; + } + + public override string UnevaluatedValue { get; set; } + + public override ProjectPropertyElement Xml { + get { return null; } + } + } + + internal class ReservedProjectProperty : ImmutableProjectProperty + { + public ReservedProjectProperty (Project project, string name, Func<string> value) + : base (project, PropertyType.Reserved, name) + { + this.value = value; + } + + // make sure it does not give access to any possible attempted overrrides. + public override ProjectProperty Predecessor { + get { return null; } + } + + readonly Func<string> value; + public override string UnevaluatedValue { + get { return value (); } + set { throw new InvalidOperationException (string.Format ("You cannot change value of reserved property '{0}'.", Name)); } + } + + public override ProjectPropertyElement Xml { + get { return null; } + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ColorResetter.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectXmlChangedEventArgs.cs index 5bd3da3e7c..a0497a505a 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ColorResetter.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectXmlChangedEventArgs.cs @@ -1,9 +1,10 @@ -// ColorResetter.cs +// +// ProjectXmlChangedEventArgs.cs // // Author: -// Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto <atsushi@xamarin.com> // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -15,7 +16,7 @@ // // 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 @@ -25,8 +26,20 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace Microsoft.Build.Logging +using Microsoft.Build.Construction; +using System; +using System.Linq; + +namespace Microsoft.Build.Evaluation { - public delegate void ColorResetter (); + public class ProjectXmlChangedEventArgs : EventArgs + { + internal ProjectXmlChangedEventArgs (ProjectRootElement projectXml, string reason) + { + ProjectXml = projectXml; + Reason = reason; + } + public ProjectRootElement ProjectXml { get; private set; } + public string Reason { get; private set; } + } } - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ResolvedImport.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ResolvedImport.cs index 1e82c01a4c..8a5bed7437 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ResolvedImport.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ResolvedImport.cs @@ -26,24 +26,35 @@ // using Microsoft.Build.Construction; - using System; namespace Microsoft.Build.Evaluation { - [System.Runtime.InteropServices.StructLayout (System.Runtime.InteropServices.LayoutKind.Sequential)] - public struct ResolvedImport - { - private ProjectImportElement import; - private ProjectRootElement root; + [System.Runtime.InteropServices.StructLayout (System.Runtime.InteropServices.LayoutKind.Sequential)] + public struct ResolvedImport + { + internal ResolvedImport (ProjectImportElement import, ProjectRootElement root, bool isImported) + { + this.import = import; + this.root = root; + this.imported = isImported; + } + + readonly ProjectImportElement import; + readonly ProjectRootElement root; + readonly bool imported; - public ProjectImportElement ImportingElement { - get { return import; } - } + public ProjectImportElement ImportingElement { + get { return import; } + } - public ProjectRootElement ImportedProject { - get { return root; } - } - } + public ProjectRootElement ImportedProject { + get { return root; } + } + + public bool IsImported { + get { return imported; } + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/SubToolset.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/SubToolset.cs new file mode 100644 index 0000000000..0b4ad39224 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/SubToolset.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using Microsoft.Build.Execution; + +namespace Microsoft.Build.Evaluation +{ + #if NET_4_5 + public + #endif + class SubToolset + { + internal SubToolset (IDictionary<string, ProjectPropertyInstance> properties, string subToolsetVersion) + { + Properties = properties; + SubToolsetVersion = subToolsetVersion; + } + + public IDictionary<string, ProjectPropertyInstance> Properties { get; private set; } + public string SubToolsetVersion { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Toolset.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Toolset.cs index 9da377be35..b0182c53bb 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Toolset.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/Toolset.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -27,37 +28,54 @@ using System; using System.Collections.Generic; - +using System.Linq; using Microsoft.Build.Execution; namespace Microsoft.Build.Evaluation { - public class Toolset - { - public Toolset (string toolsVersion, string toolsPath, - ProjectCollection projectCollection, string msbuildOverrideTasksPath) - { - throw new NotImplementedException (); - } - - public Toolset (string toolsVersion, string toolsPath, - IDictionary<string, string> buildProperties, ProjectCollection projectCollection, - string msbuildOverrideTasksPath) - { - throw new NotImplementedException (); - } - - public IDictionary<string, ProjectPropertyInstance> Properties { - get { throw new NotImplementedException (); } - } - - public string ToolsPath { - get { throw new NotImplementedException (); } - } - - public string ToolsVersion { - get { throw new NotImplementedException (); } - } - } + public class Toolset + { + public Toolset (string toolsVersion, string toolsPath, + ProjectCollection projectCollection, string msbuildOverrideTasksPath) + : this (toolsVersion, toolsPath, null, projectCollection, msbuildOverrideTasksPath) + { + } + + public Toolset (string toolsVersion, string toolsPath, + IDictionary<string, string> buildProperties, ProjectCollection projectCollection, + string msbuildOverrideTasksPath) + : this (toolsVersion, toolsPath, buildProperties, projectCollection, null, msbuildOverrideTasksPath) + { + } + +#if NET_4_5 + public +#endif + Toolset (string toolsVersion, string toolsPath, IDictionary<string, string> buildProperties, + ProjectCollection projectCollection, IDictionary<string, SubToolset> subToolsets, + string msbuildOverrideTasksPath) + { + ToolsVersion = toolsVersion; + ToolsPath = toolsPath; + Properties = + buildProperties == null ? + new Dictionary<string, ProjectPropertyInstance> () : + buildProperties.Select (p => new ProjectPropertyInstance (p.Key, true, p.Value)).ToDictionary (e => e.Name); +#if NET_4_5 + SubToolsets = subToolsets ?? new Dictionary<string, SubToolset> (); +#endif + } + +#if NET_4_5 + public string DefaultSubToolsetVersion { get; private set; } + public IDictionary<string, SubToolset> SubToolsets { get; private set; } +#endif + + public IDictionary<string, ProjectPropertyInstance> Properties { get; private set; } + + public string ToolsPath { get; private set; } + + public string ToolsVersion { get; private set; } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/BuildAbortedException.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/BuildAbortedException.cs new file mode 100644 index 0000000000..70a2969260 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/BuildAbortedException.cs @@ -0,0 +1,43 @@ +using System; +using System.Runtime.Serialization; + +namespace Microsoft.Build.Exceptions +{ + public class BuildAbortedException : Exception + { + public BuildAbortedException () + : this ("Build aborted") + { + } + + public BuildAbortedException (string message) + : base (message) + { + } + + public BuildAbortedException (string message, Exception innerException) + : base (message, innerException) + { + } + protected BuildAbortedException (SerializationInfo info, StreamingContext context) + : base (info, context) + { + ErrorCode = info.GetString ("errorCode"); + } + + internal BuildAbortedException (string message, string errorCode) + : base (message + " error code: " + errorCode) + { + ErrorCode = errorCode; + } + + public string ErrorCode { get; private set; } + + public override void GetObjectData (SerializationInfo info, StreamingContext context) + { + base.GetObjectData (info, context); + info.AddValue ("errorCode", ErrorCode); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InternalLoggerException.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InternalLoggerException.cs new file mode 100644 index 0000000000..3aecdfdbb0 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InternalLoggerException.cs @@ -0,0 +1,57 @@ +using System; +using System.Runtime.Serialization; +using Microsoft.Build.Framework; + +namespace Microsoft.Build.Exceptions +{ + public class InternalLoggerException : Exception + { + public InternalLoggerException () + : this ("Build aborted") + { + } + + public InternalLoggerException (string message) + : base (message) + { + } + + public InternalLoggerException (string message, Exception innerException) + : base (message, innerException) + { + } + + internal InternalLoggerException (string message, Exception innerException, BuildEventArgs buildEventArgs, string errorCode, string helpKeyword, bool initializationException) + : base (message, innerException) + { + BuildEventArgs = buildEventArgs; + ErrorCode = errorCode; + HelpKeyword = helpKeyword; + InitializationException = initializationException; + } + + internal InternalLoggerException (SerializationInfo info, StreamingContext context) + : base (info, context) + { + BuildEventArgs = (BuildEventArgs) info.GetValue ("buildEventArgs", typeof (BuildEventArgs)); + ErrorCode = info.GetString ("errorCode"); + HelpKeyword = info.GetString ("helpKeyword"); + InitializationException = info.GetBoolean ("initializationException"); + } + + public BuildEventArgs BuildEventArgs { get; private set; } + public string ErrorCode { get; private set; } + public string HelpKeyword { get; private set; } + public bool InitializationException { get; private set; } + + public override void GetObjectData (SerializationInfo info, StreamingContext context) + { + base.GetObjectData (info, context); + info.AddValue ("buildEventArgs", BuildEventArgs); + info.AddValue ("errorCode", ErrorCode); + info.AddValue ("helpKeyword", HelpKeyword); + info.AddValue ("initializationException", InitializationException); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidProjectFileException.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidProjectFileException.cs index ea2a51dc40..ad05ff6403 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidProjectFileException.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidProjectFileException.cs @@ -28,6 +28,8 @@ using System; using System.Runtime.Serialization; +using Microsoft.Build.Construction; +using Microsoft.Build.Internal.Expressions; namespace Microsoft.Build.Exceptions { @@ -57,10 +59,31 @@ namespace Microsoft.Build.Exceptions : base(message, innerException) { } + internal InvalidProjectFileException (ILocation start, string message, + string errorSubcategory = null, string errorCode = null, string helpKeyword = null) + : this (start != null ? start.File : null, 0, start != null ? start.Column : 0, 0, 0, message, errorSubcategory, errorCode, helpKeyword) + { + } + internal InvalidProjectFileException (ElementLocation start, ElementLocation end, string message, + string errorSubcategory = null, string errorCode = null, string helpKeyword = null) + : this (start != null ? start.File : null, start != null ? start.Line : 0, start != null ? start.Column : 0, + end != null ? end.Line : 0, end != null ? end.Column : 0, + message, errorSubcategory, errorCode, helpKeyword) + { + } public InvalidProjectFileException (string projectFile, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, string message, string errorSubcategory, string errorCode, string helpKeyword) + : base(message) { + ProjectFile = projectFile; + LineNumber = lineNumber; + ColumnNumber = columnNumber; + EndLineNumber = endLineNumber; + EndColumnNumber = endColumnNumber; + ErrorSubcategory = errorSubcategory; + ErrorCode = errorCode; + HelpKeyword = helpKeyword; } public override void GetObjectData (SerializationInfo info, StreamingContext context) { @@ -87,8 +110,15 @@ namespace Microsoft.Build.Exceptions public string HelpKeyword { get; private set; } public int LineNumber { get; private set; } public override string Message { - get { return ProjectFile == null ? base.Message : base.Message + " " + ProjectFile; } + get { return ProjectFile == null ? base.Message : base.Message + " " + GetLocation (); } } public string ProjectFile { get; private set; } + + string GetLocation () + { + string start = LineNumber == 0 ? string.Empty : ColumnNumber > 0 ? string.Format ("{0},{1}", LineNumber, ColumnNumber) : string.Format ("{0}", LineNumber); + string end = EndLineNumber == 0 ? string.Empty : EndColumnNumber > 0 ? string.Format (" - {0},{1}", EndLineNumber, EndColumnNumber) : string.Format (" - {0}", EndLineNumber); + return LineNumber == 0 ? ProjectFile : String.Format (" at: {0} ({1}{2})", ProjectFile, start, end); + } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidToolsetDefinitionException.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidToolsetDefinitionException.cs new file mode 100644 index 0000000000..b518d182ac --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Exceptions/InvalidToolsetDefinitionException.cs @@ -0,0 +1,42 @@ +using System; +using System.Runtime.Serialization; + +namespace Microsoft.Build.Exceptions +{ + public class InvalidToolsetDefinitionException : Exception + { + public InvalidToolsetDefinitionException () + : this ("Invalid toolset definition") + { + } + + public InvalidToolsetDefinitionException (string message) + : base (message) + { + } + + public InvalidToolsetDefinitionException (string message, Exception innerException) + : base (message, innerException) + { + } + protected InvalidToolsetDefinitionException (SerializationInfo info, StreamingContext context) + : base (info, context) + { + ErrorCode = info.GetString ("errorCode"); + } + + internal InvalidToolsetDefinitionException (string message, string errorCode) + : base (message + " error code: " + errorCode) + { + ErrorCode = errorCode; + } + + public string ErrorCode { get; private set; } + + public override void GetObjectData (SerializationInfo info, StreamingContext context) + { + base.GetObjectData (info, context); + info.AddValue ("errorCode", ErrorCode); + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs index 3b4384b2f6..0c179afa48 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,66 +27,143 @@ // using Microsoft.Build.Evaluation; - using System; +using System.Collections.Generic; +using System.Threading; +using Microsoft.Build.Internal; +using System.Linq; namespace Microsoft.Build.Execution { - public class BuildManager - { - public BuildManager () - { - throw new NotImplementedException (); - } + public class BuildManager + { + static BuildManager default_manager = new BuildManager (); - public BuildManager (string hostName) - { - throw new NotImplementedException (); - } + public static BuildManager DefaultBuildManager { + get { return default_manager; } + } + + public BuildManager () + { + } - public void BeginBuild (BuildParameters parameters) - { - throw new NotImplementedException (); - } + public BuildManager (string hostName) + { + throw new NotImplementedException (); + } + + public void Dispose () + { + WaitHandle.WaitAll (submissions.Select (s => s.WaitHandle).ToArray ()); + BuildNodeManager.Stop (); + } - public BuildResult Build (BuildParameters parameters, BuildRequestData requestData) - { - throw new NotImplementedException (); - } + ~BuildManager () + { + // maybe processes created by out-of-process nodes should be signaled. + BuildNodeManager.Stop (); + } - public BuildResult BuildRequest (BuildRequestData requestData) - { - throw new NotImplementedException (); - } + readonly List<BuildSubmission> submissions = new List<BuildSubmission> (); + + BuildParameters ongoing_build_parameters; + + internal BuildParameters OngoingBuildParameters { + get { return ongoing_build_parameters; } + } - public void CancelAllSubmissions () - { - throw new NotImplementedException (); - } + public void BeginBuild (BuildParameters parameters) + { + if (ongoing_build_parameters != null) + throw new InvalidOperationException ("There is already ongoing build"); + ongoing_build_parameters = parameters.Clone (); + } - public void EndBuild () - { - throw new NotImplementedException (); - } + public BuildResult Build (BuildParameters parameters, BuildRequestData requestData) + { + BeginBuild (parameters); + var ret = BuildRequest (requestData); + EndBuild (); + return ret; + } - public ProjectInstance GetProjectInstanceForBuild (Project project) - { - throw new NotImplementedException (); - } + public BuildResult BuildRequest (BuildRequestData requestData) + { + var sub = PendBuildRequest (requestData); + sub.Execute (); + return sub.BuildResult; + } + + public void CancelAllSubmissions () + { + foreach (var sub in submissions) { + try { + if (!sub.IsCompleted) + sub.Cancel (); + } catch (InvalidOperationException) { + // some submissions could be already done during this iteration. Ignore that. + } + } + submissions.Clear (); + } - public BuildSubmission PendBuildRequest (BuildRequestData requestData) - { - throw new NotImplementedException (); - } + public void EndBuild () + { + if (ongoing_build_parameters == null) + throw new InvalidOperationException ("Build has not started"); + if (submissions.Count > 0) + WaitHandle.WaitAll (submissions.Select (s => s.WaitHandle).ToArray ()); + BuildNodeManager.Stop (); + ongoing_build_parameters = null; + } + + Dictionary<Project,ProjectInstance> instances = new Dictionary<Project, ProjectInstance> (); - public void ResetCaches () - { - throw new NotImplementedException (); - } + public ProjectInstance GetProjectInstanceForBuild (Project project) + { + if (project == null) + throw new ArgumentNullException ("project"); + if (project.FullPath == null) + throw new ArgumentNullException ("project", "FullPath parameter in the project cannot be null."); + if (project.FullPath == string.Empty) + throw new ArgumentException ("FullPath parameter in the project cannot be empty.", "project"); + // other than that, any invalid path character is accepted... + + return GetProjectInstanceForBuildInternal (project); + } + + internal ProjectInstance GetProjectInstanceForBuildInternal (Project project) + { + if (!instances.ContainsKey (project)) + instances [project] = project.CreateProjectInstance (); + return instances [project]; + } - public static BuildManager DefaultBuildManager { - get { throw new NotImplementedException (); } - } - } -} + public BuildSubmission PendBuildRequest (BuildRequestData requestData) + { + if (ongoing_build_parameters == null) + throw new InvalidOperationException ("This method cannot be called before calling BeginBuild method."); + var sub = new BuildSubmission (this, requestData); + submissions.Add (sub); + return sub; + } + public void ResetCaches () + { + if (OngoingBuildParameters != null) + throw new InvalidOperationException ("Cannot reset caches while builds are in progress."); + + BuildNodeManager.ResetCaches (); + } + + BuildNodeManager build_node_manager; + + internal BuildNodeManager BuildNodeManager { + get { + if (build_node_manager == null) + build_node_manager = new BuildNodeManager (this); + return build_node_manager; + } + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildParameters.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildParameters.cs index 26944910f9..61f8393cda 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildParameters.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildParameters.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -28,132 +29,128 @@ using Microsoft.Build.Evaluation; using Microsoft.Build.Framework; using Microsoft.Build.Logging; - using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Threading; +using System.Collections; namespace Microsoft.Build.Execution { - public class BuildParameters - { - public BuildParameters () - { - throw new NotImplementedException (); - } - - public BuildParameters (ProjectCollection projectCollection) - { - throw new NotImplementedException (); - } - - public BuildParameters Clone () - { - throw new NotImplementedException (); - } - - public Toolset GetToolset (string toolsVersion) - { - throw new NotImplementedException (); - } - - public ThreadPriority BuildThreadPriority { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public CultureInfo Culture { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public string DefaultToolsVersion { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public bool DetailedSummary { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public bool EnableNodeReuse { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public IDictionary<string, string> EnvironmentProperties { - get { throw new NotImplementedException (); } - } - - public IEnumerable<ForwardingLoggerRecord> ForwardingLoggers { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public IDictionary<string, string> GlobalProperties { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public HostServices HostServices { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public bool LegacyThreadingSemantics { get; set; } - - public IEnumerable<ILogger> Loggers { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public int MaxNodeCount { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public int MemoryUseLimit { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public string NodeExeLocation { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public bool OnlyLogCriticalEvents { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public bool ResetCaches { get; set; } - - public bool SaveOperatingEnvironment { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public ToolsetDefinitionLocations ToolsetDefinitionLocations { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public ICollection<Toolset> Toolsets { - get { throw new NotImplementedException (); } - } - - public CultureInfo UICulture { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public bool UseSynchronousLogging { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - } + public class BuildParameters + { + public BuildParameters () + : this (new ProjectCollection ()) + { + } + + public BuildParameters (ProjectCollection projectCollection) + { + if (projectCollection == null) + throw new ArgumentNullException ("projectCollection"); + projects = projectCollection; + + EnableNodeReuse = true; + Culture = CultureInfo.CurrentCulture; + UICulture = CultureInfo.CurrentUICulture; + MaxNodeCount = projectCollection.MaxNodeCount; + + // these properties are copied, while some members (such as Loggers) are not. + this.DefaultToolsVersion = projectCollection.DefaultToolsVersion; + this.ToolsetDefinitionLocations = projectCollection.ToolsetLocations; + this.GlobalProperties = projectCollection.GlobalProperties; + environment_properties = new Dictionary<string,string> (); + foreach (DictionaryEntry p in Environment.GetEnvironmentVariables ()) + environment_properties [(string) p.Key] = (string) p.Value; + } + + readonly ProjectCollection projects; + Dictionary<string,string> environment_properties; + + internal ProjectCollection ProjectCollection { + get { return projects; } + } + + public BuildParameters Clone () + { + var ret = (BuildParameters) MemberwiseClone (); + ret.ForwardingLoggers = ForwardingLoggers == null ? null : ForwardingLoggers.ToArray (); + ret.GlobalProperties = GlobalProperties == null ? null : GlobalProperties.ToDictionary (p => p.Key, p => p.Value); + ret.Loggers = Loggers == null ? null : new List<ILogger> (Loggers); + ret.environment_properties = new Dictionary<string, string> (environment_properties); + return ret; + } + + public Toolset GetToolset (string toolsVersion) + { + // can return null. + return projects.Toolsets.FirstOrDefault (t => t.ToolsVersion == toolsVersion); + } + + [MonoTODO] + public ThreadPriority BuildThreadPriority { get; set; } + + [MonoTODO] + public CultureInfo Culture { get; set; } + + public string DefaultToolsVersion { get; set; } + + [MonoTODO] + public bool DetailedSummary { get; set; } + + public bool EnableNodeReuse { get; set; } + + [MonoTODO] + public IDictionary<string, string> EnvironmentProperties { + get { return environment_properties; } + } + + [MonoTODO] + public IEnumerable<ForwardingLoggerRecord> ForwardingLoggers { get; set; } + + [MonoTODO] + public IDictionary<string, string> GlobalProperties { get; set; } + + public HostServices HostServices { get; set; } + + [MonoTODO] + public bool LegacyThreadingSemantics { get; set; } + + [MonoTODO] + public IEnumerable<ILogger> Loggers { get; set; } + + [MonoTODO] + public int MaxNodeCount { get; set; } + + [MonoTODO] + public int MemoryUseLimit { get; set; } + + [MonoTODO] + public string NodeExeLocation { get; set; } + + [MonoTODO] + public bool OnlyLogCriticalEvents { get; set; } + + [MonoTODO] + public bool ResetCaches { get; set; } + + [MonoTODO] + public bool SaveOperatingEnvironment { get; set; } + + [MonoTODO] + public ToolsetDefinitionLocations ToolsetDefinitionLocations { get; set; } + + [MonoTODO] + public ICollection<Toolset> Toolsets { + get { return projects.Toolsets; } + } + + [MonoTODO] + public CultureInfo UICulture { get; set; } + + [MonoTODO] + public bool UseSynchronousLogging { get; set; } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildRequestData.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildRequestData.cs index 2380077e51..bd5edffd7c 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildRequestData.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildRequestData.cs @@ -3,8 +3,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -27,50 +28,69 @@ // using System; +using System.Linq; using System.Collections.Generic; namespace Microsoft.Build.Execution { - public class BuildRequestData - { - public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild) - : this (projectInstance, targetsToBuild, null, BuildRequestDataFlags.None) - { - } + public class BuildRequestData + { + public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild) + : this (projectInstance, targetsToBuild, null, BuildRequestDataFlags.None) + { + } - public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices) - : this (projectInstance, targetsToBuild, hostServices, BuildRequestDataFlags.None) - { - } + public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices) + : this (projectInstance, targetsToBuild, hostServices, BuildRequestDataFlags.None) + { + } - public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices, - BuildRequestDataFlags flags) - { - throw new NotImplementedException (); - } + public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices, + BuildRequestDataFlags flags) + { + ProjectInstance = projectInstance; + TargetNames = targetsToBuild; + HostServices = hostServices; + Flags = flags; + } - public BuildRequestData (string projectFullPath, IDictionary<string, string> globalProperties, - string toolsVersion, string[] targetsToBuild, HostServices hostServices) - : this (projectFullPath, globalProperties, toolsVersion, targetsToBuild, hostServices, BuildRequestDataFlags.None) - { - } + public BuildRequestData (string projectFullPath, IDictionary<string, string> globalProperties, + string toolsVersion, string[] targetsToBuild, HostServices hostServices) + : this (projectFullPath, globalProperties, toolsVersion, targetsToBuild, hostServices, BuildRequestDataFlags.None) + { + } - public BuildRequestData (string projectFullPath, IDictionary<string, string> globalProperties, - string toolsVersion, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags) - { - throw new NotImplementedException (); - } + public BuildRequestData (string projectFullPath, IDictionary<string, string> globalProperties, + string toolsVersion, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags) + : this (new ProjectInstance (projectFullPath, globalProperties, toolsVersion), targetsToBuild, hostServices, flags) + { + ExplicitlySpecifiedToolsVersion = toolsVersion; + } - public string ExplicitlySpecifiedToolsVersion { get; private set; } - public BuildRequestDataFlags Flags { get; private set; } - public HostServices HostServices { get; private set; } - public string ProjectFullPath { get; private set; } - public ProjectInstance ProjectInstance { get; private set; } - public ICollection<string> TargetNames { get; private set; } + public string ExplicitlySpecifiedToolsVersion { get; private set; } - ICollection<ProjectPropertyInstance> GlobalProperties { - get { throw new NotImplementedException (); } - } - } + [MonoTODO ("unused")] + public BuildRequestDataFlags Flags { get; private set; } + + [MonoTODO ("unused")] + public HostServices HostServices { get; private set; } + + public string ProjectFullPath { + get { return ProjectInstance.FullPath; } + } + + [MonoTODO ("unused")] + public ProjectInstance ProjectInstance { get; private set; } + + [MonoTODO] + public IEnumerable<string> PropertiesToTransfer { get; private set; } + + [MonoTODO] + public ICollection<string> TargetNames { get; private set; } + + ICollection<ProjectPropertyInstance> GlobalProperties { + get { return ProjectInstance.Properties.Where (p => ProjectInstance.GlobalProperties.Any (i => i.Key == p.Name)).ToArray (); } // we can use == as it should be identical match there. + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildResult.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildResult.cs index 7286a247d2..479b137a4f 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildResult.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildResult.cs @@ -27,67 +27,75 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Microsoft.Build.Execution { - public class BuildResult - { - public void AddResultsForTarget (string target, TargetResult result) - { - throw new NotImplementedException (); - } - - public bool HasResultsForTarget (string target) - { - throw new NotImplementedException (); - } - - public void MergeResults (BuildResult results) - { - throw new NotImplementedException (); - } - - public bool CircularDependency { - get { throw new NotImplementedException (); } - } - - public int ConfigurationId { - get { throw new NotImplementedException (); } - } - - public Exception Exception { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public int GlobalRequestId { - get { throw new NotImplementedException (); } - } - - public ITargetResult this [string target] { - get { throw new NotImplementedException (); } - } - - public int NodeRequestId { - get { throw new NotImplementedException (); } - } - - public BuildResultCode OverallResult { - get { throw new NotImplementedException (); } - } - - public int ParentGlobalRequestId { - get { throw new NotImplementedException (); } - } - - public IDictionary<string, TargetResult> ResultsByTarget { - get { throw new NotImplementedException (); } - } - - public int SubmissionId { - get { throw new NotImplementedException (); } - } - - } + public class BuildResult + { + public BuildResult () + { + ResultsByTarget = new Dictionary<string, TargetResult> (); + } + + public void AddResultsForTarget (string target, TargetResult result) + { + ResultsByTarget.Add (target, result); + } + + public bool HasResultsForTarget (string target) + { + return ResultsByTarget.ContainsKey (target); + } + + public void MergeResults (BuildResult results) + { + if (ConfigurationId != results.ConfigurationId) + throw new InvalidOperationException ("Argument BuildResults have inconsistent ConfigurationId."); + if (GlobalRequestId != results.GlobalRequestId) + throw new InvalidOperationException ("Argument BuildResults have inconsistent GlobalRequestId."); + if (NodeRequestId != results.NodeRequestId) + throw new InvalidOperationException ("Argument BuildResults have inconsistent NodeRequestId."); + if (ParentGlobalRequestId != results.ParentGlobalRequestId) + throw new InvalidOperationException ("Argument BuildResults have inconsistent ParentGlobalRequestId."); + if (SubmissionId != results.SubmissionId) + throw new InvalidOperationException ("Argument BuildResults have inconsistent SubmissionId."); + + CircularDependency |= results.CircularDependency; + Exception = Exception ?? results.Exception; + foreach (var p in results.ResultsByTarget) + ResultsByTarget.Add (p.Key, p.Value); + } + + public bool CircularDependency { get; internal set; } + + public int ConfigurationId { get; internal set; } + + public Exception Exception { get; set; } + + public int GlobalRequestId { get; internal set; } + + public ITargetResult this [string target] { + get { return ResultsByTarget [target]; } + } + + public int NodeRequestId { get; internal set; } + + BuildResultCode? overall_result; + public BuildResultCode OverallResult { + get { + if (overall_result == null) + throw new InvalidOperationException ("Build has not finished"); + return overall_result.Value; + } + internal set { overall_result = value; } + } + + public int ParentGlobalRequestId { get; internal set; } + + public IDictionary<string, TargetResult> ResultsByTarget { get; private set; } + + public int SubmissionId { get; internal set; } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmission.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmission.cs index 3a8a612b93..91a9823ce8 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmission.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmission.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,15 +27,94 @@ // using System; +using System.Threading; +using System.Threading.Tasks; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Internal; +using System.Collections.Generic; namespace Microsoft.Build.Execution { - public class BuildSubmission - { - private BuildSubmission () - { - throw new NotImplementedException (); - } - } + public class BuildSubmission + { + static Random rnd = new Random (); + + internal BuildSubmission (BuildManager build, BuildRequestData requestData) + { + BuildManager = build; + this.request = requestData; + SubmissionId = rnd.Next (); + } + + BuildRequestData request; + BuildSubmissionCompleteCallback callback; + bool is_started, is_completed, is_canceled; + ManualResetEvent wait_handle = new ManualResetEvent (true); + + public object AsyncContext { get; private set; } + public BuildManager BuildManager { get; private set; } + public BuildResult BuildResult { get; set; } + public bool IsCompleted { + get { return is_completed; } + } + public int SubmissionId { get; private set; } + public WaitHandle WaitHandle { + get { return wait_handle; } + } + + internal BuildRequestData BuildRequest { + get { return this.request; } + } + + internal void Cancel () + { + if (is_canceled) + throw new InvalidOperationException ("Build has already canceled"); + is_canceled = true; + } + + public BuildResult Execute () + { + ExecuteAsync (null, null); + WaitHandle.WaitOne (); + return BuildResult; + } + + internal BuildResult InternalExecute () + { + BuildResult = new BuildResult () { SubmissionId = SubmissionId }; + try { + var engine = new BuildEngine4 (this); + string toolsVersion = request.ExplicitlySpecifiedToolsVersion ?? request.ProjectInstance.ToolsVersion ?? BuildManager.OngoingBuildParameters.DefaultToolsVersion; + var outputs = new Dictionary<string,string> (); + engine.BuildProject (() => is_canceled, BuildResult, request.ProjectInstance, request.TargetNames, BuildManager.OngoingBuildParameters.GlobalProperties, outputs, toolsVersion); + } catch (Exception ex) { + BuildResult.Exception = ex; + BuildResult.OverallResult = BuildResultCode.Failure; + } + is_completed = true; + if (callback != null) + callback (this); + wait_handle.Set (); + return BuildResult; + } + + public void ExecuteAsync (BuildSubmissionCompleteCallback callback, object context) + { + if (is_completed) + throw new InvalidOperationException ("Build has already completed"); + if (is_canceled) + throw new InvalidOperationException ("Build has already canceled"); + if (is_started) + throw new InvalidOperationException ("Build has already started"); + is_started = true; + this.AsyncContext = context; + this.callback = callback; + wait_handle.Reset (); + + BuildManager.BuildNodeManager.Enqueue (this); + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmissionCompleteCallback.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmissionCompleteCallback.cs new file mode 100644 index 0000000000..fba101a2fd --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildSubmissionCompleteCallback.cs @@ -0,0 +1,5 @@ +namespace Microsoft.Build.Execution +{ + public delegate void BuildSubmissionCompleteCallback (BuildSubmission submission); +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/HostServices.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/HostServices.cs index 2389bdf330..e68755affe 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/HostServices.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/HostServices.cs @@ -26,42 +26,95 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using Microsoft.Build.Framework; using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Framework; namespace Microsoft.Build.Execution { - public class HostServices - { - public ITaskHost GetHostObject (string projectFile, string targetName, string taskName) - { - throw new NotImplementedException (); - } + public class HostServices + { + class HostObjectRegistration + { + public string ProjectFile { get; set; } + public string TargetName { get; set; } + public string TaskName { get; set; } + public ITaskHost HostObject { get; set; } + } + + readonly List<HostObjectRegistration> hosts = new List<HostObjectRegistration> (); + readonly Dictionary<string,NodeAffinity> node_affinities = new Dictionary<string, NodeAffinity> (); + + HostObjectRegistration GetHostRegistration (string projectFile, string targetName, string taskName) + { + if (projectFile == null) + throw new ArgumentNullException ("projectFile"); + if (targetName == null) + throw new ArgumentNullException ("targetName"); + if (taskName == null) + throw new ArgumentNullException ("taskName"); + return hosts.FirstOrDefault (h => + string.Equals (projectFile, h.ProjectFile, StringComparison.OrdinalIgnoreCase) && + string.Equals (targetName, h.TargetName, StringComparison.OrdinalIgnoreCase) && + string.Equals (taskName, h.TaskName, StringComparison.OrdinalIgnoreCase)); + } + + public ITaskHost GetHostObject (string projectFile, string targetName, string taskName) + { + var reg = GetHostRegistration (projectFile, targetName, taskName); + return reg != null ? reg.HostObject : null; + } - public NodeAffinity GetNodeAffinity (string projectFile) - { - throw new NotImplementedException (); - } + public NodeAffinity GetNodeAffinity (string projectFile) + { + if (projectFile == null) + throw new ArgumentNullException ("projectFile"); + NodeAffinity na; + return node_affinities.TryGetValue (projectFile, out na) ? na : NodeAffinity.Any; + } + + IEnumerable<HostObjectRegistration> GetRegistrationsByProject (string project) + { + return hosts.Where (h => string.Equals (project, h.ProjectFile, StringComparison.OrdinalIgnoreCase)); + } - public void OnRenameProject (string oldFullPath, string newFullPath) - { - throw new NotImplementedException (); - } + public void OnRenameProject (string oldFullPath, string newFullPath) + { + if (oldFullPath == null) + throw new ArgumentNullException ("oldFullPath"); + if (newFullPath == null) + throw new ArgumentNullException ("newFullPath"); + foreach (var reg in GetRegistrationsByProject (oldFullPath)) + reg.ProjectFile = newFullPath; + } - public void RegisterHostObject (string projectFile, string targetName, string taskName, ITaskHost hostObject) - { - throw new NotImplementedException (); - } + public void RegisterHostObject (string projectFile, string targetName, string taskName, ITaskHost hostObject) + { + if (hostObject == null) + throw new ArgumentNullException ("hostObject"); + var reg = GetHostRegistration (projectFile, targetName, taskName); + if (reg != null) + reg.HostObject = hostObject; + else + hosts.Add (new HostObjectRegistration () { ProjectFile = projectFile, TargetName = targetName, TaskName = taskName, HostObject = hostObject }); + } - public void SetNodeAffinity (string projectFile, NodeAffinity nodeAffinity) - { - throw new NotImplementedException (); - } + public void SetNodeAffinity (string projectFile, NodeAffinity nodeAffinity) + { + if (projectFile == null) + throw new ArgumentNullException ("projectFile"); + node_affinities [projectFile] = nodeAffinity; + } - public void UnregisterProject (string projectFullPath) - { - throw new NotImplementedException (); - } - } + public void UnregisterProject (string projectFullPath) + { + if (projectFullPath == null) + throw new ArgumentNullException ("projectFullPath"); + var removed = GetRegistrationsByProject (projectFullPath).ToArray (); + foreach (var r in removed) + hosts.Remove (r); + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ColorSetter.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/NodeEngineShutdownReason.cs index 7e510e7bbf..b88423f2a8 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ColorSetter.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/NodeEngineShutdownReason.cs @@ -1,9 +1,10 @@ -// ColorSetter.cs +// +// NodeEngineShutdownReason.cs // // Author: -// Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -15,7 +16,7 @@ // // 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 @@ -24,9 +25,23 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System; +using System.Collections; +using System.Collections.Generic; +using Microsoft.Build.BuildEngine; +using Microsoft.Build.Execution; +using Microsoft.Build.Framework; +using Microsoft.Build.Evaluation; +using System.Linq; +using System.IO; -namespace Microsoft.Build.Logging +namespace Microsoft.Build.Internal { - public delegate void ColorSetter (System.ConsoleColor color); + public enum NodeEngineShutdownReason + { + BuildComplete, + BuildCompleteReuse, + ConnectionFailed, + Error, + } } - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/OutOfProcNode.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/OutOfProcNode.cs new file mode 100644 index 0000000000..7237052d19 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/OutOfProcNode.cs @@ -0,0 +1,48 @@ +// +// OutOfProcNode.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections; +using System.Collections.Generic; +using Microsoft.Build.BuildEngine; +using Microsoft.Build.Execution; +using Microsoft.Build.Framework; +using Microsoft.Build.Evaluation; +using System.Linq; +using System.IO; + +namespace Microsoft.Build.Internal +{ + // from MSDN: this class has deprecated and there is no alternative. + public class OutOfProcNode + { + public NodeEngineShutdownReason Run (out Exception shutdownException) + { + throw new NotImplementedException (); + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectInstance.cs index 4661496222..91ce68a040 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectInstance.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectInstance.cs @@ -3,8 +3,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -27,13 +28,34 @@ // using System; +using System.Collections; using System.Collections.Generic; +using System.Linq; using Microsoft.Build.Construction; using Microsoft.Build.Evaluation; using Microsoft.Build.Framework; +using Microsoft.Build.Internal.Expressions; using Microsoft.Build.Logging; +// +// It is not always consistent to reuse Project and its evaluation stuff mostly because +// both BuildParameters.ctor() and Project.ctor() takes arbitrary ProjectCollection, which are not very likely eqivalent +// (as BuildParameters.ctor(), unlike Project.ctor(...), is known to create a new ProjectCollection instance). +// +// However, that inconsistency could happen even if you only use ProjectInstance and BuildParameters. +// They both have constructors that take ProjectCollection and there is no guarantee that the arguments are the same. +// BuildManager.Build() does not fail because of inconsistent ProjectCollection instance on .NET. +// +// Anyhow, I'm not going to instantiate Project within ProjectInstance code for another reason: +// ProjectCollection.GetLoadedProject() does not return any Project instnace for corresponding ProjectInstance +// (or I should say, ProjectRootElement for both). +using Microsoft.Build.Internal; +using System.Xml; +using Microsoft.Build.Exceptions; +using System.IO; + + namespace Microsoft.Build.Execution { public class ProjectInstance @@ -59,35 +81,210 @@ namespace Microsoft.Build.Execution public ProjectInstance (ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection) { - InitializeProperties (); - - throw new NotImplementedException (); + projects = projectCollection; + global_properties = globalProperties ?? new Dictionary<string, string> (); + tools_version = !string.IsNullOrEmpty (toolsVersion) ? toolsVersion : + !string.IsNullOrEmpty (xml.ToolsVersion) ? xml.ToolsVersion : + projects.DefaultToolsVersion; + InitializeProperties (xml, null); } public ProjectInstance (string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection) + : this (ProjectRootElement.Create (projectFile), globalProperties, toolsVersion, projectCollection) + { + } + + ProjectCollection projects; + IDictionary<string, string> global_properties; + + string full_path, directory; + #if NET_4_5 + ElementLocation location; + #endif + + Dictionary<string, ProjectItemDefinitionInstance> item_definitions; + List<ResolvedImport> raw_imports; // maybe we don't need this... + List<ProjectItemInstance> all_evaluated_items; + List<ProjectItemInstance> raw_items; + List<ProjectPropertyInstance> properties; + Dictionary<string, ProjectTargetInstance> targets; + string tools_version; + + List<string> GetDefaultTargets (ProjectRootElement xml) { - InitializeProperties (); + var ret = xml.DefaultTargets.Split (item_target_sep, StringSplitOptions.RemoveEmptyEntries).Select (s => s.Trim ()).ToList (); + if (ret.Count == 0 && xml.Targets.Any ()) + ret.Add (xml.Targets.First ().Name); + return ret; + } + + void InitializeProperties (ProjectRootElement xml, ProjectInstance parent) + { + #if NET_4_5 + location = xml.Location; + #endif + full_path = xml.FullPath; + directory = string.IsNullOrWhiteSpace (xml.DirectoryPath) ? System.IO.Directory.GetCurrentDirectory () : xml.DirectoryPath; + DefaultTargets = GetDefaultTargets (xml); + InitialTargets = xml.InitialTargets.Split (item_target_sep, StringSplitOptions.RemoveEmptyEntries).Select (s => s.Trim ()).ToList (); + + raw_imports = new List<ResolvedImport> (); + item_definitions = new Dictionary<string, ProjectItemDefinitionInstance> (); + targets = new Dictionary<string, ProjectTargetInstance> (); + raw_items = new List<ProjectItemInstance> (); - throw new NotImplementedException (); + // FIXME: this is likely hack. Test ImportedProject.Properties to see what exactly should happen. + if (parent != null) { + properties = parent.properties; + } else { + properties = new List<ProjectPropertyInstance> (); + + foreach (DictionaryEntry p in Environment.GetEnvironmentVariables ()) + // FIXME: this is kind of workaround for unavoidable issue that PLATFORM=* is actually given + // on some platforms and that prevents setting default "PLATFORM=AnyCPU" property. + if (!string.Equals ("PLATFORM", (string) p.Key, StringComparison.OrdinalIgnoreCase)) + this.properties.Add (new ProjectPropertyInstance ((string) p.Key, false, (string) p.Value)); + foreach (var p in global_properties) + this.properties.Add (new ProjectPropertyInstance (p.Key, false, p.Value)); + var tools = projects.GetToolset (tools_version) ?? projects.GetToolset (projects.DefaultToolsVersion); + foreach (var p in projects.GetReservedProperties (tools, this, xml)) + this.properties.Add (p); + foreach (var p in ProjectCollection.GetWellKnownProperties (this)) + this.properties.Add (p); + } + + ProcessXml (parent, xml); } - void InitializeProperties () + static readonly char [] item_target_sep = {';'}; + + void ProcessXml (ProjectInstance parent, ProjectRootElement xml) { - DefaultTargets = new List<string> (); - InitialTargets = new List<string> (); + TaskDatabase = new BuildTaskDatabase (this, xml); + + // this needs to be initialized here (regardless of that items won't be evaluated at property evaluation; + // Conditions could incorrectly reference items and lack of this list causes NRE. + all_evaluated_items = new List<ProjectItemInstance> (); + + // property evaluation happens couple of times. + // At first step, all non-imported properties are evaluated TOO, WHILE those properties are being evaluated. + // This means, Include and IncludeGroup elements with Condition attribute MAY contain references to + // properties and they will be expanded. + var elements = EvaluatePropertiesAndImports (xml.Children).ToArray (); // ToArray(): to not lazily evaluate elements. + + // next, evaluate items + EvaluateItems (xml, elements); + + // finally, evaluate targets and tasks + EvaluateTasks (elements); } - Dictionary<string, string> global_properties = new Dictionary<string, string> (); + IEnumerable<ProjectElement> EvaluatePropertiesAndImports (IEnumerable<ProjectElement> elements) + { + // First step: evaluate Properties + foreach (var child in elements) { + yield return child; + var pge = child as ProjectPropertyGroupElement; + if (pge != null && EvaluateCondition (pge.Condition)) + foreach (var p in pge.Properties) + // do not allow overwriting reserved or well-known properties by user + if (!this.properties.Any (_ => (_.IsImmutable) && _.Name.Equals (p.Name, StringComparison.InvariantCultureIgnoreCase))) + if (EvaluateCondition (p.Condition)) + this.properties.Add (new ProjectPropertyInstance (p.Name, false, ExpandString (p.Value))); + + var ige = child as ProjectImportGroupElement; + if (ige != null && EvaluateCondition (ige.Condition)) { + foreach (var incc in ige.Imports) { + foreach (var e in Import (incc)) + yield return e; + } + } + var inc = child as ProjectImportElement; + if (inc != null && EvaluateCondition (inc.Condition)) + foreach (var e in Import (inc)) + yield return e; + } + } + internal IEnumerable<T> GetAllItems<T> (string include, string exclude, Func<string,T> creator, Func<string,ITaskItem> taskItemCreator, Func<string,bool> itemTypeCheck, Action<T,string> assignRecurse) + { + return ProjectCollection.GetAllItems<T> (ExpandString, include, exclude, creator, taskItemCreator, Directory, assignRecurse, + t => all_evaluated_items.Any (i => i.EvaluatedInclude == t.ItemSpec && itemTypeCheck (i.ItemType))); + } + + void EvaluateItems (ProjectRootElement xml, IEnumerable<ProjectElement> elements) + { + foreach (var child in elements) { + var ige = child as ProjectItemGroupElement; + if (ige != null) { + foreach (var p in ige.Items) { + if (!EvaluateCondition (ige.Condition) || !EvaluateCondition (p.Condition)) + continue; + Func<string,ProjectItemInstance> creator = s => new ProjectItemInstance (this, p.ItemType, p.Metadata.Select (m => new KeyValuePair<string,string> (m.Name, m.Value)).ToList (), s); + foreach (var item in GetAllItems (p.Include, p.Exclude, creator, s => new ProjectTaskItem (p, s), it => string.Equals (it, p.ItemType, StringComparison.OrdinalIgnoreCase), (t, s) => t.RecursiveDir = s)) { + raw_items.Add (item); + all_evaluated_items.Add (item); + } + } + } + var def = child as ProjectItemDefinitionGroupElement; + if (def != null) { + foreach (var p in def.ItemDefinitions) { + if (EvaluateCondition (p.Condition)) { + ProjectItemDefinitionInstance existing; + if (!item_definitions.TryGetValue (p.ItemType, out existing)) + item_definitions.Add (p.ItemType, (existing = new ProjectItemDefinitionInstance (p))); + existing.AddItems (p); + } + } + } + } + all_evaluated_items.Sort ((p1, p2) => string.Compare (p1.ItemType, p2.ItemType, StringComparison.OrdinalIgnoreCase)); + } + + void EvaluateTasks (IEnumerable<ProjectElement> elements) + { + foreach (var child in elements) { + var te = child as ProjectTargetElement; + if (te != null) + this.targets.Add (te.Name, new ProjectTargetInstance (te)); + } + } + + IEnumerable<ProjectElement> Import (ProjectImportElement import) + { + string dir = projects.GetEvaluationTimeThisFileDirectory (() => FullPath); + string path = WindowsCompatibilityExtensions.NormalizeFilePath (ExpandString (import.Project)); + path = Path.IsPathRooted (path) ? path : dir != null ? Path.Combine (dir, path) : Path.GetFullPath (path); + if (projects.OngoingImports.Contains (path)) + throw new InvalidProjectFileException (import.Location, null, string.Format ("Circular imports was detected: {0} is already on \"importing\" stack", path)); + projects.OngoingImports.Push (path); + try { + using (var reader = XmlReader.Create (path)) { + var root = ProjectRootElement.Create (reader, projects); + if (DefaultTargets.Count == 0) + DefaultTargets.AddRange (GetDefaultTargets (root)); + raw_imports.Add (new ResolvedImport (import, root, true)); + return this.EvaluatePropertiesAndImports (root.Children).ToArray (); + } + } finally { + projects.OngoingImports.Pop (); + } + } + + internal IEnumerable<ProjectItemInstance> AllEvaluatedItems { + get { return all_evaluated_items; } + } + public List<string> DefaultTargets { get; private set; } public string Directory { - get { throw new NotImplementedException (); } + get { return directory; } } public string FullPath { - get { throw new NotImplementedException (); } + get { return full_path; } } public IDictionary<string, string> GlobalProperties { @@ -103,33 +300,33 @@ namespace Microsoft.Build.Execution #endif public IDictionary<string, ProjectItemDefinitionInstance> ItemDefinitions { - get { throw new NotImplementedException (); } + get { return item_definitions; } } public ICollection<ProjectItemInstance> Items { - get { throw new NotImplementedException (); } + get { return all_evaluated_items; } } public ICollection<string> ItemTypes { - get { throw new NotImplementedException (); } + get { return all_evaluated_items.Select (i => i.ItemType).Distinct ().ToArray (); } } #if NET_4_5 public ElementLocation ProjectFileLocation { - get { throw new NotImplementedException (); } + get { return location; } } #endif public ICollection<ProjectPropertyInstance> Properties { - get { throw new NotImplementedException (); } + get { return properties; } } public IDictionary<string, ProjectTargetInstance> Targets { - get { throw new NotImplementedException (); } + get { return targets; } } public string ToolsVersion { - get { throw new NotImplementedException (); } + get { return tools_version; } } public ProjectItemInstance AddItem (string itemType, string evaluatedInclude) @@ -139,7 +336,10 @@ namespace Microsoft.Build.Execution public ProjectItemInstance AddItem (string itemType, string evaluatedInclude, IEnumerable<KeyValuePair<string, string>> metadata) { - throw new NotImplementedException (); + var item = new ProjectItemInstance (this, itemType, metadata, evaluatedInclude); + raw_items.Add (item); + all_evaluated_items.Add (item); + return item; } public bool Build () @@ -154,7 +354,7 @@ namespace Microsoft.Build.Execution public bool Build (IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers) { - return Build ((string []) null, loggers, remoteLoggers); + return Build (DefaultTargets.ToArray (), loggers, remoteLoggers); } public bool Build (string target, IEnumerable<ILogger> loggers) @@ -180,12 +380,20 @@ namespace Microsoft.Build.Execution public bool Build (string[] targets, IEnumerable<ILogger> loggers, out IDictionary<string, TargetResult> targetOutputs) { - return Build (targets, loggers, new ForwardingLoggerRecord [0], out targetOutputs); + return Build (targets, loggers, new ForwardingLoggerRecord [0], out targetOutputs); } public bool Build (string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, out IDictionary<string, TargetResult> targetOutputs) { - throw new NotImplementedException (); + var manager = new BuildManager (); + var parameters = new BuildParameters (projects) { + ForwardingLoggers = remoteLoggers, + Loggers = loggers, + }; + var requestData = new BuildRequestData (this, targets); + var result = manager.Build (parameters, requestData); + targetOutputs = result.ResultsByTarget; + return result.OverallResult == BuildResultCode.Success; } public ProjectInstance DeepCopy () @@ -200,17 +408,22 @@ namespace Microsoft.Build.Execution public bool EvaluateCondition (string condition) { - throw new NotImplementedException (); + return string.IsNullOrWhiteSpace (condition) || new ExpressionEvaluator (this, null).EvaluateAsBoolean (condition); } public string ExpandString (string unexpandedValue) { - throw new NotImplementedException (); + return ExpandString (unexpandedValue, null); + } + + string ExpandString (string unexpandedValue, string replacementForMissingStuff) + { + return new ExpressionEvaluator (this, replacementForMissingStuff).Evaluate (unexpandedValue); } public ICollection<ProjectItemInstance> GetItems (string itemType) { - throw new NotImplementedException (); + return new CollectionFromEnumerable<ProjectItemInstance> (Items.Where (p => p.ItemType.Equals (itemType, StringComparison.OrdinalIgnoreCase))); } public IEnumerable<ProjectItemInstance> GetItemsByItemTypeAndEvaluatedInclude (string itemType, string evaluatedInclude) @@ -220,27 +433,36 @@ namespace Microsoft.Build.Execution public ProjectPropertyInstance GetProperty (string name) { - throw new NotImplementedException (); + return properties.FirstOrDefault (p => p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); } public string GetPropertyValue (string name) { - throw new NotImplementedException (); + var prop = GetProperty (name); + return prop != null ? prop.EvaluatedValue : string.Empty; } public bool RemoveItem (ProjectItemInstance item) { - throw new NotImplementedException (); + // yeah, this raw_items should vanish... + raw_items.Remove (item); + return all_evaluated_items.Remove (item); } public bool RemoveProperty (string name) { - throw new NotImplementedException (); + var removed = properties.FirstOrDefault (p => p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + if (removed == null) + return false; + properties.Remove (removed); + return true; } public ProjectPropertyInstance SetProperty (string name, string evaluatedValue) { - throw new NotImplementedException (); + var p = new ProjectPropertyInstance (name, false, evaluatedValue); + properties.Add (p); + return p; } public ProjectRootElement ToProjectRootElement () @@ -259,32 +481,46 @@ namespace Microsoft.Build.Execution public static string GetEvaluatedItemIncludeEscaped (ProjectItemDefinitionInstance item) { + // ?? ItemDefinition does not have Include attribute. What's the point here? throw new NotImplementedException (); } public static string GetEvaluatedItemIncludeEscaped (ProjectItemInstance item) { - throw new NotImplementedException (); + return ProjectCollection.Escape (item.EvaluatedInclude); } public static string GetMetadataValueEscaped (ProjectMetadataInstance metadatum) { - throw new NotImplementedException (); + return ProjectCollection.Escape (metadatum.EvaluatedValue); } public static string GetMetadataValueEscaped (ProjectItemDefinitionInstance item, string name) { - throw new NotImplementedException (); + var md = item.Metadata.FirstOrDefault (m => m.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + return md != null ? ProjectCollection.Escape (md.EvaluatedValue) : null; } public static string GetMetadataValueEscaped (ProjectItemInstance item, string name) { - throw new NotImplementedException (); + var md = item.Metadata.FirstOrDefault (m => m.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + return md != null ? ProjectCollection.Escape (md.EvaluatedValue) : null; } public static string GetPropertyValueEscaped (ProjectPropertyInstance property) { - throw new NotImplementedException (); + // WTF happens here. + //return ProjectCollection.Escape (property.EvaluatedValue); + return property.EvaluatedValue; + } + + internal BuildTaskDatabase TaskDatabase { get; private set; } + + internal string GetFullPath (string pathRelativeToProject) + { + if (Path.IsPathRooted (pathRelativeToProject)) + return pathRelativeToProject; + return Path.GetFullPath (Path.Combine (Directory, pathRelativeToProject)); } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemDefinitionInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemDefinitionInstance.cs index 4641a951ce..fb10ceec17 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemDefinitionInstance.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemDefinitionInstance.cs @@ -4,7 +4,7 @@ // Author: // Atsushi Enomoto (atsushi@veritas-vos-liberabit.com) // -// Copyright (C) 2012 Xamarin Inc. +// Copyright (C) 2012,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -29,29 +29,43 @@ using Microsoft.Build.Framework; using System; using System.Collections.Generic; +using Microsoft.Build.Construction; +using System.Linq; namespace Microsoft.Build.Execution { public class ProjectItemDefinitionInstance { - internal ProjectItemDefinitionInstance () + internal ProjectItemDefinitionInstance (ProjectItemDefinitionElement xml) { + ItemType = xml.ItemType; + AddItems (xml); } - public string ItemType { - get { throw new NotImplementedException (); } - } + List<ProjectMetadataInstance> metadata = new List<ProjectMetadataInstance> (); + + public string ItemType { get; private set; } public ICollection<ProjectMetadataInstance> Metadata { - get { throw new NotImplementedException (); } + get { return metadata; } } public int MetadataCount { - get { throw new NotImplementedException (); } + get { return metadata.Count; } } public IEnumerable<string> MetadataNames { - get { throw new NotImplementedException (); } + get { return metadata.Select (m => m.Name).ToArray (); } + } + + internal void AddItems (ProjectItemDefinitionElement xml) + { + foreach (var item in xml.Metadata) { + var existing = metadata.FirstOrDefault (i => i.Name == item.Name); + if (existing != null) + metadata.Remove (existing); + metadata.Add (new ProjectMetadataInstance (item.Name, item.Value)); + } } } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskInstance.cs new file mode 100644 index 0000000000..bf9d03f05f --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskInstance.cs @@ -0,0 +1,82 @@ +// +// ProjectItemGroupTaskInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public sealed class ProjectItemGroupTaskInstance : ProjectTargetInstanceChild + { + internal ProjectItemGroupTaskInstance (ProjectItemGroupElement xml) + { + condition = xml.Condition; + condition_location = xml.ConditionLocation; + //this.FullPath = fullPath; + location = xml.Location; + + Items = xml.Items.Select (item => new ProjectItemGroupTaskItemInstance (item)).ToArray (); + } + + readonly string condition; + readonly ElementLocation condition_location, location; + + public override string Condition { + get { return condition; } + } + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation ConditionLocation { + get { return condition_location; } + } + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation Location { + get { return location; } + } + + #if NET_4_5 + public + #else + internal + #endif + ElementLocation ExecuteTargetsLocation { get; private set; } + + public ICollection<ProjectItemGroupTaskItemInstance> Items { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskItemInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskItemInstance.cs new file mode 100644 index 0000000000..8d947b72ba --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskItemInstance.cs @@ -0,0 +1,95 @@ +// +// ProjectItemGroupTaskItemInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using Microsoft.Build.Construction; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Build.Execution +{ + public class ProjectItemGroupTaskItemInstance + { + internal ProjectItemGroupTaskItemInstance (ProjectItemElement xml) + { + Condition = xml.Condition; + Exclude = xml.Exclude; + Include = xml.Include; + ItemType = xml.ItemType; + Metadata = xml.Metadata.Select (m => new ProjectItemGroupTaskMetadataInstance (m)).ToArray (); + Remove = xml.Remove; + #if NET_4_5 + KeepDuplicates = xml.KeepDuplicates; + KeepMetadata = xml.KeepMetadata; + RemoveMetadata = xml.RemoveMetadata; + + ConditionLocation = xml.ConditionLocation; + ExcludeLocation = xml.ExcludeLocation; + IncludeLocation = xml.IncludeLocation; + Location = xml.Location; + KeepDuplicatesLocation = xml.KeepDuplicatesLocation; + RemoveLocation = xml.RemoveLocation; + RemoveMetadataLocation = xml.RemoveMetadataLocation; + #endif + } + + public string Condition { get; private set; } + + public string Exclude { get; private set; } + + public string Include { get; private set; } + + public string ItemType { get; private set; } + + public string KeepDuplicates { get; private set; } + + public string KeepMetadata { get; private set; } + + public ICollection<ProjectItemGroupTaskMetadataInstance> Metadata { get; private set; } + + public string Remove { get; private set; } + + public string RemoveMetadata { get; private set; } + #if NET_4_5 + public ElementLocation ConditionLocation { get; private set; } + + public ElementLocation ExcludeLocation { get; private set; } + + public ElementLocation IncludeLocation { get; private set; } + + public ElementLocation KeepDuplicatesLocation { get; private set; } + + public ElementLocation KeepMetadataLocation { get; private set; } + + public ElementLocation Location { get; private set; } + + public ElementLocation RemoveLocation { get; private set; } + + public ElementLocation RemoveMetadataLocation { get; private set; } + #endif + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskMetadataInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskMetadataInstance.cs new file mode 100644 index 0000000000..ad871731c5 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemGroupTaskMetadataInstance.cs @@ -0,0 +1,58 @@ +// +// ProjectItemGroupTaskMetadataInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. + +using System; +using System.Collections.Generic; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public sealed class ProjectItemGroupTaskMetadataInstance + { + internal ProjectItemGroupTaskMetadataInstance (ProjectMetadataElement xml) + { + Condition = xml.Condition; + Name = xml.Name; + Value = xml.Value; + #if NET_4_5 + ConditionLocation = xml.ConditionLocation; + Location = xml.Location; + #endif + } + public string Condition { get; private set; } + + public string Name { get; private set; } + + public string Value { get; private set; } + #if NET_4_5 + public ElementLocation ConditionLocation { get; private set; } + + public ElementLocation Location { get; private set; } + #endif + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemInstance.cs index 0e27811ef8..720c4b32b1 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemInstance.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectItemInstance.cs @@ -3,8 +3,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,152 +27,191 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using Microsoft.Build.Framework; using System; using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Evaluation; +using System.Collections; +using Microsoft.Build.Construction; +using System.Globalization; +using System.IO; namespace Microsoft.Build.Execution { - public class ProjectItemInstance + public class ProjectItemInstance : ITaskItem2 - { - private ProjectItemInstance () - { - throw new NotImplementedException (); - } - - public ProjectMetadataInstance GetMetadata (string name) - { - throw new NotImplementedException (); - } - - public string GetMetadataValue (string name) - { - throw new NotImplementedException (); - } - - public bool HasMetadata (string name) - { - throw new NotImplementedException (); - } - - public void RemoveMetadata (string metadataName) - { - throw new NotImplementedException (); - } - - public void SetMetadata (IEnumerable<KeyValuePair<string, string>> metadataDictionary) - { - throw new NotImplementedException (); - } - - public ProjectMetadataInstance SetMetadata (string name, string evaluatedValue) - { - throw new NotImplementedException (); - } - - public int DirectMetadataCount { - get { throw new NotImplementedException (); } - } - - public string EvaluatedInclude { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public string ItemType { - get { throw new NotImplementedException (); } - } - - public IEnumerable<ProjectMetadataInstance> Metadata { - get { throw new NotImplementedException (); } - } - - public int MetadataCount { - get { throw new NotImplementedException (); } - } - - public ICollection<string> MetadataNames { - get { throw new NotImplementedException (); } - } - - public ProjectInstance Project { - get { throw new NotImplementedException (); } - } - - #region ITaskItem2 implementation - string ITaskItem2.GetMetadataValueEscaped (string metadataName) - { - throw new NotImplementedException (); - } - - void ITaskItem2.SetMetadataValueLiteral (string metadataName, string metadataValue) - { - throw new NotImplementedException (); - } - - System.Collections.IDictionary ITaskItem2.CloneCustomMetadataEscaped () - { - throw new NotImplementedException (); - } - - string ITaskItem2.EvaluatedIncludeEscaped { - get { - throw new NotImplementedException (); - } - set { - throw new NotImplementedException (); - } - } - #endregion - - #region ITaskItem implementation - System.Collections.IDictionary ITaskItem.CloneCustomMetadata () - { - throw new NotImplementedException (); - } - - void ITaskItem.CopyMetadataTo (ITaskItem destinationItem) - { - throw new NotImplementedException (); - } - - string ITaskItem.GetMetadata (string metadataName) - { - throw new NotImplementedException (); - } - - void ITaskItem.RemoveMetadata (string metadataName) - { - throw new NotImplementedException (); - } - - void ITaskItem.SetMetadata (string metadataName, string metadataValue) - { - throw new NotImplementedException (); - } - - string ITaskItem.ItemSpec { - get { - throw new NotImplementedException (); - } - set { - throw new NotImplementedException (); - } - } - - int ITaskItem.MetadataCount { - get { - throw new NotImplementedException (); - } - } - - System.Collections.ICollection ITaskItem.MetadataNames { - get { - throw new NotImplementedException (); - } - } - #endregion - } + { + internal ProjectItemInstance (ProjectInstance project, string itemType, IEnumerable<KeyValuePair<string,string>> metadata, string evaluatedInclude) + { + this.project = project; + this.evaluated_include = evaluatedInclude; + this.item_type = itemType; + this.metadata = new List<ProjectMetadataInstance> (); + SetMetadata (metadata); + } + + readonly ProjectInstance project; + readonly string item_type; + string evaluated_include; + readonly List<ProjectMetadataInstance> metadata; + + public ProjectMetadataInstance GetMetadata (string name) + { + if (name == null) + throw new ArgumentNullException ("name"); + // This does not return any Well Known metadata + return Metadata.FirstOrDefault (m => m.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + } + + public string GetMetadataValue (string name) + { + if (name == null) + throw new ArgumentNullException ("name"); + var wk = ProjectCollection.GetWellKnownMetadata (name, EvaluatedInclude, project.GetFullPath, RecursiveDir); + if (wk != null) + return wk; + var m = GetMetadata (name); + return m != null ? m.EvaluatedValue : null; + } + + public bool HasMetadata (string name) + { + return GetMetadata (name) != null; + } + + public void RemoveMetadata (string metadataName) + { + var m = GetMetadata (metadataName); + if (m != null) + metadata.Remove (m); + } + + public void SetMetadata (IEnumerable<KeyValuePair<string, string>> metadataDictionary) + { + foreach (var p in metadataDictionary) + SetMetadata (p.Key, p.Value); + } + + public ProjectMetadataInstance SetMetadata (string name, string evaluatedValue) + { + var m = metadata.FirstOrDefault (_ => _.Name.Equals (name, StringComparison.OrdinalIgnoreCase)); + if (m != null) + metadata.Remove (m); + m = new ProjectMetadataInstance (name, evaluatedValue); + metadata.Add (m); + return m; + } + + public int DirectMetadataCount { + get { throw new NotImplementedException (); } + } + + public string EvaluatedInclude { + get { return evaluated_include; } + set { + if (value == null) + throw new ArgumentNullException ("value"); + evaluated_include = value; + } + } + + public string ItemType { + get { return item_type; } + } + + public IEnumerable<ProjectMetadataInstance> Metadata { + get { return metadata; } + } + + public int MetadataCount { + get { return metadata.Count; } + } + + public ICollection<string> MetadataNames { + get { return metadata.Select (m => m.Name).ToArray (); } + } + + public ProjectInstance Project { + get { return project; } + } + + internal string RecursiveDir { get; set; } + + #region ITaskItem2 implementation + + string ITaskItem2.GetMetadataValueEscaped (string metadataName) + { + return ProjectCollection.Escape (GetMetadataValue (metadataName)); + } + + void ITaskItem2.SetMetadataValueLiteral (string metadataName, string metadataValue) + { + SetMetadata (metadataName, metadataValue); + } + + System.Collections.IDictionary ITaskItem2.CloneCustomMetadataEscaped () + { + var dic = ((ITaskItem) this).CloneCustomMetadata (); + foreach (DictionaryEntry p in dic) + dic [p.Key] = ProjectCollection.Escape ((string) p.Value); + return dic; + } + + string ITaskItem2.EvaluatedIncludeEscaped { + get { return ProjectCollection.Escape (EvaluatedInclude); } + set { EvaluatedInclude = ProjectCollection.Unescape (value); } + } + + #endregion + + #region ITaskItem implementation + + IDictionary ITaskItem.CloneCustomMetadata () + { + var dic = new Hashtable (); + foreach (var md in Metadata) + dic [md.Name] = md.EvaluatedValue; + return dic; + } + + void ITaskItem.CopyMetadataTo (ITaskItem destinationItem) + { + if (destinationItem == null) + throw new ArgumentNullException ("destinationItem"); + foreach (var md in Metadata) + destinationItem.SetMetadata (md.Name, md.EvaluatedValue); + } + + string ITaskItem.GetMetadata (string metadataName) + { + return GetMetadataValue (metadataName); + } + + void ITaskItem.RemoveMetadata (string metadataName) + { + RemoveMetadata (metadataName); + } + + void ITaskItem.SetMetadata (string metadataName, string metadataValue) + { + SetMetadata (metadataName, ProjectCollection.Unescape (metadataValue)); + } + + string ITaskItem.ItemSpec { + get { return EvaluatedInclude; } + set { EvaluatedInclude = value; } + } + + int ITaskItem.MetadataCount { + get { return MetadataCount; } + } + + ICollection ITaskItem.MetadataNames { + get { return MetadataNames.ToArray (); } + } + + #endregion + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectMetadataInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectMetadataInstance.cs index b0386fe28a..c94fe8740d 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectMetadataInstance.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectMetadataInstance.cs @@ -27,15 +27,29 @@ // using System; +using Microsoft.Build.Construction; namespace Microsoft.Build.Execution { - public class ProjectMetadataInstance - { - private ProjectMetadataInstance () - { - throw new NotImplementedException (); - } - } + public class ProjectMetadataInstance + { + internal ProjectMetadataInstance (string name, string value) + { + Name = name; + EvaluatedValue = value; + } + + public string EvaluatedValue { get; private set; } + public string Name { get; private set; } + + public ProjectMetadataInstance DeepClone () + { + return new ProjectMetadataInstance (Name, EvaluatedValue); + } + + public override string ToString () + { + return string.Format ("{0}={1}", Name, EvaluatedValue); + } + } } - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectOnErrorInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectOnErrorInstance.cs new file mode 100644 index 0000000000..b5572ef8a5 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectOnErrorInstance.cs @@ -0,0 +1,82 @@ +// +// ProjectOnErrorInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public class ProjectOnErrorInstance : ProjectTargetInstanceChild + { + internal ProjectOnErrorInstance (ProjectOnErrorElement xml) + { + condition = xml.Condition; + ExecuteTargets = xml.ExecuteTargetsAttribute; + //this.FullPath = fullPath; + #if NET_4_5 + condition_location = xml.ConditionLocation; + ExecuteTargetsLocation = xml.ExecuteTargetsAttributeLocation; + location = xml.Location; + #endif + } + + readonly string condition; + + public override string Condition { + get { return condition; } + } + + public string ExecuteTargets { get; private set; } + + readonly ElementLocation condition_location, location; + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation ConditionLocation { + get { return condition_location; } + } + + #if NET_4_5 + public + #else + internal + #endif + ElementLocation ExecuteTargetsLocation { get; private set; } + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation Location { + get { return location; } + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyGroupTaskInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyGroupTaskInstance.cs new file mode 100644 index 0000000000..1e5d7fa6e3 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyGroupTaskInstance.cs @@ -0,0 +1,82 @@ +// +// ProjectPropertyGroupTaskInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public sealed class ProjectPropertyGroupTaskInstance : ProjectTargetInstanceChild + { + internal ProjectPropertyGroupTaskInstance (ProjectPropertyGroupElement xml) + { + condition = xml.Condition; + condition_location = xml.ConditionLocation; + //this.FullPath = fullPath; + location = xml.Location; + + Properties = xml.Properties.Select (prop => new ProjectPropertyGroupTaskPropertyInstance (prop)).ToArray (); + } + + readonly string condition; + readonly ElementLocation condition_location, location; + + public override string Condition { + get { return condition; } + } + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation ConditionLocation { + get { return condition_location; } + } + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation Location { + get { return location; } + } + + #if NET_4_5 + public + #else + internal + #endif + ElementLocation ExecuteTargetsLocation { get; private set; } + + public ICollection<ProjectPropertyGroupTaskPropertyInstance> Properties { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyGroupTaskPropertyInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyGroupTaskPropertyInstance.cs new file mode 100644 index 0000000000..df1d2c6af1 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyGroupTaskPropertyInstance.cs @@ -0,0 +1,61 @@ +// +// ProjectPropertyGroupTaskPropertyInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public class ProjectPropertyGroupTaskPropertyInstance + { + internal ProjectPropertyGroupTaskPropertyInstance (ProjectPropertyElement xml) + { + Condition = xml.Condition; + Name = xml.Name; + Value = xml.Value; + #if NET_4_5 + ConditionLocation = xml.ConditionLocation; + Location = xml.Location; + #endif + } + + public string Condition { get; private set; } + + public string Name { get; private set; } + + public string Value { get; private set; } + + #if NET_4_5 + public ElementLocation ConditionLocation { get; private set; } + + public ElementLocation Location { get; private set; } + #endif + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyInstance.cs index 3b6b32c2d8..5bacdbe61a 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyInstance.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectPropertyInstance.cs @@ -3,8 +3,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -30,12 +31,32 @@ using System; namespace Microsoft.Build.Execution { - public class ProjectPropertyInstance - { - private ProjectPropertyInstance () - { - throw new NotImplementedException (); - } - } -} + public class ProjectPropertyInstance + { + internal ProjectPropertyInstance (string name, bool isImmutable, string evaluatedValue, Func<string> evaluatedValueGetter = null) + { + Name = name; + IsImmutable = isImmutable; + evaluated_value_getter = evaluatedValueGetter ?? (() => evaluatedValue); + } + + Func<string> evaluated_value_getter; + public string EvaluatedValue { + get { return evaluated_value_getter (); } + set { + if (IsImmutable) + throw new InvalidOperationException (); + evaluated_value_getter = () => value; + } + } + public virtual bool IsImmutable { get; private set; } + + public string Name { get; private set; } + + public override string ToString () + { + return string.Format ("{0}={1}", Name, EvaluatedValue); + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstance.cs index a95ee16cb0..3046811068 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstance.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstance.cs @@ -1,9 +1,11 @@ +// // ProjectTargetInstance.cs // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsshi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -25,16 +27,83 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // + using System; +using Microsoft.Build.Construction; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Build.Execution { - public sealed class ProjectTargetInstance - { - private ProjectTargetInstance () - { - throw new NotImplementedException (); - } - } + public sealed class ProjectTargetInstance + { + internal ProjectTargetInstance (ProjectTargetElement xml) + { + FullPath = xml.ContainingProject.FullPath; + Children = xml.Children.Select<ProjectElement,ProjectTargetInstanceChild> (c => { + if (c is ProjectOnErrorElement) + return new ProjectOnErrorInstance ((ProjectOnErrorElement) c); + if (c is ProjectItemGroupElement) + return new ProjectItemGroupTaskInstance ((ProjectItemGroupElement) c); + if (c is ProjectPropertyGroupElement) + return new ProjectPropertyGroupTaskInstance ((ProjectPropertyGroupElement) c); + if (c is ProjectTaskElement) + return new ProjectTaskInstance ((ProjectTaskElement) c); + throw new NotSupportedException (); + }).ToArray (); + Condition = xml.Condition; + DependsOnTargets = xml.DependsOnTargets; + //FullPath = fullPath; + Inputs = xml.Inputs; + KeepDuplicateOutputs = xml.KeepDuplicateOutputs; + Name = xml.Name; + OnErrorChildren = xml.OnErrors.Select (c => new ProjectOnErrorInstance (c)).ToArray (); + Outputs = xml.Outputs; + Returns = xml.Returns; + Tasks = xml.Tasks.Select (t => new ProjectTaskInstance (t)).ToArray (); + AfterTargetsLocation = xml.AfterTargetsLocation; + BeforeTargetsLocation = xml.BeforeTargetsLocation; + ConditionLocation = xml.ConditionLocation; + DependsOnTargetsLocation = xml.DependsOnTargetsLocation; + InputsLocation = xml.InputsLocation; + KeepDuplicateOutputsLocation = xml.KeepDuplicateOutputsLocation; + Location = xml.Location; + OutputsLocation = xml.OutputsLocation; + ReturnsLocation = xml.ReturnsLocation; + } + + public IList<ProjectTargetInstanceChild> Children { get; private set; } + public string Condition { get; private set; } + public string DependsOnTargets { get; private set; } + public string FullPath { get; private set; } + public string Inputs { get; private set; } + public string KeepDuplicateOutputs { get; private set; } + public string Name { get; private set; } + public IList<ProjectOnErrorInstance> OnErrorChildren { get; private set; } + public string Outputs { get; private set; } + public string Returns { get; private set; } + public ICollection<ProjectTaskInstance> Tasks { get; private set; } +#if NET_4_5 + public ElementLocation AfterTargetsLocation { get; private set; } + public ElementLocation BeforeTargetsLocation { get; private set; } + public ElementLocation ConditionLocation { get; private set; } + public ElementLocation DependsOnTargetsLocation { get; private set; } + public ElementLocation InputsLocation { get; private set; } + public ElementLocation KeepDuplicateOutputsLocation { get; private set; } + public ElementLocation Location { get; private set; } + public ElementLocation OutputsLocation { get; private set; } + public ElementLocation ReturnsLocation { get; private set; } +#else + internal ElementLocation AfterTargetsLocation { get; private set; } + internal ElementLocation BeforeTargetsLocation { get; private set; } + internal ElementLocation ConditionLocation { get; private set; } + internal ElementLocation DependsOnTargetsLocation { get; private set; } + internal ElementLocation InputsLocation { get; private set; } + internal ElementLocation KeepDuplicateOutputsLocation { get; private set; } + internal ElementLocation Location { get; private set; } + internal ElementLocation OutputsLocation { get; private set; } + internal ElementLocation ReturnsLocation { get; private set; } +#endif + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstanceChild.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstanceChild.cs new file mode 100644 index 0000000000..aa38e6b006 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTargetInstanceChild.cs @@ -0,0 +1,52 @@ +// +// ProjectTargetInstanceChild.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using System; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public abstract class ProjectTargetInstanceChild + { + public abstract string Condition { get; } + public string FullPath { get; internal set; } + #if NET_4_5 + public + #else + internal + #endif + abstract ElementLocation ConditionLocation { get; } + + #if NET_4_5 + public + #else + internal + #endif + abstract ElementLocation Location { get; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskInstance.cs new file mode 100644 index 0000000000..bc53da1656 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskInstance.cs @@ -0,0 +1,108 @@ +// +// ProjectOnErrorInstance.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// (C) 2013 Xamarin Inc. +// +// 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. +// +using System; +using System.Collections.Generic; +using Microsoft.Build.Construction; +using System.Linq; + +namespace Microsoft.Build.Execution +{ + public sealed class ProjectTaskInstance : ProjectTargetInstanceChild + { + internal ProjectTaskInstance (ProjectTaskElement xml) + { + condition = xml.Condition; + ContinueOnError = xml.ContinueOnError; + Name = xml.Name; + Outputs = xml.Outputs.Select (o => { + if (o.IsOutputItem) + return (ProjectTaskInstanceChild) new ProjectTaskOutputItemInstance ((ProjectOutputElement) o); + if (o.IsOutputProperty) + return new ProjectTaskOutputPropertyInstance ((ProjectOutputElement) o); + throw new NotSupportedException (); + }).ToArray (); + Parameters = new Dictionary<string,string> (xml.Parameters); + #if NET_4_5 + MSBuildArchitecture = xml.MSBuildArchitecture; + MSBuildRuntime = xml.MSBuildRuntime; + + condition_location = xml.ConditionLocation; + ContinueOnErrorLocation = xml.ContinueOnErrorLocation; + location = xml.Location; + MSBuildArchitectureLocation = xml.MSBuildArchitectureLocation; + MSBuildRuntimeLocation = xml.MSBuildRuntimeLocation; + #endif + } + + string condition; + public override string Condition { + get { return condition; } + } + + ElementLocation condition_location, location; + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation ConditionLocation { + get { return condition_location; } + } + + #if NET_4_5 + public + #else + internal + #endif + override ElementLocation Location { + get { return location; } + } + + public string ContinueOnError { get; private set; } + + #if NET_4_5 + public ElementLocation ContinueOnErrorLocation { get; private set; } + + public string MSBuildArchitecture { get; private set; } + + public ElementLocation MSBuildArchitectureLocation { get; private set; } + + public string MSBuildRuntime { get; private set; } + + public ElementLocation MSBuildRuntimeLocation { get; private set; } + #endif + + public string Name { get; private set; } + + public IList<ProjectTaskInstanceChild> Outputs { get; private set; } + + public IDictionary<string, string> Parameters { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskInstanceChild.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskInstanceChild.cs new file mode 100644 index 0000000000..77ea7a2525 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskInstanceChild.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public abstract class ProjectTaskInstanceChild + { + public abstract string Condition { get; } + #if NET_4_5 + public abstract ElementLocation ConditionLocation { get; } + public abstract ElementLocation Location { get; } + public abstract ElementLocation TaskParameterLocation { get; } + #endif + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskOutputItemInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskOutputItemInstance.cs new file mode 100644 index 0000000000..356f9a62f2 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskOutputItemInstance.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public class ProjectTaskOutputItemInstance : ProjectTaskInstanceChild + { + internal ProjectTaskOutputItemInstance (ProjectOutputElement xml) + { + condition = xml.Condition; + ItemType = xml.ItemType; + TaskParameter = xml.TaskParameter; + #if NET_4_5 + condition_location = xml.ConditionLocation; + location = xml.Location; + task_parameter_location = xml.TaskParameterLocation; + #endif + } + + public string ItemType { get; private set; } + public string TaskParameter { get; private set; } + + readonly string condition; + public override string Condition { + get { return condition; } + } + #if NET_4_5 + readonly ElementLocation condition_location, location, task_parameter_location; + public ElementLocation ItemTypeLocation { get; private set; } + public override ElementLocation ConditionLocation { + get { return condition_location; } + } + public override ElementLocation Location { + get { return location; } + } + public override ElementLocation TaskParameterLocation { + get { return task_parameter_location; } + } + #endif + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskOutputPropertyInstance.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskOutputPropertyInstance.cs new file mode 100644 index 0000000000..855268e130 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/ProjectTaskOutputPropertyInstance.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.Build.Construction; + +namespace Microsoft.Build.Execution +{ + public class ProjectTaskOutputPropertyInstance : ProjectTaskInstanceChild + { + internal ProjectTaskOutputPropertyInstance (ProjectOutputElement xml) + { + condition = xml.Condition; + PropertyName = xml.PropertyName; + TaskParameter = xml.TaskParameter; + #if NET_4_5 + condition_location = xml.ConditionLocation; + location = xml.Location; + task_parameter_location = xml.TaskParameterLocation; + #endif + } + + public string PropertyName { get; private set; } + public string TaskParameter { get; private set; } + + readonly string condition; + public override string Condition { + get { return condition; } + } + + #if NET_4_5 + readonly ElementLocation condition_location, location, task_parameter_location; + public ElementLocation PropertyNameLocation { get; private set; } + public override ElementLocation ConditionLocation { + get { return condition_location; } + } + public override ElementLocation Location { + get { return location; } + } + public override ElementLocation TaskParameterLocation { + get { return task_parameter_location; } + } + #endif + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/TargetResult.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/TargetResult.cs index 863966ba78..d6dac3a8ff 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/TargetResult.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/TargetResult.cs @@ -26,30 +26,40 @@ // using Microsoft.Build.Framework; - using System; +using System.Linq; +using System.Collections.Generic; namespace Microsoft.Build.Execution { - public class TargetResult : ITargetResult - { - internal TargetResult () - { - throw new NotImplementedException (); - } + public class TargetResult : ITargetResult + { + internal TargetResult () + { + } - public Exception Exception { - get { throw new NotImplementedException (); } - } + public Exception Exception { get; private set; } - public ITaskItem[] Items { - get { throw new NotImplementedException (); } - } + public ITaskItem[] Items { get; private set; } + public TargetResultCode ResultCode { get; private set; } - public TargetResultCode ResultCode { - get { throw new NotImplementedException (); } - } - } + internal void Failure (Exception exception) + { + this.Exception = exception; + ResultCode = TargetResultCode.Failure; + } + + internal void Skip () + { + ResultCode = TargetResultCode.Skipped; + } + + internal void Success (IEnumerable<ITaskItem> items) + { + Items = items.ToArray (); + ResultCode = TargetResultCode.Success; + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs new file mode 100644 index 0000000000..22a8c615d4 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs @@ -0,0 +1,634 @@ +// +// BuildEngine4.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections; +using System.Collections.Generic; +using Microsoft.Build.Execution; +using Microsoft.Build.Framework; +using Microsoft.Build.Evaluation; +using System.Linq; +using System.IO; +using Microsoft.Build.Exceptions; +using System.Globalization; + +namespace Microsoft.Build.Internal +{ + class BuildEngine4 +#if NET_4_5 + : IBuildEngine4 +#else + : IBuildEngine3 +#endif + { + public BuildEngine4 (BuildSubmission submission) + { + this.submission = submission; + event_source = new Microsoft.Build.BuildEngine.EventSource (); + if (submission.BuildManager.OngoingBuildParameters.Loggers != null) + foreach (var l in submission.BuildManager.OngoingBuildParameters.Loggers) + l.Initialize (event_source); + } + + BuildSubmission submission; + ProjectInstance project; + ProjectTaskInstance current_task; + Microsoft.Build.BuildEngine.EventSource event_source; + + public ProjectCollection Projects { + get { return submission.BuildManager.OngoingBuildParameters.ProjectCollection; } + } + + // FIXME: + // While we are not faced to implement those features, there are some modern task execution requirements. + // + // This will have to be available for "out of process" nodes (see NodeAffinity). + // NodeAffinity is set per project file at BuildManager.HostServices. + // When NodeAffinity is set to OutOfProc, it should probably launch different build host + // that runs separate build tasks. (.NET has MSBuildTaskHost.exe which I guess is about that.) + // + // Also note that the complete implementation has to support LoadInSeparateAppDomainAttribute + // (which is most likely derived from AppDomainIsolatedBuildTask) that marks a task to run + // in separate AppDomain. + // + public void BuildProject (Func<bool> checkCancel, BuildResult result, ProjectInstance project, IEnumerable<string> targetNames, IDictionary<string,string> globalProperties, IDictionary<string,string> targetOutputs, string toolsVersion) + { + if (toolsVersion == null) + throw new ArgumentNullException ("toolsVersion"); + + var parameters = submission.BuildManager.OngoingBuildParameters; + var toolset = parameters.GetToolset (toolsVersion); + if (toolset == null) + throw new InvalidOperationException (string.Format ("Toolset version '{0}' was not resolved to valid toolset", toolsVersion)); + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Using Toolset version {0}.", toolsVersion), null, null, MessageImportance.Low)); + var buildTaskFactory = new BuildTaskFactory (BuildTaskDatabase.GetDefaultTaskDatabase (toolset), submission.BuildRequest.ProjectInstance.TaskDatabase); + BuildProject (new InternalBuildArguments () { CheckCancel = checkCancel, Result = result, Project = project, TargetNames = targetNames, GlobalProperties = globalProperties, TargetOutputs = targetOutputs, ToolsVersion = toolsVersion, BuildTaskFactory = buildTaskFactory }); + } + + class InternalBuildArguments + { + public Func<bool> CheckCancel; + public BuildResult Result; + public ProjectInstance Project; + public IEnumerable<string> TargetNames; + public IDictionary<string,string> GlobalProperties; + public IDictionary<string,string> TargetOutputs; + public string ToolsVersion; + public BuildTaskFactory BuildTaskFactory; + + public void AddTargetResult (string targetName, TargetResult targetResult) + { + if (!Result.HasResultsForTarget (targetName)) + Result.AddResultsForTarget (targetName, targetResult); + } + } + + void BuildProject (InternalBuildArguments args) + { + var request = submission.BuildRequest; + var parameters = submission.BuildManager.OngoingBuildParameters; + this.project = args.Project; + + event_source.FireBuildStarted (this, new BuildStartedEventArgs ("Build Started", null, DateTime.Now)); + + try { + + var initialPropertiesFormatted = "Initial Properties:\n" + string.Join (Environment.NewLine, project.Properties.OrderBy (p => p.Name).Select (p => string.Format ("{0} = {1}", p.Name, p.EvaluatedValue)).ToArray ()); + LogMessageEvent (new BuildMessageEventArgs (initialPropertiesFormatted, null, null, MessageImportance.Low)); + var initialItemsFormatted = "Initial Items:\n" + string.Join (Environment.NewLine, project.Items.OrderBy (i => i.ItemType).Select (i => string.Format ("{0} : {1}", i.ItemType, i.EvaluatedInclude)).ToArray ()); + LogMessageEvent (new BuildMessageEventArgs (initialItemsFormatted, null, null, MessageImportance.Low)); + + // null targets -> success. empty targets -> success(!) + if (request.TargetNames == null) + args.Result.OverallResult = BuildResultCode.Success; + else { + foreach (var targetName in (args.TargetNames ?? request.TargetNames).Where (t => t != null)) + BuildTargetByName (targetName, args); + + // FIXME: check .NET behavior, whether cancellation always results in failure. + args.Result.OverallResult = args.CheckCancel () ? BuildResultCode.Failure : args.Result.ResultsByTarget.Any (p => p.Value.ResultCode == TargetResultCode.Failure) ? BuildResultCode.Failure : BuildResultCode.Success; + } + } catch (Exception ex) { + args.Result.OverallResult = BuildResultCode.Failure; + LogErrorEvent (new BuildErrorEventArgs (null, null, project.FullPath, 0, 0, 0, 0, "Unhandled exception occured during a build", null, null)); + LogMessageEvent (new BuildMessageEventArgs ("Exception details: " + ex, null, null, MessageImportance.Low)); + throw; // BuildSubmission re-catches this. + } finally { + event_source.FireBuildFinished (this, new BuildFinishedEventArgs ("Build Finished.", null, args.Result.OverallResult == BuildResultCode.Success, DateTime.Now)); + } + } + + bool BuildTargetByName (string targetName, InternalBuildArguments args) + { + var request = submission.BuildRequest; + var parameters = submission.BuildManager.OngoingBuildParameters; + ProjectTargetInstance target; + TargetResult dummyResult; + + if (args.Result.ResultsByTarget.TryGetValue (targetName, out dummyResult) && dummyResult.ResultCode == TargetResultCode.Success) { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Target '{0}' was skipped because it was already built successfully.", targetName), null, null, MessageImportance.Low)); + return true; // do not add result. + } + + var targetResult = new TargetResult (); + + // null key is allowed and regarded as blind success(!) (as long as it could retrieve target) + if (!request.ProjectInstance.Targets.TryGetValue (targetName, out target)) + throw new InvalidOperationException (string.Format ("target '{0}' was not found in project '{1}'", targetName, project.FullPath)); + else if (!args.Project.EvaluateCondition (target.Condition)) { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Target '{0}' was skipped because condition '{1}' was not met.", target.Name, target.Condition), null, null, MessageImportance.Low)); + targetResult.Skip (); + } else { + // process DependsOnTargets first. + foreach (var dep in project.ExpandString (target.DependsOnTargets).Split (';').Select (s => s.Trim ()).Where (s => !string.IsNullOrEmpty (s))) { + if (!BuildTargetByName (dep, args)) { + return false; + } + } + + Func<string,ITaskItem> creator = s => new TargetOutputTaskItem () { ItemSpec = s }; + + event_source.FireTargetStarted (this, new TargetStartedEventArgs ("Target Started", null, target.Name, project.FullPath, target.FullPath)); + try { + if (!string.IsNullOrEmpty (target.Inputs) != !string.IsNullOrEmpty (target.Outputs)) { + targetResult.Failure (new InvalidProjectFileException (target.Location, null, string.Format ("Target {0} has mismatching Inputs and Outputs specification. When one is specified, another one has to be specified too.", targetName), null, null, null)); + } else { + bool skip = false; + if (!string.IsNullOrEmpty (target.Inputs)) { + var inputs = args.Project.GetAllItems (target.Inputs, string.Empty, creator, creator, s => true, (t, s) => { + }); + if (!inputs.Any ()) { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Target '{0}' was skipped because there is no input.", target.Name), null, null, MessageImportance.Low)); + skip = true; + } else { + var outputs = args.Project.GetAllItems (target.Outputs, string.Empty, creator, creator, s => true, (t, s) => { + }); + var needsUpdates = GetOlderOutputsThanInputs (inputs, outputs).FirstOrDefault (); + if (needsUpdates != null) + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Target '{0}' needs to be built because new output {1} is needed.", target.Name, needsUpdates.ItemSpec), null, null, MessageImportance.Low)); + else { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Target '{0}' was skipped because all the outputs are newer than all the inputs.", target.Name), null, null, MessageImportance.Low)); + skip = true; + } + } + } + if (skip) { + targetResult.Skip (); + } else { + if (DoBuildTarget (target, targetResult, args)) { + var items = args.Project.GetAllItems (target.Outputs, string.Empty, creator, creator, s => true, (t, s) => { + }); + targetResult.Success (items); + } + } + } + } finally { + event_source.FireTargetFinished (this, new TargetFinishedEventArgs ("Target Finished", null, targetName, project.FullPath, target.FullPath, targetResult.ResultCode != TargetResultCode.Failure)); + } + } + args.AddTargetResult (targetName, targetResult); + + return targetResult.ResultCode != TargetResultCode.Failure; + } + + IEnumerable<ITaskItem> GetOlderOutputsThanInputs (IEnumerable<ITaskItem> inputs, IEnumerable<ITaskItem> outputs) + { + return outputs.Where (o => !File.Exists (o.GetMetadata ("FullPath")) || inputs.Any (i => string.CompareOrdinal (i.GetMetadata ("LastModifiedTime"), o.GetMetadata ("LastModifiedTime")) > 0)); + } + + bool DoBuildTarget (ProjectTargetInstance target, TargetResult targetResult, InternalBuildArguments args) + { + var request = submission.BuildRequest; + + // Here we check cancellation (only after TargetStarted event). + if (args.CheckCancel ()) { + targetResult.Failure (new BuildAbortedException ("Build has canceled")); + return false; + } + + var propsToRestore = new Dictionary<string,string> (); + var itemsToRemove = new List<ProjectItemInstance> (); + try { + // Evaluate additional target properties + foreach (var c in target.Children.OfType<ProjectPropertyGroupTaskInstance> ()) { + if (!args.Project.EvaluateCondition (c.Condition)) + continue; + foreach (var p in c.Properties) { + if (!args.Project.EvaluateCondition (p.Condition)) + continue; + var value = args.Project.ExpandString (p.Value); + propsToRestore.Add (p.Name, project.GetPropertyValue (value)); + project.SetProperty (p.Name, value); + } + } + + // Evaluate additional target items + foreach (var c in target.Children.OfType<ProjectItemGroupTaskInstance> ()) { + if (!args.Project.EvaluateCondition (c.Condition)) + continue; + foreach (var item in c.Items) { + if (!args.Project.EvaluateCondition (item.Condition)) + continue; + Func<string,ProjectItemInstance> creator = i => new ProjectItemInstance (project, item.ItemType, item.Metadata.Select (m => new KeyValuePair<string,string> (m.Name, m.Value)), i); + foreach (var ti in project.GetAllItems (item.Include, item.Exclude, creator, creator, s => s == item.ItemType, (ti, s) => ti.SetMetadata ("RecurseDir", s))) + itemsToRemove.Add (ti); + } + } + + foreach (var c in target.Children.OfType<ProjectOnErrorInstance> ()) { + if (!args.Project.EvaluateCondition (c.Condition)) + continue; + throw new NotImplementedException (); + } + + // run tasks + foreach (var ti in target.Children.OfType<ProjectTaskInstance> ()) { + current_task = ti; + if (!args.Project.EvaluateCondition (ti.Condition)) { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Task '{0}' was skipped because condition '{1}' wasn't met.", ti.Name, ti.Condition), null, null, MessageImportance.Low)); + continue; + } + if (!RunBuildTask (target, ti, targetResult, args)) + return false; + } + } finally { + // restore temporary property state to the original state. + foreach (var p in propsToRestore) { + if (p.Value == string.Empty) + project.RemoveProperty (p.Key); + else + project.SetProperty (p.Key, p.Value); + } + foreach (var item in itemsToRemove) + project.RemoveItem (item); + } + return true; + } + + bool RunBuildTask (ProjectTargetInstance target, ProjectTaskInstance taskInstance, TargetResult targetResult, InternalBuildArguments args) + { + var request = submission.BuildRequest; + + var host = request.HostServices == null ? null : request.HostServices.GetHostObject (request.ProjectFullPath, target.Name, taskInstance.Name); + + // Create Task instance. + var factoryIdentityParameters = new Dictionary<string,string> (); + #if NET_4_5 + factoryIdentityParameters ["MSBuildRuntime"] = taskInstance.MSBuildRuntime; + factoryIdentityParameters ["MSBuildArchitecture"] = taskInstance.MSBuildArchitecture; + #endif + var task = args.BuildTaskFactory.CreateTask (taskInstance.Name, factoryIdentityParameters, this); + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Using task {0} from {1}", taskInstance.Name, task.GetType ().AssemblyQualifiedName), null, null, MessageImportance.Low)); + task.HostObject = host; + task.BuildEngine = this; + + // Prepare task parameters. + var evaluatedTaskParams = taskInstance.Parameters.Select (p => new KeyValuePair<string,string> (p.Key, project.ExpandString (p.Value))); + + var requiredProps = task.GetType ().GetProperties () + .Where (p => p.CanWrite && p.GetCustomAttributes (typeof (RequiredAttribute), true).Any ()); + var missings = requiredProps.Where (p => !evaluatedTaskParams.Any (tp => tp.Key.Equals (p.Name, StringComparison.OrdinalIgnoreCase))); + if (missings.Any ()) + throw new InvalidOperationException (string.Format ("Task {0} of type {1} is used without specifying mandatory property: {2}", + taskInstance.Name, task.GetType (), string.Join (", ", missings.Select (p => p.Name).ToArray ()))); + + foreach (var p in evaluatedTaskParams) { + var prop = task.GetType ().GetProperty (p.Key); + if (prop == null) + throw new InvalidOperationException (string.Format ("Task {0} does not have property {1}", taskInstance.Name, p.Key)); + if (!prop.CanWrite) + throw new InvalidOperationException (string.Format ("Task {0} has property {1} but it is read-only.", taskInstance.Name, p.Key)); + if (string.IsNullOrEmpty (p.Value) && !requiredProps.Contains (prop)) + continue; + try { + var valueInstance = ConvertTo (p.Value, prop.PropertyType); + prop.SetValue (task, valueInstance, null); + } catch (Exception ex) { + throw new InvalidOperationException (string.Format ("Failed to convert '{0}' for property '{1}' of type {2}", p.Value, prop.Name, prop.PropertyType), ex); + } + } + + // Do execute task. + bool taskSuccess = false; + event_source.FireTaskStarted (this, new TaskStartedEventArgs ("Task Started", null, project.FullPath, taskInstance.FullPath, taskInstance.Name)); + try { + taskSuccess = task.Execute (); + + if (!taskSuccess) { + targetResult.Failure (null); + if (!ContinueOnError) { + return false; + } + } else { + // Evaluate task output properties and items. + foreach (var to in taskInstance.Outputs) { + if (!project.EvaluateCondition (to.Condition)) + continue; + var toItem = to as ProjectTaskOutputItemInstance; + var toProp = to as ProjectTaskOutputPropertyInstance; + string taskParameter = toItem != null ? toItem.TaskParameter : toProp.TaskParameter; + var pi = task.GetType ().GetProperty (taskParameter); + if (pi == null) + throw new InvalidOperationException (string.Format ("Task {0} does not have property {1} specified as TaskParameter", taskInstance.Name, toItem.TaskParameter)); + if (!pi.CanRead) + throw new InvalidOperationException (string.Format ("Task {0} has property {1} specified as TaskParameter, but it is write-only", taskInstance.Name, toItem.TaskParameter)); + var value = ConvertFrom (pi.GetValue (task, null)); + if (toItem != null) { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Output Item {0} from TaskParameter {1}: {2}", toItem.ItemType, toItem.TaskParameter, value), null, null, MessageImportance.Low)); + foreach (var item in value.Split (';')) + args.Project.AddItem (toItem.ItemType, item); + } else { + LogMessageEvent (new BuildMessageEventArgs (string.Format ("Output Property {0} from TaskParameter {1}: {2}", toProp.PropertyName, toProp.TaskParameter, value), null, null, MessageImportance.Low)); + args.Project.SetProperty (toProp.PropertyName, value); + } + } + } + } finally { + event_source.FireTaskFinished (this, new TaskFinishedEventArgs ("Task Finished", null, project.FullPath, taskInstance.FullPath, taskInstance.Name, taskSuccess)); + } + return true; + } + + object ConvertTo (string source, Type targetType) + { + if (targetType == typeof(ITaskItem) || targetType.IsSubclassOf (typeof(ITaskItem))) + return new TargetOutputTaskItem () { ItemSpec = WindowsCompatibilityExtensions.NormalizeFilePath (source.Trim ()) }; + if (targetType.IsArray) + return new ArrayList (source.Split (';').Select (s => s.Trim ()).Where (s => !string.IsNullOrEmpty (s)).Select (s => ConvertTo (s, targetType.GetElementType ())).ToArray ()) + .ToArray (targetType.GetElementType ()); + if (targetType == typeof(bool)) { + switch (source != null ? source.ToLower (CultureInfo.InvariantCulture) : string.Empty) { + case "true": + case "yes": + case "on": + return true; + case "false": + case "no": + case "off": + case "": + return false; + } + } + return Convert.ChangeType (source == "" ? null : source, targetType); + } + + string ConvertFrom (object source) + { + if (source == null) + return string.Empty; + if (source is ITaskItem) + return ((ITaskItem) source).ItemSpec; + if (source.GetType ().IsArray) + return string.Join (";", ((Array) source).Cast<object> ().Select (o => ConvertFrom (o)).ToArray ()); + else + return (string) Convert.ChangeType (source, typeof (string)); + } + + class TargetOutputTaskItem : ITaskItem2 + { + Hashtable metadata = new Hashtable (); + + #region ITaskItem2 implementation + public string GetMetadataValueEscaped (string metadataName) + { + return ProjectCollection.Escape ((string) metadata [metadataName]); + } + public void SetMetadataValueLiteral (string metadataName, string metadataValue) + { + metadata [metadataName] = ProjectCollection.Unescape (metadataValue); + } + public IDictionary CloneCustomMetadataEscaped () + { + var ret = new Hashtable (); + foreach (DictionaryEntry e in metadata) + ret [e.Key] = ProjectCollection.Escape ((string) e.Value); + return ret; + } + public string EvaluatedIncludeEscaped { + get { return ProjectCollection.Escape (ItemSpec); } + set { ItemSpec = ProjectCollection.Unescape (value); } + } + #endregion + #region ITaskItem implementation + public IDictionary CloneCustomMetadata () + { + return new Hashtable (metadata); + } + public void CopyMetadataTo (ITaskItem destinationItem) + { + foreach (DictionaryEntry e in metadata) + destinationItem.SetMetadata ((string) e.Key, (string) e.Value); + } + public string GetMetadata (string metadataName) + { + var wk = ProjectCollection.GetWellKnownMetadata (metadataName, ItemSpec, Path.GetFullPath, null); + if (wk != null) + return wk; + return (string) metadata [metadataName]; + } + public void RemoveMetadata (string metadataName) + { + metadata.Remove (metadataName); + } + public void SetMetadata (string metadataName, string metadataValue) + { + metadata [metadataName] = metadataValue; + } + public string ItemSpec { get; set; } + public int MetadataCount { + get { return metadata.Count; } + } + public ICollection MetadataNames { + get { return metadata.Keys; } + } + #endregion + } + +#if NET_4_5 + #region IBuildEngine4 implementation + + // task objects are not in use anyways though... + + class TaskObjectRegistration + { + public TaskObjectRegistration (object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection) + { + Key = key; + Object = obj; + Lifetime = lifetime; + AllowEarlyCollection = allowEarlyCollection; + } + public object Key { get; private set; } + public object Object { get; private set; } + public RegisteredTaskObjectLifetime Lifetime { get; private set; } + public bool AllowEarlyCollection { get; private set; } + } + + List<TaskObjectRegistration> task_objects = new List<TaskObjectRegistration> (); + + public object GetRegisteredTaskObject (object key, RegisteredTaskObjectLifetime lifetime) + { + var reg = task_objects.FirstOrDefault (t => t.Key == key && t.Lifetime == lifetime); + return reg != null ? reg.Object : null; + } + + public void RegisterTaskObject (object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection) + { + task_objects.Add (new TaskObjectRegistration (key, obj, lifetime, allowEarlyCollection)); + } + + public object UnregisterTaskObject (object key, RegisteredTaskObjectLifetime lifetime) + { + var reg = task_objects.FirstOrDefault (t => t.Key == key && t.Lifetime == lifetime); + if (reg != null) + task_objects.Remove (reg); + return reg.Object; + } + #endregion +#endif + + #region IBuildEngine3 implementation + + public BuildEngineResult BuildProjectFilesInParallel (string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<string>[] removeGlobalProperties, string[] toolsVersion, bool returnTargetOutputs) + { + throw new NotImplementedException (); + } + + public void Reacquire () + { + throw new NotImplementedException (); + } + + public void Yield () + { + throw new NotImplementedException (); + } + + #endregion + + #region IBuildEngine2 implementation + + public bool BuildProjectFile (string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs, string toolsVersion) + { + var proj = GetProjectInstance (projectFileName, toolsVersion); + var globalPropertiesThatMakeSense = new Dictionary<string,string> (); + foreach (DictionaryEntry p in globalProperties) + globalPropertiesThatMakeSense [(string) p.Key] = (string) p.Value; + var result = new BuildResult (); + var outputs = new Dictionary<string, string> (); + BuildProject (() => false, result, proj, targetNames, globalPropertiesThatMakeSense, outputs, toolsVersion); + foreach (var p in outputs) + targetOutputs [p.Key] = p.Value; + return result.OverallResult == BuildResultCode.Success; + } + + public bool BuildProjectFilesInParallel (string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IDictionary[] targetOutputsPerProject, string[] toolsVersion, bool useResultsCache, bool unloadProjectsOnCompletion) + { + throw new NotImplementedException (); + } + + public bool IsRunningMultipleNodes { + get { + throw new NotImplementedException (); + } + } + + ProjectInstance GetProjectInstance (string projectFileName, string toolsVersion) + { + string fullPath = Path.GetFullPath (projectFileName); + if (submission.BuildRequest.ProjectFullPath == fullPath) + return submission.BuildRequest.ProjectInstance; + // FIXME: could also be filtered by global properties + // http://msdn.microsoft.com/en-us/library/microsoft.build.evaluation.projectcollection.getloadedprojects.aspx + var project = Projects.GetLoadedProjects (projectFileName).FirstOrDefault (p => p.ToolsVersion == toolsVersion); + if (project == null) + throw new InvalidOperationException (string.Format ("Project '{0}' is not loaded", projectFileName)); + return submission.BuildManager.GetProjectInstanceForBuild (project); + } + + #endregion + + #region IBuildEngine implementation + + public bool BuildProjectFile (string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) + { + return BuildProjectFile (projectFileName, targetNames, globalProperties, targetOutputs, Projects.DefaultToolsVersion); + } + + public void LogCustomEvent (CustomBuildEventArgs e) + { + event_source.FireCustomEventRaised (this, e); + } + + public void LogErrorEvent (BuildErrorEventArgs e) + { + event_source.FireErrorRaised (this, e); + } + + public void LogMessageEvent (BuildMessageEventArgs e) + { + event_source.FireMessageRaised (this, e); + } + + public void LogWarningEvent (BuildWarningEventArgs e) + { + event_source.FireWarningRaised (this, e); + } + + public int ColumnNumberOfTaskNode { + get { return current_task.Location != null ? current_task.Location.Column : 0; } + } + + public bool ContinueOnError { + get { return current_task != null && project.EvaluateCondition (current_task.Condition) && EvaluateContinueOnError (current_task.ContinueOnError); } + } + + bool EvaluateContinueOnError (string value) + { + switch (value) { + case "WarnAndContinue": + case "ErrorAndContinue": + return true; + case "ErrorAndStop": + return false; + } + // empty means "stop on error", so don't pass empty string to EvaluateCondition(). + return !string.IsNullOrEmpty (value) && project.EvaluateCondition (value); + } + + public int LineNumberOfTaskNode { + get { return current_task.Location != null ? current_task.Location.Line : 0; } + } + + public string ProjectFileOfTaskNode { + get { return current_task.FullPath; } + } + + #endregion + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildNodeManager.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildNodeManager.cs new file mode 100644 index 0000000000..ebfad5ba75 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildNodeManager.cs @@ -0,0 +1,209 @@ +// +// BuildNodeManager.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Execution; +using Microsoft.Build.Framework; +using System.Threading.Tasks; +using System.Threading; +using System.Collections.Concurrent; + +namespace Microsoft.Build.Internal +{ + class BuildNodeManager + { + public BuildNodeManager (BuildManager buildManager) + { + BuildManager = buildManager; + new Thread (RunLoop).Start (); + } + + ~BuildNodeManager () + { + run_loop = false; + queue_wait_handle.Set (); + } + + public BuildManager BuildManager { get; private set; } + + List<BuildNode> in_proc_nodes = new List<BuildNode> (); + List<BuildNode> out_proc_nodes = new List<BuildNode> (); + AutoResetEvent queue_wait_handle = new AutoResetEvent (false); + ConcurrentQueue<BuildSubmission> queued_builds = new ConcurrentQueue<BuildSubmission> (); + // FIXME: currently it is not in use but it should be stored somewhere for cancellation. + Dictionary<BuildSubmission,Task> ongoing_builds = new Dictionary<BuildSubmission, Task> (); + bool run_loop = true; + + readonly TaskFactory<BuildResult> task_factory = new TaskFactory<BuildResult> (); + internal TaskFactory<BuildResult> ThreadTaskFactory { + get { return task_factory; } + } + + void RunLoop () + { + while (run_loop) { + try { + if (queued_builds.Count == 0) + queue_wait_handle.WaitOne (); + if (!run_loop) + break; + BuildSubmission build; + if (!queued_builds.TryDequeue (out build)) + continue; + StartOneBuild (build); + } catch (Exception ex) { + // FIXME: I guess INodeLogger should be used instead. + Console.Error.WriteLine ("Uncaught build node exception occured"); + Console.Error.WriteLine (ex); + } + } + } + + public void Stop () + { + run_loop = false; + queue_wait_handle.Set (); + } + + public void ResetCaches () + { + in_proc_nodes.Clear (); + out_proc_nodes.Clear (); + } + + public void Enqueue (BuildSubmission build) + { + queued_builds.Enqueue (build); + queue_wait_handle.Set (); + } + + void StartOneBuild (BuildSubmission build) + { + var node = TakeNode (build); + // FIXME: Task (non-generic) here causes NotImplementedException in somewhere in Interlocked. It does not make sense. + ongoing_builds [build] = task_factory.StartNew (node.ExecuteBuild); + //new Thread (() => { node.ExecuteBuild (); }).Start (); + } + + void EndOneBuild (BuildNode node) + { + var task = ongoing_builds [node.Build]; + ongoing_builds [node.Build] = null; + node.Release (); + } + + // FIXME: take max nodes into account here, and get throttling working. + BuildNode TakeNode (BuildSubmission build) + { + var host = BuildManager.OngoingBuildParameters.HostServices; + NodeAffinity affinity; + if (host == null) + affinity = NodeAffinity.Any; + else + affinity = host.GetNodeAffinity (build.BuildRequest.ProjectFullPath); + BuildNode n = GetReusableNode (affinity); + if (n != null) + n.Assign (build); + else { + n = new BuildNode (this, affinity == NodeAffinity.Any ? NodeAffinity.InProc : affinity); + n.Assign (build); + if (n.Affinity == NodeAffinity.InProc) + in_proc_nodes.Add (n); + else + out_proc_nodes.Add (n); + } + return n; + } + + BuildNode GetReusableNode (NodeAffinity affinity) + { + if (!BuildManager.OngoingBuildParameters.EnableNodeReuse) + return null; + + if (affinity != NodeAffinity.OutOfProc) + foreach (var n in in_proc_nodes) + if (n.IsAvailable && (n.Affinity & affinity) != 0) + return n; + if (affinity != NodeAffinity.InProc) + foreach (var n in out_proc_nodes) + if (n.IsAvailable && (n.Affinity & affinity) != 0) + return n; + return null; + } + + internal class BuildNode + { + static Random rnd = new Random (); + + public BuildNode (BuildNodeManager manager, NodeAffinity affinity) + { + Manager = manager; + Affinity = affinity; + Id = rnd.Next (); + } + + public bool IsAvailable { get; private set; } + public int Id { get; private set; } + public BuildNodeManager Manager { get; set; } + public NodeAffinity Affinity { get; private set; } + public BuildSubmission Build { get; private set; } + + public void Assign (BuildSubmission build) + { + IsAvailable = false; + Build = build; + } + + public void Release () + { + Build = null; + IsAvailable = true; + } + + public BuildResult ExecuteBuild () + { + BuildResult result; + try { + // FIXME: depending on NodeAffinity, build it through another MSBuild process. + if (Affinity == NodeAffinity.OutOfProc) + throw new NotImplementedException (); + result = Build.InternalExecute (); + } catch (Exception ex) { + // FIXME: I guess INodeLogger should be used instead. + Console.Error.WriteLine ("Uncaught build node exception occured"); + Console.Error.WriteLine (ex); + result = null; + } finally { + Manager.EndOneBuild (this); + } + return result; + } + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildTaskDatabase.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildTaskDatabase.cs new file mode 100644 index 0000000000..0b7660b2d4 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildTaskDatabase.cs @@ -0,0 +1,138 @@ +// +// BuildTaskFactory.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Framework; +using System.Reflection; +using Microsoft.Build.Execution; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Construction; +using System.IO; +using System.Xml; + +namespace Microsoft.Build.Internal +{ + class BuildTaskDatabase + { + const string default_tasks_file = "Microsoft.Common.tasks"; + static readonly Dictionary<string,BuildTaskDatabase> default_factory = new Dictionary<string, BuildTaskDatabase> (); + + public static BuildTaskDatabase GetDefaultTaskDatabase (Toolset toolset) + { + if (toolset == null) + throw new ArgumentNullException ("toolset"); + BuildTaskDatabase defaults; + if (!default_factory.TryGetValue (toolset.ToolsVersion, out defaults)) { + defaults = new BuildTaskDatabase (toolset); + } + return defaults; + } + + // for 'default' tasks. + BuildTaskDatabase (Toolset toolset) + { + ProjectRootElement root; + using (var xml = XmlReader.Create (Path.Combine (toolset.ToolsPath, default_tasks_file))) + root = ProjectRootElement.Create (xml); + LoadUsingTasks (null, root); + } + + public BuildTaskDatabase (ProjectInstance projectInstance, ProjectRootElement projectRootElement) + { + LoadUsingTasks (projectInstance, projectRootElement); + } + + internal class TaskDescription + { + public TaskAssembly TaskAssembly { get; set; } + public string Name { get; set; } + public Type TaskFactoryType { get; set; } + public Type TaskType { get; set; } + public IDictionary<string, TaskPropertyInfo> TaskFactoryParameters { get; set; } + public string TaskBody { get; set; } + + public bool IsMatch (string name) + { + int ridx = Name.LastIndexOf ('.'); + int tidx = name.IndexOf ('.'); + return string.Equals (Name, name, StringComparison.OrdinalIgnoreCase) || + tidx < 0 && ridx > 0 && string.Equals (Name.Substring (ridx + 1), name, StringComparison.OrdinalIgnoreCase); + } + } + + internal class TaskAssembly + { + public string AssemblyName { get; set; } + public string AssemblyFile { get; set; } + public Assembly LoadedAssembly { get; set; } + } + + readonly List<TaskAssembly> assemblies = new List<TaskAssembly> (); + readonly List<TaskDescription> task_descs = new List<TaskDescription> (); + + public List<TaskDescription> Tasks { + get { return task_descs; } + } + + void LoadUsingTasks (ProjectInstance projectInstance, ProjectRootElement project) + { + Func<string,bool> cond = s => projectInstance != null ? projectInstance.EvaluateCondition (s) : Convert.ToBoolean (s); + foreach (var ut in project.UsingTasks) { + var ta = assemblies.FirstOrDefault (a => a.AssemblyFile.Equals (ut.AssemblyFile, StringComparison.OrdinalIgnoreCase) || a.AssemblyName.Equals (ut.AssemblyName, StringComparison.OrdinalIgnoreCase)); + if (ta == null) { + ta = new TaskAssembly () { AssemblyName = ut.AssemblyName, AssemblyFile = ut.AssemblyFile }; + ta.LoadedAssembly = ta.AssemblyName != null ? Assembly.Load (ta.AssemblyName) : Assembly.LoadFile (ta.AssemblyFile); + assemblies.Add (ta); + } + var pg = ut.ParameterGroup == null ? null : ut.ParameterGroup.Parameters.Select (p => new TaskPropertyInfo (p.Name, Type.GetType (p.ParameterType), cond (p.Output), cond (p.Required))) + .ToDictionary (p => p.Name); + var task = new TaskDescription () { + TaskAssembly = ta, + Name = ut.TaskName, + TaskFactoryType = string.IsNullOrEmpty (ut.TaskFactory) ? null : LoadTypeFrom (ta.LoadedAssembly, ut.TaskName, ut.TaskFactory), + TaskType = string.IsNullOrEmpty (ut.TaskFactory) ? LoadTypeFrom (ta.LoadedAssembly, ut.TaskName, ut.TaskName) : null, + TaskFactoryParameters = pg, + TaskBody = ut.TaskBody != null && cond (ut.TaskBody.Condition) ? ut.TaskBody.Evaluate : null, + }; + task_descs.Add (task); + } + } + + Type LoadTypeFrom (Assembly a, string taskName, string possiblyShortTypeName) + { + Type type = a.GetType (possiblyShortTypeName, false, true); + if (possiblyShortTypeName.IndexOf ('.') < 0) + type = a.GetTypes ().FirstOrDefault (t => t.Name == possiblyShortTypeName); + if (type == null) + throw new InvalidOperationException (string.Format ("For task '{0}' Specified type '{1}' was not found in assembly '{2}'", taskName, possiblyShortTypeName, a.FullName)); + return type; + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildTaskFactory.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildTaskFactory.cs new file mode 100644 index 0000000000..c587b35136 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildTaskFactory.cs @@ -0,0 +1,81 @@ +// BuildTaskFactory.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. +// +// 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. +// + +using System; +using System.Threading; +using System.Threading.Tasks; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Internal; +using System.Collections.Generic; +using Microsoft.Build.Execution; + +namespace Microsoft.Build.Internal +{ + class BuildTaskFactory + { + public BuildTaskFactory (BuildTaskDatabase builtInDatabase, BuildTaskDatabase perProjectDatabase) + { + this.built_in_database = builtInDatabase; + this.per_project_database = perProjectDatabase; + } + + readonly BuildTaskDatabase built_in_database, per_project_database; + readonly List<ITaskFactory> task_factories = new List<ITaskFactory> (); + + public void ResetCaches () + { + task_factories.Clear (); + } + + public ITask CreateTask (string name, IDictionary<string,string> factoryIdentityParameters, IBuildEngine engine) + { + Func<BuildTaskDatabase.TaskDescription,bool> fn = t => t.IsMatch (name); + var td = per_project_database.Tasks.FirstOrDefault (fn) ?? built_in_database.Tasks.FirstOrDefault (fn); + if (td == null) + throw new InvalidOperationException (string.Format ("Task '{0}' could not be found", name)); + if (td.TaskFactoryType != null) { + var tf = task_factories.FirstOrDefault (f => f.GetType () == td.TaskFactoryType); + if (tf == null) { + tf = (ITaskFactory) Activator.CreateInstance (td.TaskFactoryType); +#if NET_4_5 + var tf2 = tf as ITaskFactory2; + if (tf2 != null) + tf2.Initialize (name, factoryIdentityParameters, td.TaskFactoryParameters, td.TaskBody, engine); + else +#endif + tf.Initialize (name, td.TaskFactoryParameters, td.TaskBody, engine); + task_factories.Add (tf); + } + return tf.CreateTask (engine); + } + else + return (ITask) Activator.CreateInstance (td.TaskType); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionConstructs.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionConstructs.cs new file mode 100644 index 0000000000..358f58e925 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionConstructs.cs @@ -0,0 +1,197 @@ +// +// ExpressionConstructs.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Build.Internal.Expressions +{ + + class Locatable + { + public ILocation Location { get; set; } + } + + partial class ExpressionList : ILocation, IEnumerable<Expression> + { + public ExpressionList () + { + } + + public ExpressionList (Expression entry) + { + Add (entry); + } + + public int Count { + get { return list.Count; } + } + + //public int Line { + // get { return list.Count == 0 ? 0 : list [0].Line; } + //} + public int Column { + get { return list.Count == 0 ? 0 : list [0].Column; } + } + public string File { + get { return list.Count == 0 ? null : list [0].File; } + } + public string ToLocationString () + { + return list.Count == 0 ? null : list [0].Location.ToLocationString (); + } + + public IEnumerator<Expression> GetEnumerator () + { + return list.GetEnumerator (); + } + + IEnumerator IEnumerable.GetEnumerator () + { + return list.GetEnumerator (); + } + + List<Expression> list = new List<Expression> (); + + public ExpressionList Add (Expression expr) + { + list.Add (expr); + return this; + } + + public ExpressionList Insert (int pos, Expression expr) + { + list.Insert (pos, expr); + return this; + } + } + + abstract partial class Expression : Locatable, ILocation + { + //public int Line { + // get { return Location.Line; } + //} + public int Column { + get { return Location.Column; } + } + public string File { + get { return Location.File; } + } + public string ToLocationString () + { + return Location.ToLocationString (); + } + } + + enum Operator + { + EQ, + NE, + LT, + LE, + GT, + GE, + And, + Or + } + + partial class BinaryExpression : Expression + { + public Operator Operator { get; set; } + public Expression Left { get; set; } + public Expression Right { get; set; } + } + + partial class BooleanLiteral : Expression + { + public bool Value { get; set; } + } + + partial class NotExpression : Expression + { + public Expression Negated { get; set; } + } + + partial class PropertyAccessExpression : Expression + { + public PropertyAccess Access { get; set; } + } + + enum PropertyTargetType + { + Object, + Type, + } + + class PropertyAccess : Locatable + { + public NameToken Name { get; set; } + public Expression Target { get; set; } + public PropertyTargetType TargetType { get; set; } + public ExpressionList Arguments { get; set; } + } + + partial class ItemAccessExpression : Expression + { + public ItemApplication Application { get; set; } + } + + class ItemApplication : Locatable + { + public NameToken Name { get; set; } + public ExpressionList Expressions { get; set; } + } + + partial class MetadataAccessExpression : Expression + { + public MetadataAccess Access { get; set; } + } + + class MetadataAccess : Locatable + { + public NameToken Metadata { get; set; } + public NameToken ItemType { get; set; } + } + + partial class StringLiteral : Expression + { + public NameToken Value { get; set; } + } + + partial class RawStringLiteral : Expression + { + public NameToken Value { get; set; } + } + + partial class FunctionCallExpression : Expression + { + public NameToken Name { get; set; } + public ExpressionList Arguments { get; set; } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionEvaluator.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionEvaluator.cs new file mode 100644 index 0000000000..4aa9b259f2 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionEvaluator.cs @@ -0,0 +1,521 @@ +// +// ExpressionEvaluator.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Linq; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.Build.Execution; +using Microsoft.Build.Framework; +using System.IO; + +namespace Microsoft.Build.Internal.Expressions +{ + class ExpressionEvaluator + { + public ExpressionEvaluator (Project project, string replacementForMissingPropertyAndItem) + { + ReplacementForMissingPropertyAndItem = replacementForMissingPropertyAndItem; + Project = project; + /* + GetItems = (name) => project.GetItems (name).Select (i => new KeyValuePair<string,string> (i.ItemType, i.EvaluatedInclude)); + GetProperty = (name) => { + var prop = project.GetProperty (name); + return new KeyValuePair<string,string> (prop != null ? prop.Name : null, prop != null ? prop.EvaluatedValue : null); + }; + */ + } + + public ExpressionEvaluator (ProjectInstance project, string replacementForMissingPropertyAndItem) + { + ReplacementForMissingPropertyAndItem = replacementForMissingPropertyAndItem; + ProjectInstance = project; + /* + GetItems = (name) => project.GetItems (name).Select (i => new KeyValuePair<string,string> (i.ItemType, i.EvaluatedInclude)); + GetProperty = (name) => { + var prop = project.GetProperty (name); + return new KeyValuePair<string,string> (prop != null ? prop.Name : null, prop != null ? prop.EvaluatedValue : null); + }; + */ + } + + EvaluationContext CreateContext (string source) + { + return new EvaluationContext (source, this); + } + + public Project Project { get; private set; } + public ProjectInstance ProjectInstance { get; set; } + //public Func<string,IEnumerable<KeyValuePair<string,string>>> GetItems { get; private set; } + //public Func<string,KeyValuePair<string,string>> GetProperty { get; private set; } + + public string ReplacementForMissingPropertyAndItem { get; set; } + + // it is to prevent sequential property value expansion in boolean expression + public string Wrapper { + get { return ReplacementForMissingPropertyAndItem != null ? "'" : null; } + } + + public string Evaluate (string source) + { + return Evaluate (source, new ExpressionParserManual (source ?? string.Empty, ExpressionValidationType.LaxString).Parse ()); + } + + string Evaluate (string source, ExpressionList exprList) + { + if (exprList == null) + throw new ArgumentNullException ("exprList"); + return string.Concat (exprList.Select (e => e.EvaluateAsString (CreateContext (source)))); + } + + public bool EvaluateAsBoolean (string source) + { + try { + var el = new ExpressionParser ().Parse (source, ExpressionValidationType.StrictBoolean); + if (el.Count () != 1) + throw new InvalidProjectFileException ("Unexpected number of tokens: " + el.Count ()); + return el.First ().EvaluateAsBoolean (CreateContext (source)); + } catch (yyParser.yyException ex) { + throw new InvalidProjectFileException (string.Format ("failed to evaluate expression as boolean: '{0}': {1}", source, ex.Message), ex); + } + } + } + + class EvaluationContext + { + public EvaluationContext (string source, ExpressionEvaluator evaluator) + { + Source = source; + Evaluator = evaluator; + } + + public string Source { get; private set; } + + public ExpressionEvaluator Evaluator { get; private set; } + public object ContextItem { get; set; } + + Stack<object> evaluating_items = new Stack<object> (); + Stack<object> evaluating_props = new Stack<object> (); + + public IEnumerable<object> GetItems (string name) + { + if (Evaluator.Project != null) + return Evaluator.Project.GetItems (name); + else + return Evaluator.ProjectInstance.GetItems (name); + } + + public IEnumerable<object> GetAllItems () + { + if (Evaluator.Project != null) + return Evaluator.Project.AllEvaluatedItems; + else + return Evaluator.ProjectInstance.AllEvaluatedItems; + } + + public string EvaluateItem (string itemType, object item) + { + if (evaluating_items.Contains (item)) + throw new InvalidProjectFileException (string.Format ("Recursive reference to item '{0}' was found", itemType)); + try { + evaluating_items.Push (item); + var eval = item as ProjectItem; + if (eval != null) + return Evaluator.Evaluate (eval.EvaluatedInclude); + else + return Evaluator.Evaluate (((ProjectItemInstance) item).EvaluatedInclude); + } finally { + evaluating_items.Pop (); + } + } + + public string EvaluateProperty (string name) + { + if (Evaluator.Project != null) { + var prop = Evaluator.Project.GetProperty (name); + if (prop == null) + return null; + return EvaluateProperty (prop, prop.Name, prop.EvaluatedValue); + } else { + var prop = Evaluator.ProjectInstance.GetProperty (name); + if (prop == null) + return null; + return EvaluateProperty (prop, prop.Name, prop.EvaluatedValue); + } + } + + public string EvaluateProperty (object prop, string name, string value) + { + if (evaluating_props.Contains (prop)) + throw new InvalidProjectFileException (string.Format ("Recursive reference to property '{0}' was found", name)); + try { + evaluating_props.Push (prop); + // FIXME: needs verification on whether string evaluation is appropriate or not. + return Evaluator.Evaluate (value); + } finally { + evaluating_props.Pop (); + } + } + } + + abstract partial class Expression + { + public abstract string EvaluateAsString (EvaluationContext context); + public abstract bool EvaluateAsBoolean (EvaluationContext context); + public abstract object EvaluateAsObject (EvaluationContext context); + + public bool EvaluateStringAsBoolean (EvaluationContext context, string ret) + { + if (ret != null) { + if (ret.Equals ("TRUE", StringComparison.InvariantCultureIgnoreCase)) + return true; + else if (ret.Equals ("FALSE", StringComparison.InvariantCultureIgnoreCase)) + return false; + } + throw new InvalidProjectFileException (this.Location, string.Format ("Condition '{0}' is evaluated as '{1}' and cannot be converted to boolean", context.Source, ret)); + } + } + + partial class BinaryExpression : Expression + { + public override bool EvaluateAsBoolean (EvaluationContext context) + { + switch (Operator) { + case Operator.EQ: + return string.Equals (Left.EvaluateAsString (context), Right.EvaluateAsString (context), StringComparison.OrdinalIgnoreCase); + case Operator.NE: + return !string.Equals (Left.EvaluateAsString (context), Right.EvaluateAsString (context), StringComparison.OrdinalIgnoreCase); + case Operator.And: + case Operator.Or: + // evaluate first, to detect possible syntax error on right expr. + var lb = Left.EvaluateAsBoolean (context); + var rb = Right.EvaluateAsBoolean (context); + return Operator == Operator.And ? (lb && rb) : (lb || rb); + } + // comparison expressions - evaluate comparable first, then compare values. + var left = Left.EvaluateAsObject (context); + var right = Right.EvaluateAsObject (context); + if (!(left is IComparable && right is IComparable)) + throw new InvalidProjectFileException ("expression cannot be evaluated as boolean"); + var result = ((IComparable) left).CompareTo (right); + switch (Operator) { + case Operator.GE: + return result >= 0; + case Operator.GT: + return result > 0; + case Operator.LE: + return result <= 0; + case Operator.LT: + return result < 0; + } + throw new InvalidOperationException (); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + throw new NotImplementedException (); + } + + static readonly Dictionary<Operator,string> strings = new Dictionary<Operator, string> () { + {Operator.EQ, " == "}, + {Operator.NE, " != "}, + {Operator.LT, " < "}, + {Operator.LE, " <= "}, + {Operator.GT, " > "}, + {Operator.GE, " >= "}, + {Operator.And, " And "}, + {Operator.Or, " Or "}, + }; + + public override string EvaluateAsString (EvaluationContext context) + { + return Left.EvaluateAsString (context) + strings [Operator] + Right.EvaluateAsString (context); + } + } + + partial class BooleanLiteral : Expression + { + public override string EvaluateAsString (EvaluationContext context) + { + return Value ? "True" : "False"; + } + + public override bool EvaluateAsBoolean (EvaluationContext context) + { + return Value; + } + + public override object EvaluateAsObject (EvaluationContext context) + { + return Value; + } + } + + partial class NotExpression : Expression + { + public override string EvaluateAsString (EvaluationContext context) + { + // no negation for string + return "!" + Negated.EvaluateAsString (context); + } + + public override bool EvaluateAsBoolean (EvaluationContext context) + { + return !Negated.EvaluateAsBoolean (context); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + return EvaluateAsString (context); + } + } + + partial class PropertyAccessExpression : Expression + { + public override bool EvaluateAsBoolean (EvaluationContext context) + { + var ret = EvaluateAsString (context); + return EvaluateStringAsBoolean (context, ret); + } + + public override string EvaluateAsString (EvaluationContext context) + { + var ret = EvaluateAsObject (context); + // FIXME: this "wrapper" is kind of hack, to prevent sequential property references such as $(X)$(Y). + return ret == null ? context.Evaluator.ReplacementForMissingPropertyAndItem : context.Evaluator.Wrapper + ret.ToString () + context.Evaluator.Wrapper; + } + + public override object EvaluateAsObject (EvaluationContext context) + { + try { + return DoEvaluateAsObject (context); + } catch (TargetInvocationException ex) { + throw new InvalidProjectFileException ("Access to property caused an error", ex); + } + } + + object DoEvaluateAsObject (EvaluationContext context) + { + if (Access.Target == null) { + return context.EvaluateProperty (Access.Name.Name); + } else { + if (this.Access.TargetType == PropertyTargetType.Object) { + var obj = Access.Target.EvaluateAsObject (context); + if (obj == null) + return null; + if (Access.Arguments != null) { + var args = Access.Arguments.Select (e => e.EvaluateAsObject (context)).ToArray (); + var method = FindMethod (obj.GetType (), Access.Name.Name, args); + if (method == null) + throw new InvalidProjectFileException (Location, string.Format ("access to undefined method '{0}' of '{1}' at {2}", Access.Name.Name, Access.Target.EvaluateAsString (context), Location)); + return method.Invoke (obj, AdjustArgsForCall (method, args)); + } else { + var prop = obj.GetType ().GetProperty (Access.Name.Name); + if (prop == null) + throw new InvalidProjectFileException (Location, string.Format ("access to undefined property '{0}' of '{1}' at {2}", Access.Name.Name, Access.Target.EvaluateAsString (context), Location)); + return prop.GetValue (obj, null); + } + } else { + var type = Type.GetType (Access.Target.EvaluateAsString (context)); + if (type == null) + throw new InvalidProjectFileException (Location, string.Format ("specified type '{0}' was not found", Access.Target.EvaluateAsString (context))); + if (Access.Arguments != null) { + var args = Access.Arguments.Select (e => e.EvaluateAsObject (context)).ToArray (); + var method = FindMethod (type, Access.Name.Name, args); + if (method == null) + throw new InvalidProjectFileException (Location, string.Format ("access to undefined static method '{0}' of '{1}' at {2}", Access.Name.Name, Access.Target.EvaluateAsString (context), Location)); + return method.Invoke (null, AdjustArgsForCall (method, args)); + } else { + var prop = type.GetProperty (Access.Name.Name); + if (prop == null) + throw new InvalidProjectFileException (Location, string.Format ("access to undefined static property '{0}' of '{1}' at {2}", Access.Name.Name, Access.Target.EvaluateAsString (context), Location)); + return prop.GetValue (null, null); + } + } + } + } + + MethodInfo FindMethod (Type type, string name, object [] args) + { + var methods = type.GetMethods ().Where (m => { + if (m.Name != name) + return false; + var pl = m.GetParameters (); + if (pl.Length == args.Length) + return true; + // calling String.Format() with either set of arguments is valid: + // - three strings (two for varargs) + // - two strings (happen to be exact match) + // - one string (no varargs) + if (pl.Length > 0 && pl.Length - 1 <= args.Length && + pl.Last ().GetCustomAttributesData ().Any (a => a.Constructor.DeclaringType == typeof (ParamArrayAttribute))) + return true; + return false; + }); + if (methods.Count () == 1) + return methods.First (); + return args.Any (a => a == null) ? + type.GetMethod (name) : + type.GetMethod (name, args.Select (o => o.GetType ()).ToArray ()); + } + + object [] AdjustArgsForCall (MethodInfo m, object[] args) + { + if (m.GetParameters ().Length == args.Length + 1) + return args.Concat (new object[] {Array.CreateInstance (m.GetParameters ().Last ().ParameterType.GetElementType (), 0)}).ToArray (); + else + return args; + } + } + + partial class ItemAccessExpression : Expression + { + public override bool EvaluateAsBoolean (EvaluationContext context) + { + return EvaluateStringAsBoolean (context, EvaluateAsString (context)); + } + + public override string EvaluateAsString (EvaluationContext context) + { + string itemType = Application.Name.Name; + var items = context.GetItems (itemType); + if (!items.Any ()) + return context.Evaluator.ReplacementForMissingPropertyAndItem; + if (Application.Expressions == null) + return string.Join (";", items.Select (item => context.EvaluateItem (itemType, item))); + else + return string.Join (";", items.Select (item => { + context.ContextItem = item; + var ret = string.Concat (Application.Expressions.Select (e => e.EvaluateAsString (context))); + context.ContextItem = null; + return ret; + })); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + return EvaluateAsString (context); + } + } + + partial class MetadataAccessExpression : Expression + { + public override bool EvaluateAsBoolean (EvaluationContext context) + { + return EvaluateStringAsBoolean (context, EvaluateAsString (context)); + } + + public override string EvaluateAsString (EvaluationContext context) + { + string itemType = this.Access.ItemType != null ? this.Access.ItemType.Name : null; + string metadataName = Access.Metadata.Name; + IEnumerable<object> items; + if (this.Access.ItemType != null) + items = context.GetItems (itemType); + else if (context.ContextItem != null) + items = new Object [] { context.ContextItem }; + else + items = context.GetAllItems (); + + var values = items.Select (i => (i is ProjectItem) ? ((ProjectItem) i).GetMetadataValue (metadataName) : ((ProjectItemInstance) i).GetMetadataValue (metadataName)).Where (s => !string.IsNullOrEmpty (s)); + return string.Join (";", values); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + return EvaluateAsString (context); + } + } + partial class StringLiteral : Expression + { + public override bool EvaluateAsBoolean (EvaluationContext context) + { + var ret = EvaluateAsString (context); + return EvaluateStringAsBoolean (context, ret); + } + + public override string EvaluateAsString (EvaluationContext context) + { + return context.Evaluator.Evaluate (this.Value.Name); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + return EvaluateAsString (context); + } + } + partial class RawStringLiteral : Expression + { + public override string EvaluateAsString (EvaluationContext context) + { + return Value.Name; + } + + public override bool EvaluateAsBoolean (EvaluationContext context) + { + throw new InvalidProjectFileException ("raw string literal cannot be evaluated as boolean"); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + return EvaluateAsString (context); + } + } + + partial class FunctionCallExpression : Expression + { + public override string EvaluateAsString (EvaluationContext context) + { + throw new NotImplementedException (); + } + + public override bool EvaluateAsBoolean (EvaluationContext context) + { + if (string.Equals (Name.Name, "Exists", StringComparison.OrdinalIgnoreCase)) { + if (Arguments.Count != 1) + throw new InvalidProjectFileException (Location, "Function 'Exists' expects 1 argument"); + string val = Arguments.First ().EvaluateAsString (context); + return Directory.Exists (val) || System.IO.File.Exists (val); + } + if (string.Equals (Name.Name, "HasTrailingSlash", StringComparison.OrdinalIgnoreCase)) { + if (Arguments.Count != 1) + throw new InvalidProjectFileException (Location, "Function 'HasTrailingSlash' expects 1 argument"); + string val = Arguments.First ().EvaluateAsString (context); + return val.LastOrDefault () == '\\' || val.LastOrDefault () == '/'; + } + throw new InvalidProjectFileException (Location, string.Format ("Unsupported function '{0}'", Name)); + } + + public override object EvaluateAsObject (EvaluationContext context) + { + throw new NotImplementedException (); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionParser.jay b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionParser.jay new file mode 100644 index 0000000000..200c96ba83 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionParser.jay @@ -0,0 +1,264 @@ +// +// ExpressionParser.jay +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +%{ + +using System; +using System.Text; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; +using Microsoft.Build.Framework; + +/* + +Pseudo formal syntax for .NET 4.0 expression: + +Condition = Expression +Include = Expression* + + Expression + BooleanLiteral + TrueLiteral + FalseLiteral + BinaryExpression + Expression "==" Expression + Expression "!=" Expression + Expression ">" Expression + Expression ">=" Expression + Expression "<" Expression + Expression "<=" Expression + Expression "And" Expression + Expression "Or" Expression + UnaryExpression + "!" Expression + PropertyExpression + "$(" PropertyApplication ")" + ItemExpression + "@(" ItemApplication ")" + MetadataBatchingExpression + "%(" MetadataBatchingApplication ")" + StringLiteralOrFunction + StringLiteralOrFunctionName ( "(" FunctionArguments ")" )? + +.NET error messages are so detailed which is something like "you forgot '(' after '$' ?" - so +it is likely that the MS tokenizer is hand-written. + +*/ + +namespace Microsoft.Build.Internal.Expressions +{ + class ExpressionParser + { + static readonly int yacc_verbose_flag = Environment.GetEnvironmentVariable ("MONO_MSBUILD_PARSER_DEBUG") == "1" ? 1 : 0; + + object debug_obj = yacc_verbose_flag == 0 ? null : new yydebug.yyDebugSimple (); + + public ExpressionList Parse (string source, ExpressionValidationType validationType) + { + var tokenizer = new ExpressionTokenizer (source, validationType); + return (ExpressionList) yyparse (tokenizer, debug_obj); + } + + BinaryExpression Binary (Operator op, object left, object right) + { + return new BinaryExpression () { Operator = op, Left = (Expression) left, Right = (Expression) right, Location = (ILocation) left }; + } +%} + +%token TRUE_LITERAL +%token FALSE_LITERAL +%token STRING_LITERAL +%token EQ // == +%token NE // != +%token GT // > +%token GE // >= +%token LT // < +%token LE // <= +%token AND // AND +%token OR // OR +%token NOT //! +%token DOT //. +%token COMMA //, +%token PROP_OPEN // $( +%token ITEM_OPEN // @( +%token METADATA_OPEN // %( +%token PAREN_OPEN // ( +%token PAREN_CLOSE // ) +%token BRACE_OPEN // [ +%token BRACE_CLOSE // ] +%token COLON2 // :: +%token ARROW // -> +%token NAME +%token ERROR + +%start ExpressionList + +%% + +ExpressionList + : /* empty */ + { $$ = new ExpressionList (); } + | ExpressionList Expression + { $$ = ((ExpressionList) $1).Add ((Expression) $2); } + ; + +Expression + : LogicalExpression + ; + +LogicalExpression + : ComparisonExpression + | LogicalExpression AND LogicalExpression + { $$ = Binary (Operator.And, $1, $3); } + | LogicalExpression OR LogicalExpression + { $$ = Binary (Operator.Or, $1, $3); } + ; + +ComparisonExpression + : UnaryExpression + | UnaryExpression EQ UnaryExpression + { $$ = Binary (Operator.EQ, $1, $3); } + | UnaryExpression NE UnaryExpression + { $$ = Binary (Operator.NE, $1, $3); } + | UnaryExpression GT UnaryExpression + { $$ = Binary (Operator.GT, $1, $3); } + | UnaryExpression GE UnaryExpression + { $$ = Binary (Operator.GE, $1, $3); } + | UnaryExpression LT UnaryExpression + { $$ = Binary (Operator.LT, $1, $3); } + | UnaryExpression LE UnaryExpression + { $$ = Binary (Operator.LE, $1, $3); } + ; + +UnaryExpression + : PrimaryExpression + | NOT UnaryExpression + { $$ = new NotExpression () { Negated = (Expression) $2, Location = (ILocation) $1 }; } + ; + +PrimaryExpression + : BooleanLiteral + | StringLiteral + | UnaryExpression + | PropertyAccessExpression + | ItemAccessExpression + | MetadataAccessExpression + | RawStringLiteralOrFunction + | ParenthesizedExpression + ; + +BooleanLiteral + : TRUE_LITERAL + { $$ = new BooleanLiteral () { Value = true, Location = (ILocation) $1 }; } + | FALSE_LITERAL + { $$ = new BooleanLiteral () { Value = false, Location = (ILocation) $1 }; } + ; + +PropertyAccessExpression + : PROP_OPEN PropertyAccess PAREN_CLOSE + { $$ = new PropertyAccessExpression () { Access = (PropertyAccess) $2, Location = (ILocation) $1 }; } + ; + +PropertyAccess + : NAME + { $$ = new PropertyAccess () { Name = (NameToken) $1, TargetType = PropertyTargetType.Object, Location = (NameToken) $1 }; } + | Expression DOT NAME + { $$ = new PropertyAccess () { Name = (NameToken) $3, Target = (Expression) $1, TargetType = PropertyTargetType.Object, Location = (ILocation) $1 }; } + | BRACE_OPEN QualifiedNameExpression BRACE_CLOSE COLON2 NAME + { $$ = new PropertyAccess () { Name = (NameToken) $5, Target = (Expression) $2, TargetType = PropertyTargetType.Type, Location = (ILocation) $1 }; } + | BRACE_OPEN QualifiedNameExpression BRACE_CLOSE COLON2 NAME PAREN_OPEN FunctionCallArguments PAREN_CLOSE + { $$ = new PropertyAccess () { Name = (NameToken) $5, Target = (Expression) $2, TargetType = PropertyTargetType.Type, Arguments = (ExpressionList) $7, Location = (ILocation) $1 }; } + ; + +QualifiedNameExpression + : QualifiedName + { $$ = new StringLiteral () { Value = (NameToken) $1, Location = (ILocation) $1 }; } + ; + +QualifiedName + : NAME + | QualifiedName DOT NAME + { $$ = new NameToken () { Name = ((NameToken) $1).Name + "." + ((NameToken) $3).Name, Column = ((ILocation) $1).Column }; } + ; + +ItemAccessExpression + : ITEM_OPEN ItemApplication PAREN_CLOSE + { $$ = new ItemAccessExpression () { Application = (ItemApplication) $2, Location = (ILocation) $1 }; } + ; + +// looking a bit messy, but gives different location +ItemApplication + : NAME + { $$ = new ItemApplication () { Name = (NameToken) $1, Location = (ILocation) $1 }; } + | NAME ARROW ExpressionList + { $$ = new ItemApplication () { Name = (NameToken) $1, Expressions = (ExpressionList) $3, Location = (ILocation) $1 }; } + ; + +MetadataAccessExpression + : METADATA_OPEN MetadataAccess PAREN_CLOSE + { $$ = new MetadataAccessExpression () { Access = (MetadataAccess) $2, Location = (ILocation) $1 }; } + ; + +// looking a bit messy, but gives different location +MetadataAccess + : NAME + { $$ = new MetadataAccess () { Metadata = (NameToken) $1, Location = (ILocation) $1 }; } + | NAME DOT NAME + { $$ = new MetadataAccess () { ItemType = (NameToken) $1, Metadata = (NameToken) $3, Location = (ILocation) $1 }; } + ; + +StringLiteral + : STRING_LITERAL + { $$ = new StringLiteral () { Value = (NameToken) $1, Location = (ILocation) $1 }; } + ; + +RawStringLiteralOrFunction + : NAME + { $$ = new RawStringLiteral () { Value = (NameToken) $1, Location = (ILocation) $1 }; } + | NAME PAREN_OPEN PAREN_CLOSE + { $$ = new FunctionCallExpression () { Name = (NameToken) $1, Arguments = new ExpressionList (), Location = (ILocation) $1 }; } + | NAME PAREN_OPEN FunctionCallArguments PAREN_CLOSE + { $$ = new FunctionCallExpression () { Name = (NameToken) $1, Arguments = (ExpressionList) $3, Location = (ILocation) $1 }; } + ; + +FunctionCallArguments + : /* empty */ + { $$ = new ExpressionList (); } + | Expression + { $$ = new ExpressionList ().Add ((Expression) $1); } + | FunctionCallArguments COMMA Expression + { $$ = ((ExpressionList) $1).Add ((Expression) $3); } + ; + +ParenthesizedExpression + : PAREN_OPEN Expression PAREN_CLOSE + { $$ = (Expression) $2; } + ; + +%% + + } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionParserManual.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionParserManual.cs new file mode 100644 index 0000000000..f177505587 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionParserManual.cs @@ -0,0 +1,271 @@ +// +// ExpressionParserManual.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Exceptions; + +namespace Microsoft.Build.Internal.Expressions +{ + class ExpressionParserManual + { + // FIXME: we are going to not need ExpressionValidationType for this; always LaxString. + public ExpressionParserManual (string source, ExpressionValidationType validationType) + { + if (source == null) + throw new ArgumentNullException ("source"); + this.source = source; + validation_type = validationType; + } + + string source; + ExpressionValidationType validation_type; + + public ExpressionList Parse () + { + return Parse (0, source.Length); + } + + ExpressionList Parse (int start, int end) + { + if (string.IsNullOrWhiteSpace (source)) + return new ExpressionList (); + + var ret = new ExpressionList (); + while (start < end) { + int bak = start; + ret.Add (ParseSingle (ref start, end)); + SkipSpaces (ref start); + if (bak == start) + throw new Exception ("Parser failed to progress token position: " + source); + } + return ret; + } + + static readonly char [] token_starters = "$@%(),".ToCharArray (); + + Expression ParseSingle (ref int start, int end) + { + char token = source [start]; + switch (token) { + case '$': + case '@': + case '%': + if (start == end || start + 1 == source.Length || source [start + 1] != '(') { + if (validation_type == ExpressionValidationType.StrictBoolean) + throw new InvalidProjectFileException (string.Format ("missing '(' after '{0}' at {1} in \"{2}\"", source [start], start, source)); + else + goto default; // treat as raw literal to the section end + } + start += 2; + int last = FindMatchingCloseParen (start, end); + if (last < 0) { + if (validation_type == ExpressionValidationType.StrictBoolean) + throw new InvalidProjectFileException (string.Format ("expression did not have matching ')' since index {0} in \"{1}\"", start, source)); + else { + start -= 2; + goto default; // treat as raw literal to the section end + } + } + Expression ret; + if (token == '$') + ret = EvaluatePropertyExpression (start, last); + else if (token == '%') + ret = EvaluateMetadataExpression (start, last); + else + ret = EvaluateItemExpression (start, last); + start = last + 1; + return ret; + + // Below (until default) are important only for Condition evaluation + case '(': + if (validation_type == ExpressionValidationType.LaxString) + goto default; + start++; + last = FindMatchingCloseParen (start, end); + if (last < 0) { + if (validation_type == ExpressionValidationType.StrictBoolean) + throw new InvalidProjectFileException (string.Format ("expression did not have matching ')' since index {0} in \"{1}\"", start, source)); + else { + start--; + goto default; // treat as raw literal to the section end + } + } + var contents = Parse (start, last).ToArray (); + if (contents.Length > 1) + throw new InvalidProjectFileException (string.Format ("unexpected continuous expression within (){0} in \"{1}\"", contents [1].Column > 0 ? " at " + contents [1].Column : null, source)); + return contents.First (); + + default: + int idx = source.IndexOfAny (token_starters, start + 1); + string name = idx < 0 ? source.Substring (start, end - start) : source.Substring (start, idx - start); + var val = new NameToken () { Name = name }; + ret = new RawStringLiteral () { Value = val }; + if (idx >= 0) + start = idx; + else + start = end; + + return ret; + } + } + + int FindMatchingCloseParen (int start, int end) + { + int n = 0; + for (int i = start; i < end; i++) { + if (source [i] == '(') + n++; + else if (source [i] == ')') { + if (n-- == 0) + return i; + } + } + return -1; // invalid + } + + static readonly string spaces = " \t\r\n"; + + void SkipSpaces (ref int start) + { + while (start < source.Length && spaces.Contains (source [start])) + start++; + } + + PropertyAccessExpression EvaluatePropertyExpression (int start, int end) + { + // member access + int dotAt = source.LastIndexOf ('.', end, end - start); + int colonsAt = source.LastIndexOf ("::", end, end - start, StringComparison.Ordinal); + if (dotAt < 0 && colonsAt < 0) { + // property access without member specification + int parenAt = source.IndexOf ('(', start, end - start); + string name = parenAt < 0 ? source.Substring (start, end - start) : source.Substring (start, parenAt - start); + var access = new PropertyAccess () { + Name = new NameToken () { Name = name }, + TargetType = PropertyTargetType.Object + }; + if (parenAt > 0) { // method arguments + start = parenAt + 1; + access.Arguments = ParseFunctionArguments (ref start, end); + } + return new PropertyAccessExpression () { Access = access }; + } + if (colonsAt < 0 || colonsAt < dotAt) { + // property access with member specification + int mstart = dotAt + 1; + int parenAt = source.IndexOf ('(', mstart, end - mstart); + string name = parenAt < 0 ? source.Substring (mstart, end - mstart) : source.Substring (mstart, parenAt - mstart); + var access = new PropertyAccess () { + Name = new NameToken () { Name = name }, + TargetType = PropertyTargetType.Object, + Target = dotAt < 0 ? null : Parse (start, dotAt).FirstOrDefault () + }; + if (parenAt > 0) { // method arguments + start = parenAt + 1; + access.Arguments = ParseFunctionArguments (ref start, end); + } + return new PropertyAccessExpression () { Access = access }; + } else { + // static type access + string type = source.Substring (start, colonsAt - start); + if (type.Length < 2 || type [0] != '[' || type [type.Length - 1] != ']') + throw new InvalidProjectFileException (string.Format ("Static function call misses appropriate type name surrounded by '[' and ']' at {0} in \"{1}\"", start, source)); + type = type.Substring (1, type.Length - 2); + start = colonsAt + 2; + int parenAt = source.IndexOf ('(', start, end - start); + string member = parenAt < 0 ? source.Substring (start, end - start) : source.Substring (start, parenAt - start); + if (member.Length == 0) + throw new InvalidProjectFileException ("Static member name is missing"); + var access = new PropertyAccess () { + Name = new NameToken () { Name = member }, + TargetType = PropertyTargetType.Type, + Target = new StringLiteral () { Value = new NameToken () { Name = type } } + }; + if (parenAt > 0) { // method arguments + start = parenAt + 1; + access.Arguments = ParseFunctionArguments (ref start, end); + } + return new PropertyAccessExpression () { Access = access }; + } + } + + ExpressionList ParseFunctionArguments (ref int start, int end) + { + var args = new ExpressionList (); + do { + SkipSpaces (ref start); + if (start == source.Length) + throw new InvalidProjectFileException ("unterminated function call arguments."); + if (source [start] == ')') + break; + else if (args.Any ()) { + if (source [start] != ',') + throw new InvalidProjectFileException (string.Format ("invalid function call arguments specification. ',' is expected, got '{0}'", source [start])); + start++; + } + args.Add (ParseSingle (ref start, end)); + } while (true); + start++; + return args; + } + + ItemAccessExpression EvaluateItemExpression (int start, int end) + { + // using property as context and evaluate + int idx = source.IndexOf ("->", start, StringComparison.Ordinal); + if (idx > 0) { + string name = source.Substring (start, idx - start); + return new ItemAccessExpression () { + Application = new ItemApplication () { + Name = new NameToken () { Name = name }, + Expressions = Parse (idx, end - idx) + } + }; + } else { + string name = source.Substring (start, end - start); + return new ItemAccessExpression () { + Application = new ItemApplication () { Name = new NameToken () { Name = name } } + }; + } + } + + MetadataAccessExpression EvaluateMetadataExpression (int start, int end) + { + int idx = source.IndexOf ('.', start, end - start); + string item = idx < 0 ? null : source.Substring (start, idx); + string meta = idx < 0 ? source.Substring (start, end - start) : source.Substring (idx + 1, end - idx - 1); + var access = new MetadataAccess () { + ItemType = item == null ? null : new NameToken () { Column = start, Name = item }, + Metadata = new NameToken () { Column = idx < 0 ? start : idx + 1, Name = meta } + }; + return new MetadataAccessExpression () { Access = access }; + } + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionTokenizer.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionTokenizer.cs new file mode 100644 index 0000000000..9760ad2acb --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ExpressionTokenizer.cs @@ -0,0 +1,309 @@ +// +// ExpressionTokenizer.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Collections.Generic; +using Microsoft.Build.Evaluation; + +namespace Microsoft.Build.Internal.Expressions +{ + enum ExpressionValidationType + { + LaxString, + StrictBoolean, + } + + enum TokenizerMode + { + Default, + InsideItemOrProperty, + } + + class ExpressionTokenizer : yyParser.yyInput + { + public ExpressionTokenizer (string source, ExpressionValidationType validationType) + { + this.source = source; + current_token_position = -1; + validation_type = validationType; + modes.Push (TokenizerMode.Default); + } + + string source; + ExpressionValidationType validation_type; + + int current_token; + string error; + int pos, current_token_position; + object token_value; + Stack<TokenizerMode> modes = new Stack<TokenizerMode> (); + + TokenizerMode CurrentTokenizerMode { + get { return modes.Peek (); } + } + + public bool advance () + { + if (pos == source.Length) + return false; + + error = null; + token_value = null; + + while (pos < source.Length) { + if (spaces.IndexOf (source [pos]) >= 0) + pos++; + else + break; + } + if (pos == source.Length) + return false; + current_token_position = pos; + + switch (source [pos++]) { + case '.': + TokenForItemPropertyValue (".", Token.DOT); + break; + case ',': + TokenForItemPropertyValue (",", Token.COMMA); + break; + case '[': + TokenForItemPropertyValue ("[", Token.BRACE_OPEN); + break; + case ']': + TokenForItemPropertyValue ("]", Token.BRACE_CLOSE); + break; + case '(': + modes.Push (TokenizerMode.Default); + TokenForItemPropertyValue ("(", Token.PAREN_OPEN); + break; + case ')': + if (modes.Count > 0) { + modes.Pop (); + current_token = Token.PAREN_CLOSE; + } else { + token_value = ")"; + current_token = Token.NAME; + } + break; + case '-': + if (pos < source.Length && source [pos] == '>') { + current_token = Token.ARROW; + pos++; + } else + ErrorOnStrictBoolean ("-", "'-' is not followed by '>'."); + break; + case '=': + if (pos < source.Length && source [pos] == '=') { + current_token = Token.EQ; + pos++; + } else + ErrorOnStrictBoolean ("=", "'=' is not followed by '='."); + break; + case ':': + if (pos < source.Length && source [pos] == ':') { + current_token = Token.COLON2; + } else + ErrorOnStrictBoolean (":", "':' is not followed by ':'."); + pos++; + break; + case '!': + if (pos < source.Length && source [pos] == '=') { + pos++; + current_token = Token.NE; + } else + TokenForItemPropertyValue ("!", Token.NOT); + break; + case '>': + if (pos < source.Length && source [pos] == '=') { + pos++; + current_token = Token.GE; + } else + current_token = Token.GT; + break; + case '<': + if (pos < source.Length && source [pos] == '=') { + pos++; + current_token = Token.LE; + } else + current_token = Token.LT; + break; + case '$': + if (pos < source.Length && source [pos] == '(') { + modes.Push (TokenizerMode.InsideItemOrProperty); + current_token = Token.PROP_OPEN; + pos++; + } else + ErrorOnStrictBoolean ("$", "property reference '$' is not followed by '('."); + break; + case '@': + if (pos < source.Length && source [pos] == '(') { + modes.Push (TokenizerMode.InsideItemOrProperty); + current_token = Token.ITEM_OPEN; + pos++; + } else + ErrorOnStrictBoolean ("@", "item reference '@' is not followed by '('."); + break; + case '%': + if (pos < source.Length && source [pos] == '(') { + modes.Push (TokenizerMode.InsideItemOrProperty); + current_token = Token.METADATA_OPEN; + pos++; + } else + ErrorOnStrictBoolean ("%", "metadata reference '%' is not followed by '('."); + break; + case '"': + case '\'': + pos = source.IndexOf (source [pos - 1], pos); + if (pos < 0) { + ErrorOnStrictBoolean ("'", "unterminated string literal"); + pos = source.Length; + } + token_value = source.Substring (current_token_position + 1, pos - current_token_position - 1); + current_token = Token.STRING_LITERAL; + pos++; + break; + default: + pos = source.IndexOfAny (token_starter_chars, pos); + if (pos < 0) + pos = source.Length; + var val = source.Substring (current_token_position, pos - current_token_position); + if (val.Equals ("AND", StringComparison.OrdinalIgnoreCase)) + current_token = Token.AND; + else if (val.Equals ("OR", StringComparison.OrdinalIgnoreCase)) + current_token = Token.OR; + else if (val.Equals ("TRUE", StringComparison.OrdinalIgnoreCase)) + current_token = Token.TRUE_LITERAL; + else if (val.Equals ("FALSE", StringComparison.OrdinalIgnoreCase)) + current_token = Token.FALSE_LITERAL; + else if (val.Equals ("YES", StringComparison.OrdinalIgnoreCase)) + current_token = Token.TRUE_LITERAL; + else if (val.Equals ("NO", StringComparison.OrdinalIgnoreCase)) + current_token = Token.FALSE_LITERAL; + else if (val.Equals ("ON", StringComparison.OrdinalIgnoreCase)) + current_token = Token.TRUE_LITERAL; + else if (val.Equals ("OFF", StringComparison.OrdinalIgnoreCase)) + current_token = Token.FALSE_LITERAL; + else { + current_token = Token.NAME; + token_value = ProjectCollection.Unescape (val); + break; + } + break; + } + return true; + } + string spaces = " \t\r\n"; + + static readonly char [] token_starter_chars = ".,[]()-=:!><$@%\"' ".ToCharArray (); + + void ReadStringLiteral (string source, char c) + { + while (pos < source.Length && source [pos] != c) + pos++; + if (source [pos - 1] != c) + ErrorOnStrictBoolean (c.ToString (), string.Format ("missing string literal terminator [{0}]", c)); + else { + current_token = Token.NAME; + token_value = source.Substring (current_token_position + 1, pos - current_token_position - 2); + token_value = ProjectCollection.Unescape ((string) token_value); + } + } + + void TokenForItemPropertyValue (string value, int token) + { + if (true)//CurrentTokenizerMode == TokenizerMode.InsideItemOrProperty) + current_token = token; + else { + current_token = Token.NAME; + token_value = value; + } + } + + void ErrorOnStrictBoolean (string value, string message) + { + if (validation_type == ExpressionValidationType.StrictBoolean) { + current_token = Token.ERROR; + error = message; + } else { + current_token = Token.NAME; + token_value = value; + } + } + + public int token () + { + return current_token; + } + + public object value () + { + if (current_token == Token.NAME || current_token == Token.STRING_LITERAL) + return new NameToken () { Name = (string) token_value, Column = current_token_position }; + else if (error != null) + return new ErrorToken () { Message = error, Column = current_token_position }; + else + return new Location () { Column = current_token_position }; + } + } + + class NameToken : Location + { + public string Name { get; set; } + + public override string ToString () + { + return string.Format ("[NameToken: Value={0}]", Name); + } + } + + class ErrorToken : Location + { + public string Message { get; set; } + } + + interface ILocation + { + //int Line { get; } + int Column { get; } + string File { get; } + + string ToLocationString (); + } + + class Location : ILocation + { + //public int Line { get; set; } + public int Column { get; set; } + public string File { get; set; } + + public string ToLocationString () + { + return "at " + Column; + } + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ProjectTaskItem.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ProjectTaskItem.cs new file mode 100644 index 0000000000..98d4bb2a58 --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/ProjectTaskItem.cs @@ -0,0 +1,92 @@ +// +// ProjectTaskItem.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using System.IO; + +namespace Microsoft.Build.Internal +{ + class ProjectTaskItem : ITaskItem + { + ProjectItemElement item; + string evaluated_include_part; + + public ProjectTaskItem (ProjectItemElement item, string evaluatedIncludePart) + { + this.item = item; + this.evaluated_include_part = WindowsCompatibilityExtensions.NormalizeFilePath (evaluatedIncludePart); + } + #region ITaskItem implementation + System.Collections.IDictionary ITaskItem.CloneCustomMetadata () + { + var ret = new System.Collections.Hashtable (); + foreach (var p in item.Metadata) + ret [p.Name] = p; + return ret; + } + void ITaskItem.CopyMetadataTo (ITaskItem destinationItem) + { + throw new NotImplementedException (); + } + string ITaskItem.GetMetadata (string metadataName) + { + var wk = ProjectCollection.GetWellKnownMetadata (metadataName, evaluated_include_part, Path.GetFullPath, null); + if (wk != null) + return wk; + var mde = item.Metadata.FirstOrDefault (m => m.Name == metadataName); + return mde != null ? mde.Value : null; + } + void ITaskItem.RemoveMetadata (string metadataName) + { + throw new NotImplementedException (); + } + void ITaskItem.SetMetadata (string metadataName, string metadataValue) + { + throw new NotImplementedException (); + } + string ITaskItem.ItemSpec { + get { return evaluated_include_part; } + set { throw new NotImplementedException (); } + } + int ITaskItem.MetadataCount { + get { + throw new NotImplementedException (); + } + } + System.Collections.ICollection ITaskItem.MetadataNames { + get { + throw new NotImplementedException (); + } + } + #endregion + } +} + diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/FileLogger.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/WindowsCompatibilityExtensions.cs index 331d29ab9b..38f9d6b29e 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/FileLogger.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/WindowsCompatibilityExtensions.cs @@ -1,9 +1,10 @@ -// FileLogger.cs +// +// WindowsCompatibilityExtensions.cs // // Author: -// Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// (C) 2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -24,13 +25,17 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // - using System; +using System.IO; -namespace Microsoft.Build.Logging +namespace Microsoft.Build.Internal { - public class FileLogger - { - } + static class WindowsCompatibilityExtensions + { + public static string NormalizeFilePath (string path) + { + return path.Replace ('\\', Path.DirectorySeparatorChar); + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ConfigurableForwardingLogger.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ConfigurableForwardingLogger.cs new file mode 100644 index 0000000000..077a1bb4ef --- /dev/null +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ConfigurableForwardingLogger.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.Build.Framework; + +namespace Microsoft.Build.Logging +{ + public class ConfigurableForwardingLogger : IForwardingLogger + { + #region INodeLogger implementation + + public void Initialize (IEventSource eventSource, int nodeCount) + { + Initialize (eventSource); + } + + #endregion + + #region ILogger implementation + + public void Initialize (IEventSource eventSource) + { + throw new NotImplementedException (); + } + + public void Shutdown () + { + throw new NotImplementedException (); + } + + public string Parameters { get; set; } + + public LoggerVerbosity Verbosity { get; set; } + + #endregion + + #region IForwardingLogger implementation + + public IEventRedirector BuildEventRedirector { get; set; } + + public int NodeId { get; set; } + + #endregion + } +} diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ConsoleLogger.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ConsoleLogger.cs deleted file mode 100644 index 161476c2c0..0000000000 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/ConsoleLogger.cs +++ /dev/null @@ -1,89 +0,0 @@ -// ConsoleLogger.cs -// -// Author: -// Rolf Bjarne Kvinge (rolf@xamarin.com) -// -// Copyright (C) 2011 Xamarin Inc. -// -// 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. -// - -using Microsoft.Build.Framework; - -using System; - -namespace Microsoft.Build.Logging -{ - public class ConsoleLogger : INodeLogger - { - public ConsoleLogger () - : this (LoggerVerbosity.Normal) - { - } - - public ConsoleLogger (LoggerVerbosity verbosity) - { - throw new NotImplementedException (); - } - - public ConsoleLogger (LoggerVerbosity verbosity, WriteHandler write, ColorSetter colorSet, ColorResetter colorReset) - { - throw new NotImplementedException (); - } - - #region INodeLogger implementation - public void Initialize (IEventSource eventSource, int nodeCount) - { - throw new NotImplementedException (); - } - #endregion - - #region ILogger implementation - public void Initialize (IEventSource eventSource) - { - throw new NotImplementedException (); - } - - public void Shutdown () - { - throw new NotImplementedException (); - } - - public string Parameters { - get { - throw new NotImplementedException (); - } - set { - throw new NotImplementedException (); - } - } - - public LoggerVerbosity Verbosity { - get { - throw new NotImplementedException (); - } - set { - throw new NotImplementedException (); - } - } - #endregion - } -} - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/LoggerDescription.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Logging/LoggerDescription.cs index 5115402c67..4e7b72f1a7 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Logging/LoggerDescription.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Logging/LoggerDescription.cs @@ -26,18 +26,39 @@ // using System; +using System.Reflection; using Microsoft.Build.Framework; namespace Microsoft.Build.Logging { - public class LoggerDescription - { - public LoggerDescription (string loggerClassName, string loggerAssemblyName, - string loggerAssemblyFile, string loggerSwitchParameters, - LoggerVerbosity verbosity) - { - throw new NotImplementedException (); - } - } + public class LoggerDescription + { + public LoggerDescription (string loggerClassName, string loggerAssemblyName, + string loggerAssemblyFile, string loggerSwitchParameters, + LoggerVerbosity verbosity) + { + if (loggerAssemblyName != null && loggerAssemblyFile != null) + throw new InvalidOperationException ("Cannot specify both loggerAssemblyName and loggerAssemblyFile at the same time."); + if (loggerAssemblyName == null && loggerAssemblyFile == null) + throw new InvalidOperationException ("Either loggerAssemblyName or loggerAssemblyFile must be specified"); + class_name = loggerClassName; + assembly_name = loggerAssemblyName; + assembly_file = loggerAssemblyFile; + LoggerSwitchParameters = loggerSwitchParameters; + Verbosity = verbosity; + } + + string class_name, assembly_name, assembly_file; + + public string LoggerSwitchParameters { get; private set; } + public LoggerVerbosity Verbosity { get; private set; } + + public ILogger CreateLogger () + { + var assembly = assembly_name != null ? AppDomain.CurrentDomain.Load (assembly_name) : Assembly.LoadFile (assembly_file); + var type = assembly.GetType (class_name); + return (ILogger) Activator.CreateInstance (type, Verbosity); + } + } } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.dll.sources b/mcs/class/Microsoft.Build/Microsoft.Build.dll.sources index 37c1f480c1..6cbed8f392 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.dll.sources +++ b/mcs/class/Microsoft.Build/Microsoft.Build.dll.sources @@ -1,6 +1,19 @@ Assembly/AssemblyInfo.cs ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs +../../tools/xbuild/XBuildConsts.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/EventSource.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorSetter.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ColorResetter.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/FileLogger.cs +../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/WriteHandler.cs +../Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs +../Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs +../Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs +../Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs +../Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs Microsoft.Build.Construction/ElementLocation.cs Microsoft.Build.Construction/ProjectChooseElement.cs Microsoft.Build.Construction/ProjectCommentElement.cs @@ -28,16 +41,24 @@ Microsoft.Build.Construction/ProjectUsingTaskParameterElement.cs Microsoft.Build.Construction/ProjectWhenElement.cs Microsoft.Build.Construction/UsingTaskParameterGroupElement.cs Microsoft.Build.Evaluation/Project.cs +Microsoft.Build.Evaluation/ProjectChangedEventArgs.cs Microsoft.Build.Evaluation/ProjectCollection.cs +Microsoft.Build.Evaluation/ProjectCollectionChangedEventArgs.cs +Microsoft.Build.Evaluation/ProjectCollectionChangedState.cs Microsoft.Build.Evaluation/ProjectItem.cs Microsoft.Build.Evaluation/ProjectItemDefinition.cs Microsoft.Build.Evaluation/ProjectLoadSettings.cs Microsoft.Build.Evaluation/ProjectMetadata.cs Microsoft.Build.Evaluation/ProjectProperty.cs +Microsoft.Build.Evaluation/ProjectXmlChangedEventArgs.cs Microsoft.Build.Evaluation/ResolvedImport.cs +Microsoft.Build.Evaluation/SubToolset.cs Microsoft.Build.Evaluation/Toolset.cs Microsoft.Build.Evaluation/ToolsetDefinitionLocations.cs +Microsoft.Build.Exceptions/BuildAbortedException.cs +Microsoft.Build.Exceptions/InternalLoggerException.cs Microsoft.Build.Exceptions/InvalidProjectFileException.cs +Microsoft.Build.Exceptions/InvalidToolsetDefinitionException.cs Microsoft.Build.Execution/BuildManager.cs Microsoft.Build.Execution/BuildParameters.cs Microsoft.Build.Execution/BuildRequestData.cs @@ -45,24 +66,44 @@ Microsoft.Build.Execution/BuildRequestDataFlags.cs Microsoft.Build.Execution/BuildResult.cs Microsoft.Build.Execution/BuildResultCode.cs Microsoft.Build.Execution/BuildSubmission.cs +Microsoft.Build.Execution/BuildSubmissionCompleteCallback.cs Microsoft.Build.Execution/HostServices.cs Microsoft.Build.Execution/ITargetResult.cs Microsoft.Build.Execution/NodeAffinity.cs +Microsoft.Build.Execution/NodeEngineShutdownReason.cs +Microsoft.Build.Execution/OutOfProcNode.cs Microsoft.Build.Execution/ProjectInstance.cs Microsoft.Build.Execution/ProjectItemDefinitionInstance.cs +Microsoft.Build.Execution/ProjectItemGroupTaskInstance.cs +Microsoft.Build.Execution/ProjectItemGroupTaskItemInstance.cs +Microsoft.Build.Execution/ProjectItemGroupTaskMetadataInstance.cs Microsoft.Build.Execution/ProjectItemInstance.cs Microsoft.Build.Execution/ProjectMetadataInstance.cs +Microsoft.Build.Execution/ProjectOnErrorInstance.cs +Microsoft.Build.Execution/ProjectPropertyGroupTaskInstance.cs +Microsoft.Build.Execution/ProjectPropertyGroupTaskPropertyInstance.cs Microsoft.Build.Execution/ProjectPropertyInstance.cs Microsoft.Build.Execution/ProjectTargetInstance.cs +Microsoft.Build.Execution/ProjectTaskInstance.cs +Microsoft.Build.Execution/ProjectTaskInstanceChild.cs +Microsoft.Build.Execution/ProjectTaskOutputItemInstance.cs +Microsoft.Build.Execution/ProjectTaskOutputPropertyInstance.cs +Microsoft.Build.Execution/ProjectTargetInstanceChild.cs Microsoft.Build.Execution/TargetResult.cs Microsoft.Build.Execution/TargetResultCode.cs +Microsoft.Build.Internal/BuildEngine4.cs +Microsoft.Build.Internal/BuildNodeManager.cs +Microsoft.Build.Internal/BuildTaskDatabase.cs +Microsoft.Build.Internal/BuildTaskFactory.cs Microsoft.Build.Internal/CollectionFromEnumerable.cs +Microsoft.Build.Internal/ExpressionConstructs.cs +Microsoft.Build.Internal/ExpressionEvaluator.cs +Microsoft.Build.Internal/ExpressionParserManual.cs +Microsoft.Build.Internal/ExpressionTokenizer.cs Microsoft.Build.Internal/FilteredEnumerable.cs +Microsoft.Build.Internal/ProjectTaskItem.cs Microsoft.Build.Internal/ReverseEnumerable.cs -Microsoft.Build.Logging/ColorResetter.cs -Microsoft.Build.Logging/ColorSetter.cs -Microsoft.Build.Logging/ConsoleLogger.cs -Microsoft.Build.Logging/FileLogger.cs +Microsoft.Build.Internal/WindowsCompatibilityExtensions.cs +Microsoft.Build.Logging/ConfigurableForwardingLogger.cs Microsoft.Build.Logging/ForwardingLoggerRecord.cs Microsoft.Build.Logging/LoggerDescription.cs -Microsoft.Build.Logging/WriteHandler.cs diff --git a/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources b/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources index 0258038dcc..86971873d0 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources +++ b/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources @@ -1,2 +1,21 @@ FunctionalTest.cs +Microsoft.Build.Construction/ProjectItemElementTest.cs +Microsoft.Build.Construction/ProjectRootElementTest.cs +Microsoft.Build.Evaluation/ProjectCollectionTest.cs +Microsoft.Build.Evaluation/ProjectItemDefinitionTest.cs +Microsoft.Build.Evaluation/ProjectItemTest.cs +Microsoft.Build.Evaluation/ProjectTest.cs +Microsoft.Build.Evaluation/ProjectPropertyTest.cs +Microsoft.Build.Evaluation/ResolvedImportTest.cs +Microsoft.Build.Evaluation/ToolsetTest.cs +Microsoft.Build.Execution/BuildParametersTest.cs +Microsoft.Build.Execution/BuildManagerTest.cs +Microsoft.Build.Execution/BuildSubmissionTest.cs +Microsoft.Build.Execution/ProjectInstanceTest.cs +Microsoft.Build.Execution/ProjectMetadataInstanceTest.cs +Microsoft.Build.Execution/ProjectTargetInstanceTest.cs Microsoft.Build.Internal/CollectionFromEnumerableTest.cs +Microsoft.Build.Internal/ExpressionParserTest.cs +Microsoft.Build.Logging/ConsoleLoggerTest.cs +Microsoft.Build.Logging/LoggerDescriptionTest.cs + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs new file mode 100644 index 0000000000..caa93f1b76 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs @@ -0,0 +1,42 @@ +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using NUnit.Framework; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; + +namespace MonoTests.Microsoft.Build.Construction +{ + [TestFixture] + public class ProjectItemElementTest + { + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void EmptyInclude () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void MissingInclude () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectRootElementTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectRootElementTest.cs new file mode 100644 index 0000000000..e864f4dfb3 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectRootElementTest.cs @@ -0,0 +1,222 @@ +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using NUnit.Framework; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; + +namespace MonoTests.Microsoft.Build.Construction +{ + [TestFixture] + public class ProjectRootElementTest + { + const string empty_project_xml = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + + [Test] + [ExpectedException (typeof (UriFormatException))] + [Category ("NotWorking")] // URL is constructed for ElementLocation, which we don't support yet. + public void CreateExpectsAbsoluteUri () + { + var xml = XmlReader.Create (new StringReader (empty_project_xml), null, "foo.xml"); + ProjectRootElement.Create (xml); + } + + [Test] + public void CreateAndPaths () + { + Assert.IsNull (ProjectRootElement.Create ().FullPath, "#1"); + var xml = XmlReader.Create (new StringReader (empty_project_xml), null, "file:///foo.xml"); + // This creator does not fill FullPath... + var root = ProjectRootElement.Create (xml); + Assert.IsNull (root.FullPath, "#2"); + Assert.AreEqual (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), root.DirectoryPath, "#3"); + } + + [Test] + public void FullPathSetter () + { + var root = ProjectRootElement.Create (); + root.FullPath = "test" + Path.DirectorySeparatorChar + "foo.xml"; + var full = Path.Combine (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), "test", "foo.xml"); + Assert.AreEqual (full, root.FullPath, "#1"); + Assert.AreEqual (Path.GetDirectoryName (full), root.DirectoryPath, "#1"); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void FullPathSetNull () + { + ProjectRootElement.Create ().FullPath = null; + } + + [Test] + public void InvalidProject () + { + try { + ProjectRootElement.Create (XmlReader.Create (new StringReader (" <root/>"))); + Assert.Fail ("should throw InvalidProjectFileException"); + } catch (InvalidProjectFileException ex) { + #if NET_4_5 + Assert.AreEqual (1, ex.LineNumber, "#1"); + // it is very interesting, but unlike XmlReader.LinePosition it returns the position for '<'. + Assert.AreEqual (2, ex.ColumnNumber, "#2"); + #endif + } + } + + [Test] + public void CreateWithXmlLoads () + { + string project_xml_1 = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'><ItemGroup><None Include='bar.txt' /></ItemGroup></Project>"; + var xml = XmlReader.Create (new StringReader (project_xml_1), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual (1, root.Items.Count, "#1"); + } + + [Test] + public void ToolsVersionDefault () + { + var g = ProjectCollection.GlobalProjectCollection; + var root = ProjectRootElement.Create (); + // this will be wrong in the future version, but since .NET 4.5 still expects "4.0" we can't say for sure. + Assert.AreEqual ("4.0", root.ToolsVersion, "#1"); + } + + [Test] + public void ToolsVersionIsEmptyWithXml () + { + string project_xml_1 = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'><ItemGroup><None Include='bar.txt' /></ItemGroup></Project>"; + var xml = XmlReader.Create (new StringReader (project_xml_1), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual (string.Empty, root.ToolsVersion, "#1"); + } + + [Test] + public void LoadUnknownChild () + { + string project_xml_1 = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'><Unknown /></Project>"; + var xml = XmlReader.Create (new StringReader (project_xml_1), null, "file://localhost/foo.xml"); + try { + ProjectRootElement.Create (xml); + Assert.Fail ("should throw InvalidProjectFileException"); + } catch (InvalidProjectFileException ex) { + #if NET_4_5 + Assert.AreEqual (1, ex.LineNumber, "#1"); + // unlike unexpected element case which returned the position for '<', it does return the name start char... + Assert.AreEqual (70, ex.ColumnNumber, "#2"); + #endif + } + } + + [Test] + public void LoadUnregisteredItem () + { + string project_xml_1 = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'><ItemGroup><UnregisteredItem Include='bar.txt' /></ItemGroup></Project>"; + var xml = XmlReader.Create (new StringReader (project_xml_1), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual (1, root.Items.Count, "#1"); + } + + [Test] + public void LoadInvalidProjectForBadCondition () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Foo>What are 'ESCAPE' & ""EVALUATE"" ? $ # % ^</Foo> + <!-- Note that this contains invalid Condition expression. Project.ctor() fails to load. --> + <Baz Condition=""$(Void)=="">$(FOO)</Baz> + </PropertyGroup> +</Project>"; + var path = "file://localhost/foo.xml"; + var reader = XmlReader.Create (new StringReader (xml), null, path); + var root = ProjectRootElement.Create (reader); + Assert.AreEqual (2, root.Properties.Count, "#1"); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void LoadInvalidProjectGroupInProjectGroup () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> + <PropertyGroup> + <Foo>Bar</Foo> + <PropertyGroup> + <X>x</X> + <Y>y</Y> + <Z>z</Z> + </PropertyGroup> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void LoadInvalidItemGroupInProjectGroup () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> + <PropertyGroup> + <Foo>Bar</Foo> + <ItemGroup/> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + + [Test] + public void ChildAndAllChildren () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> + <PropertyGroup> + <Foo>Bar</Foo> + <Item/> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual (2, root.Children.Count, "#1"); + // AllChildren expands descendants + Assert.AreEqual (4, root.AllChildren.Count (), "#2"); + } + + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void SaveWithoutFullPath () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + root.Save (); + } + + [Test] + public void SaveToWriter () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + var sw = new StringWriter (); + root.Save (sw); + // CRLF? mmm, k... + Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n" + project_xml.Replace ('\'', '"'), sw.ToString (), "#1"); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void ImportsMissingProject () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='' /> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + } +} diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs new file mode 100644 index 0000000000..700a41663d --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs @@ -0,0 +1,150 @@ +// +// ProjectCollectionTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using NUnit.Framework; +using Microsoft.Build.Execution; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ProjectCollectionTest + { + [Test] + public void GlobalProperties () + { + var g = ProjectCollection.GlobalProjectCollection; + Assert.AreEqual (0, g.GlobalProperties.Count, "#1"); + Assert.IsTrue (g.GlobalProperties.IsReadOnly, "#2"); + } + + [Test] + public void DefaultToolsVersion () + { + var pc = ProjectCollection.GlobalProjectCollection; + Assert.AreEqual (pc.Toolsets.First ().ToolsVersion, pc.DefaultToolsVersion, "#1"); + } + + [Test] + public void Toolsets () + { + var pc = ProjectCollection.GlobalProjectCollection; + Assert.IsNotNull (pc.Toolsets, "#1-1"); + Assert.IsTrue (pc.Toolsets.Any (), "#1-2"); + pc = new ProjectCollection (); + Assert.IsNotNull (pc.Toolsets, "#2-1"); + Assert.IsTrue (pc.Toolsets.Any (), "#2-2"); + } + + [Test] + public void BuildDoesNotIncreaseCollectionContent () + { + string empty_project_xml = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (empty_project_xml)); + var root = ProjectRootElement.Create (xml); + var coll = new ProjectCollection (); + var inst = new ProjectInstance (root, null, null, coll); + root.FullPath = "ProjectCollectionTest.BuildDoesNotIncreaseCollectionContent.proj"; + Assert.AreEqual (0, coll.Count, "#1"); + inst.Build (); + Assert.AreEqual (0, coll.Count, "#2"); + } + + [Test] + public void GetLoadedProjectsWithoutFullPath () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + string path = Path.GetFullPath ("foo.xml"); + var pc = new ProjectCollection (); + + pc.LoadProject (XmlReader.Create (new StringReader (project_xml), null, path)); + Assert.AreEqual (0, pc.GetLoadedProjects (path).Count, "#1"); // huh? + Assert.AreEqual (0, pc.LoadedProjects.Count, "#1.1"); + + new Project (root, null, null, pc); + Assert.AreEqual (0, pc.GetLoadedProjects (path).Count, "#2"); // huh? + } + + [Test] + public void GetLoadedProjectsSuccess () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + string path = Path.GetFullPath ("foo.xml"); + var pc = new ProjectCollection (); + + var proj = new Project (root, null, null, pc); + // this order also matters for test; It sets FullPath after Project.ctor(), and should still work. + root.FullPath = "foo.xml"; + + Assert.AreEqual (1, pc.GetLoadedProjects (path).Count, "#1"); // wow ok... + Assert.AreEqual (proj, pc.GetLoadedProjects (path).First (), "#2"); + } + + [Test] + public void GetLoadedProjectsSuccess2 () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + string path = Path.GetFullPath ("GetLoadedProjectsSuccess2.xml"); + var pc = new ProjectCollection (); + + using (var fs = File.CreateText (path)) + fs.Write (project_xml); + try { + var proj = pc.LoadProject (path); + + Assert.AreEqual (1, pc.GetLoadedProjects (path).Count, "#1"); // ok... LoadProject (with filename) adds it to the collection. + Assert.AreEqual (proj, pc.GetLoadedProjects (path).First (), "#2"); + } finally { + File.Delete (path); + } + } + + [Test] + public void GetLoadedProjectsForProjectInstance () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + string path = Path.GetFullPath ("foo.xml"); + var pc = new ProjectCollection (); + root.FullPath = "foo.xml"; + + new ProjectInstance (root, null, null, pc); + Assert.AreEqual (0, pc.GetLoadedProjects (path).Count, "#1"); // so, ProjectInstance does not actually load Project... + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemDefinitionTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemDefinitionTest.cs new file mode 100644 index 0000000000..cd86873c84 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemDefinitionTest.cs @@ -0,0 +1,104 @@ +// +// ProjectItemDefinitionTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using NUnit.Framework; +using System.Collections.Generic; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ProjectItemDefinitionTest + { + [Test] + public void Properties () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemDefinitionGroup> + <Foo> + <prop1>value1</prop1> + <prop2>value1</prop2> + </Foo> + <!-- This one is merged into existing Foo definition above. --> + <Foo> + <prop1>valueX1</prop1><!-- this one overrides value1. --> + <prop3>value3</prop3> + </Foo> + </ItemDefinitionGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + Assert.AreEqual (1, proj.ItemDefinitions.Count, "#1"); // Foo + var def = proj.ItemDefinitions ["Foo"]; + Assert.AreEqual ("Foo", def.ItemType, "#1x"); + Assert.AreEqual (3, def.MetadataCount, "#2"); + var md1 = def.Metadata.First (m => m.Name == "prop1"); + Assert.AreEqual ("Foo", md1.ItemType, "#2x"); + Assert.AreEqual ("valueX1", md1.UnevaluatedValue, "#3"); + // FIXME: enable it once we implemented it. + //Assert.AreEqual ("valueX1", md1.EvaluatedValue, "#4"); + Assert.IsNotNull (md1.Predecessor, "#5"); + Assert.AreEqual ("value1", md1.Predecessor.UnevaluatedValue, "#6"); + // FIXME: enable it once we implemented it. + //Assert.AreEqual ("value1", md1.Predecessor.EvaluatedValue, "#7"); + } + + [Test] + public void Condition () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemDefinitionGroup> + <I Condition='{0}'> + <DefinedMetadata>X</DefinedMetadata> + </I> + </ItemDefinitionGroup> + <ItemGroup> + <I Include='foo' /> + </ItemGroup> +</Project>"; + var reader = XmlReader.Create (new StringReader (string.Format (xml, "True"))); + var root = ProjectRootElement.Create (reader); + var proj = new Project (root); + var i = proj.GetItems ("I").First (); + Assert.AreEqual ("X", i.GetMetadataValue ("DefinedMetadata"), "#1"); + + reader = XmlReader.Create (new StringReader (string.Format (xml, "False"))); + root = ProjectRootElement.Create (reader); + proj = new Project (root); + i = proj.GetItems ("I").First (); + Assert.AreEqual (string.Empty, i.GetMetadataValue ("DefinedMetadata"), "#2"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemTest.cs new file mode 100644 index 0000000000..61973b7ceb --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemTest.cs @@ -0,0 +1,212 @@ +// +// ProjectItemTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using NUnit.Framework; +using System.Collections.Generic; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ProjectItemTest + { + [Test] + public void SetUnevaluatedInclude () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='foo/bar.txt' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual (1, root.ItemGroups.Count, "#1"); + var g = root.ItemGroups.First (); + Assert.AreEqual (1, g.Items.Count, "#2"); + var xitem = g.Items.First (); + var proj = new Project (root); + var item = proj.ItemsIgnoringCondition.First (); + string inc = "foo/bar.txt"; + Assert.AreEqual (inc, xitem.Include, "#3"); + Assert.AreEqual (inc, item.UnevaluatedInclude, "#4"); + string inc2 = "foo/bar.ext.txt"; + item.UnevaluatedInclude = inc2; + Assert.AreEqual (inc2, xitem.Include, "#5"); + Assert.AreEqual (inc2, item.UnevaluatedInclude, "#6"); + } + + void SetupTemporaryDirectoriesAndFiles () + { + Directory.CreateDirectory ("Test/ProjectItemTestTemporary"); + Directory.CreateDirectory ("Test/ProjectItemTestTemporary/parent"); + Directory.CreateDirectory ("Test/ProjectItemTestTemporary/parent/dir1"); + Directory.CreateDirectory ("Test/ProjectItemTestTemporary/parent/dir2"); + File.CreateText ("Test/ProjectItemTestTemporary/x.cs").Close (); + File.CreateText ("Test/ProjectItemTestTemporary/parent/dir1/a.cs").Close (); + File.CreateText ("Test/ProjectItemTestTemporary/parent/dir1/a1.cs").Close (); + File.CreateText ("Test/ProjectItemTestTemporary/parent/dir1/b.cs").Close (); + File.CreateText ("Test/ProjectItemTestTemporary/parent/dir2/a2.cs").Close (); + File.CreateText ("Test/ProjectItemTestTemporary/parent/dir2/a.cs").Close (); + File.CreateText ("Test/ProjectItemTestTemporary/parent/dir2/b.cs").Close (); + } + + void CleanupTemporaryDirectories () + { + Directory.Delete ("Test/ProjectItemTestTemporary", true); + } + + [Test] + public void WildcardExpansion () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='Test/ProjectItemTestTemporary/parent/dir*/a*.cs;Test/ProjectItemTestTemporary/x.cs' /> + </ItemGroup> +</Project>"; + try { + SetupTemporaryDirectoriesAndFiles (); + WildcardExpansionCommon (project_xml, false); + } finally { + CleanupTemporaryDirectories (); + } + } + + [Test] + public void WildcardExpansionRecursive () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='Test/ProjectItemTestTemporary/parent/**/a*.cs;Test/ProjectItemTestTemporary/x.cs' /> + </ItemGroup> +</Project>"; + try { + SetupTemporaryDirectoriesAndFiles (); + WildcardExpansionCommon (project_xml, true); + } finally { + CleanupTemporaryDirectories (); + } + } + + void WildcardExpansionCommon (string xmlString, bool hasRecursiveDir) + { + char sep = Path.DirectorySeparatorChar; + var xml = XmlReader.Create (new StringReader (xmlString)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + var xitem = proj.Xml.Items.First (); + // sort is needed because they are only sorted by ItemType. + var items = proj.Items.OrderBy (p => p.EvaluatedInclude).ToArray (); + Assert.AreEqual (5, items.Length, "#1"); + Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir1{0}a.cs", Path.DirectorySeparatorChar), items [0].EvaluatedInclude, "#2"); + Assert.AreEqual ("a", items [0].GetMetadataValue ("Filename"), "#3"); + if (hasRecursiveDir) + Assert.AreEqual ("dir1" + sep, items [0].GetMetadataValue ("RecursiveDir"), "#3.2"); + Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir1{0}a1.cs", Path.DirectorySeparatorChar), items [1].EvaluatedInclude, "#4"); + Assert.AreEqual ("a1", items [1].GetMetadataValue ("Filename"), "#5"); + if (hasRecursiveDir) + Assert.AreEqual ("dir1" + sep, items [1].GetMetadataValue ("RecursiveDir"), "#5.2"); + Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir2{0}a.cs", Path.DirectorySeparatorChar), items [2].EvaluatedInclude, "#6"); + Assert.AreEqual ("a", items [2].GetMetadataValue ("Filename"), "#7"); + if (hasRecursiveDir) + Assert.AreEqual ("dir2" + sep, items [2].GetMetadataValue ("RecursiveDir"), "#7.2"); + Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir2{0}a2.cs", Path.DirectorySeparatorChar), items [3].EvaluatedInclude, "#8"); + Assert.AreEqual ("a2", items [3].GetMetadataValue ("Filename"), "#9"); + if (hasRecursiveDir) + Assert.AreEqual ("dir2" + sep, items [3].GetMetadataValue ("RecursiveDir"), "#9.2"); + Assert.AreEqual ("Test/ProjectItemTestTemporary/x.cs", items [4].EvaluatedInclude, "#10"); + for (int i = 0; i < items.Length; i++) + Assert.AreEqual (xitem, items [i].Xml, "#11:" + i); + } + + [Test] + public void Metadata () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemDefinitionGroup> + <Foo> + <prop1>value1</prop1> + </Foo> + </ItemDefinitionGroup> + <ItemGroup> + <Foo Include='foo/bar.txt'> + <prop1>valueX1</prop1> + </Foo> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual (1, root.ItemGroups.Count, "#1"); + var g = root.ItemGroups.First (); + Assert.AreEqual (1, g.Items.Count, "#2"); + var proj = new Project (root); + var item = proj.ItemsIgnoringCondition.First (); + var meta = item.GetMetadata ("prop1"); + Assert.IsNotNull (meta, "#3"); + Assert.AreEqual ("valueX1", meta.UnevaluatedValue, "#4"); + Assert.IsNotNull (meta.Predecessor, "#5"); + Assert.AreEqual ("value1", meta.Predecessor.UnevaluatedValue, "#6"); + + // Well-known metadata don't show up via GetMetadata(), but does show up via GetMetadataValue(). + Assert.AreEqual (null, item.GetMetadata ("Filename"), "#7"); + Assert.AreEqual ("bar", item.GetMetadataValue ("Filename"), "#8"); + } + + [Test] + public void ExpandPropertyThenTrim () + { + string test = @"A +B +C + "; + string project_xml = string.Format (@"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Test>{0}</Test> + <Test2>$(TEST)</Test2> + </PropertyGroup> + <ItemGroup> + <X Include='$(TEST)' /> + <X2 Include='$(TEST)z' /> + </ItemGroup> +</Project>", test); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectItemTest.ExpandPropertyThenTrim.proj"; + var proj = new ProjectInstance (root); + Assert.AreEqual (test, proj.GetPropertyValue ("TEST"), "#1"); + Assert.AreEqual (test, proj.GetPropertyValue ("TEST2"), "#2"); + Assert.AreEqual (test.Trim (), proj.GetItems ("X").First ().EvaluatedInclude, "#3"); + Assert.AreEqual (test + "z", proj.GetItems ("X2").First ().EvaluatedInclude, "#4"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectPropertyTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectPropertyTest.cs new file mode 100644 index 0000000000..9c89ef09f6 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectPropertyTest.cs @@ -0,0 +1,130 @@ +// +// ProjectPropertyTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using NUnit.Framework; +using System.Collections.Generic; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ProjectPropertyTest + { + [Test] + public void SetUnevaluatedValueOverwritesElementValue () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Foo>Bar</Foo> + <Item/> + <X>1</X> + <X>2</X> + <PATH>overriden</PATH> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var pe = root.Properties.First (); + Assert.AreEqual ("Bar", pe.Value, "#1"); + var proj = new Project (root); + var prop = proj.Properties.First (p => p.Name == "Foo"); + Assert.AreEqual ("Bar", prop.UnevaluatedValue, "#2"); + prop.UnevaluatedValue = "x"; + Assert.AreEqual ("x", pe.Value, "#3"); + + prop = proj.Properties.First (p => p.Name == "X"); + Assert.AreEqual ("2", prop.UnevaluatedValue, "#4"); + Assert.IsNotNull (prop.Predecessor, "#5"); + Assert.AreEqual ("1", prop.Predecessor.UnevaluatedValue, "#6"); + + // environment property could also be Predecessor (and removed...maybe. + // I could reproduce only NRE = .NET bug with environment property so far.) + prop = proj.Properties.First (p => p.Name == "PATH"); + Assert.AreEqual ("overriden", prop.UnevaluatedValue, "#7"); + Assert.IsNotNull (prop.Predecessor, "#8"); + } + + [Test] + [ExpectedException (typeof(InvalidOperationException))] + public void UpdateGlobalPropertyValue () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var props = new Dictionary<string, string> (); + props.Add ("GP", "GV"); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root, props, null); + var pe = proj.Properties.First (p => p.IsGlobalProperty); + pe.UnevaluatedValue = "UPDATED"; + } + + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void UpdateEnvironmentPropertyValue () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + var pe = proj.Properties.First (p => p.IsEnvironmentProperty); + pe.UnevaluatedValue = "UPDATED"; + } + + [Test] + public void DeepReferences () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <A>1</A> + <B>$(A)+1</B> + <C>$(B)+2</C> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + Assert.AreEqual ("1+1+2", new Project (root).GetProperty ("C").EvaluatedValue, "#1"); + Assert.AreEqual ("1+1+2", new ProjectInstance (root).GetProperty ("C").EvaluatedValue, "#1"); + } + + [Test] + public void PlatformPropertyEmptyByDefault () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + Assert.IsNull (proj.GetProperty ("PLATFORM"), "#1"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs new file mode 100644 index 0000000000..4ea4551816 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs @@ -0,0 +1,253 @@ +// +// ProjectTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using NUnit.Framework; +using Microsoft.Build.Exceptions; +using Microsoft.Build.Logging; +using Microsoft.Build.Framework; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ProjectTest + { + [Test] + public void EscapeDoesWTF () + { + string value_xml = "What are 'ESCAPE' & \"EVALUATE\" ? $ # % ^"; + string value = "What are 'ESCAPE' & \"EVALUATE\" ? $ # % ^"; + string escaped = "What are %27ESCAPE%27 & \"EVALUATE\" %3f %24 # %25 ^"; + string xml = string.Format (@"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Foo>{0}</Foo> + <Baz>$(FOO)</Baz> + </PropertyGroup> +</Project>", value_xml); + var path = "file://localhost/foo.xml"; + var reader = XmlReader.Create (new StringReader (xml), null, path); + var root = ProjectRootElement.Create (reader); + var proj = new Project (root); + var prop = proj.Properties.First (p => p.Name == "Foo"); + Assert.AreEqual (value, prop.UnevaluatedValue, "#1"); + Assert.AreEqual (value, prop.EvaluatedValue, "#2"); + // eh? + Assert.AreEqual (value, Project.GetPropertyValueEscaped (prop), "#3"); + prop = proj.Properties.First (p => p.Name == "Baz"); + Assert.AreEqual ("$(FOO)", prop.UnevaluatedValue, "#4"); + Assert.AreEqual (value, prop.EvaluatedValue, "#5"); + // eh? + Assert.AreEqual (value, Project.GetPropertyValueEscaped (prop), "#6"); + + // OK you are fine. + Assert.AreEqual (escaped, ProjectCollection.Escape (value), "#7"); + } + + [Test] + public void FullPath () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + proj.FullPath = "ABC"; + Assert.IsTrue (proj.FullPath.EndsWith (Path.DirectorySeparatorChar + "ABC"), "#1"); + Assert.AreEqual (root.FullPath, proj.FullPath, "#2"); + } + + [Test] + public void BuildEmptyProject () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectTest.BuildEmptyProject.proj"; + + // This seems to do nothing and still returns true + Assert.IsTrue (new Project (root) { FullPath = "ProjectTest.BuildEmptyProject.1.proj" }.Build (), "#1"); + // This seems to fail to find the appropriate target + Assert.IsFalse (new Project (root) { FullPath = "ProjectTest.BuildEmptyProject.2.proj" }.Build ("Build", null), "#2"); + // Thus, this tries to build all the targets (empty) and no one failed, so returns true(!) + Assert.IsTrue (new Project (root) { FullPath = "ProjectTest.BuildEmptyProject.3.proj" }.Build (new string [0], null), "#3"); + // Actially null "targets" is accepted and returns true(!!) + Assert.IsTrue (new Project (root) { FullPath = "ProjectTest.BuildEmptyProject.4.proj" }.Build ((string []) null, null), "#4"); + // matching seems to be blindly done, null string also results in true(!!) + Assert.IsTrue (new Project (root) { FullPath = "ProjectTest.BuildEmptyProject.5.proj" }.Build ((string) null, null), "#5"); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void LoadInvalidProjectForBadCondition () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Foo>What are 'ESCAPE' & ""EVALUATE"" ? $ # % ^</Foo> + <!-- Note that this contains invalid Condition expression, yet ProjectElement.Create() does NOT fail. --> + <Baz Condition=""$(Void)=="">$(FOO)</Baz> + </PropertyGroup> +</Project>"; + var reader = XmlReader.Create (new StringReader (xml)); + var root = ProjectRootElement.Create (reader); + new Project (root); + } + + [Test] + public void ExpandString () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Foo>What are 'ESCAPE' & ""EVALUATE"" ? $ # % ^</Foo> + <Bar>y</Bar> + <Baz Condition=""$(Void)==''"">$(FOO)</Baz> + </PropertyGroup> +</Project>"; + var reader = XmlReader.Create (new StringReader (xml)); + var root = ProjectRootElement.Create (reader); + var proj = new Project (root); + root.FullPath = "ProjectTest.ExpandString.proj"; + Assert.AreEqual ("xyz", proj.ExpandString ("x$(BAR)z"), "#1"); + Assert.AreEqual ("x$(BARz", proj.ExpandString ("x$(BARz"), "#2"); // incomplete + Assert.AreEqual ("xz", proj.ExpandString ("x@(BAR)z"), "#3"); // not an item + } + + [Test] + public void BuildCSharpTargetGetFrameworkPaths () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + root.FullPath = "ProjectTest.BuildCSharpTargetGetFrameworkPaths.proj"; + Assert.IsTrue (proj.Build ("GetFrameworkPaths", new ILogger [] {/*new ConsoleLogger ()*/})); + } + + [Test] + public void BuildCSharpTargetBuild () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <AssemblyName>Foo</AssemblyName> + </PropertyGroup> + <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj"; + var proj = new Project (root, null, "4.0"); + Assert.IsFalse (proj.Build ("Build", new ILogger [] {/*new ConsoleLogger (LoggerVerbosity.Diagnostic)*/})); // missing mandatory properties + } + + [Test] + public void EvaluateItemConditionThenIgnored () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <P></P> + </PropertyGroup> + <ItemGroup> + <Foo Condition='' Include='x' /> + <Bar Include='$(P)' /> + <Baz Include='z' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + // note that Foo is ignored BUT Bar is NOT ignored. + Assert.AreEqual (2, proj.ItemsIgnoringCondition.Count, "#1"); + Assert.IsNotNull ("Bar", proj.ItemsIgnoringCondition.First ().ItemType, "#2"); + Assert.IsNotNull ("Baz", proj.ItemsIgnoringCondition.Last ().ItemType, "#3"); + } + + [Test] + public void EvaluateSamePropertiesInOrder () + { + // used in Microsoft.Common.targets + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <BaseIntermediateOutputPath Condition=""'$(BaseIntermediateOutputPath)' == ''"">obj\</BaseIntermediateOutputPath> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + Assert.AreEqual ("obj\\", proj.GetPropertyValue ("BaseIntermediateOutputPath"), "#1"); + } + + [Test] + public void DirtyMarking () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + Assert.IsFalse (proj.IsDirty, "#1"); + proj.MarkDirty (); + Assert.IsTrue (proj.IsDirty, "#2"); + } + + [Test] + public void DirtyMarking2 () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); + proj.DisableMarkDirty = true; + proj.MarkDirty (); + Assert.IsFalse (proj.IsDirty, "#1"); // not rejected, just ignored. + proj.DisableMarkDirty = false; + Assert.IsFalse (proj.IsDirty, "#2"); // not like status pending + proj.MarkDirty (); + Assert.IsTrue (proj.IsDirty, "#3"); + } + + [Test] + public void CreateProjectInstance () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <AssemblyName>Foo</AssemblyName> + </PropertyGroup> + <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root, null, "4.0"); + var inst = proj.CreateProjectInstance (); + Assert.AreEqual ("4.0", inst.ToolsVersion, "#1"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ResolvedImportTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ResolvedImportTest.cs new file mode 100644 index 0000000000..9c4359ee7a --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ResolvedImportTest.cs @@ -0,0 +1,181 @@ +// +// ResolvedImportTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using NUnit.Framework; +using Microsoft.Build.Exceptions; +using Microsoft.Build.Framework; +using Microsoft.Build.Execution; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ResolvedImportTest + { + const string temp_file_name = "test_imported.proj"; + + [Test] + public void SimpleImportAndSemanticValues () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='test_imported.proj' /> +</Project>"; + string imported = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <A>x</A> + <B>y</B> + </PropertyGroup> + <ItemGroup> + <X Include=""included.txt"" /> + </ItemGroup> +</Project>"; + using (var ts = File.CreateText (temp_file_name)) + ts.Write (imported); + try { + var reader = XmlReader.Create (new StringReader (xml)); + var root = ProjectRootElement.Create (reader); + Assert.AreEqual (temp_file_name, root.Imports.First ().Project, "#1"); + var proj = new Project (root); + var prop = proj.GetProperty ("A"); + Assert.IsNotNull (prop, "#2"); + Assert.IsTrue (prop.IsImported, "#3"); + var item = proj.GetItems ("X").FirstOrDefault (); + Assert.IsNotNull (item, "#4"); + Assert.AreEqual ("included.txt", item.EvaluatedInclude, "#5"); + } finally { + File.Delete (temp_file_name); + } + } + + string import_overrides_test_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <A>X</A> + </PropertyGroup> + <Import Condition=""{0}"" Project='test_imported.proj' /> + <PropertyGroup> + <B>Y</B> + </PropertyGroup> +</Project>"; + string import_overrides_test_imported = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <C Condition='$(A)==x'>c</C> + <A>a</A> + <B>b</B> + </PropertyGroup> + <ItemGroup> + <X Include=""included.txt"" /> + </ItemGroup> +</Project>"; + + void ImportAndPropertyOverrides (string label, string condition, string valueA, string valueB, string valueAPredecessor, bool existsC) + { + using (var ts = File.CreateText (temp_file_name)) + ts.Write (import_overrides_test_imported); + try { + string xml = string.Format (import_overrides_test_xml, condition); + var reader = XmlReader.Create (new StringReader (xml)); + var root = ProjectRootElement.Create (reader); + var proj = new Project (root); + var a = proj.GetProperty ("A"); + Assert.IsNotNull (a, label + "#2"); + Assert.AreEqual (valueA, a.EvaluatedValue, label + "#3"); + if (valueAPredecessor == null) + Assert.IsNull (a.Predecessor, label + "#3.1"); + else { + Assert.IsNotNull (a.Predecessor, label + "#3.2"); + Assert.AreEqual (valueAPredecessor, a.Predecessor.EvaluatedValue, label + "#3.3"); + } + var b = proj.GetProperty ("B"); + Assert.IsNotNull (b, label + "#4"); + Assert.AreEqual (valueB, b.EvaluatedValue, label + "#5"); + var c = proj.GetProperty ("C"); // yes it can be retrieved. + if (existsC) { + Assert.IsNotNull (c, label + "#6"); + Assert.AreEqual ("c", c.EvaluatedValue, label + "#7"); + } + else + Assert.IsNull (c, label + "#8"); + } finally { + File.Delete (temp_file_name); + } + } + + [Test] + public void ImportAndPropertyOverrides () + { + ImportAndPropertyOverrides ("[1]", "'True'", "a", "Y", "X", true); + ImportAndPropertyOverrides ("[2]", "$(A)=='X'", "a", "Y", "X", true); // evaluated as true + ImportAndPropertyOverrides ("[3]", "$(B)=='Y'", "X", "Y", null, false); // evaluated as false + ImportAndPropertyOverrides ("[4]", "$(B)=='b'", "X", "Y", null, false); // of course not evaluated with imported value + } + + // FIXME: + // Looks like $(MSBuildThisFile) is available only within property value, not via .NET MSBuild API. + // Right now our variable is added as a Reserved property, but we will have to hide it. + // + [Test] + public void EvaluateMSBuildThisFileProperty () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <A>$(MSBuildThisFile)</A> + </PropertyGroup> + <Import Project='test_imported.proj' /> +</Project>"; + string imported = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <B>$(MSBuildThisFile)</B> + </PropertyGroup> +</Project>"; + using (var ts = File.CreateText (temp_file_name)) + ts.Write (imported); + try { + var reader = XmlReader.Create (new StringReader (xml)); + var root = ProjectRootElement.Create (reader); + var proj = new Project (root); + var a = proj.GetProperty ("A"); + Assert.AreEqual (string.Empty, a.EvaluatedValue, "#1"); + var b = proj.GetProperty ("B"); + Assert.AreEqual (temp_file_name, b.EvaluatedValue, "#2"); + + var pi = new ProjectInstance (root); + var ai = pi.GetProperty ("A"); + Assert.AreEqual (string.Empty, ai.EvaluatedValue, "#3"); + var bi = pi.GetProperty ("B"); + Assert.AreEqual (temp_file_name, bi.EvaluatedValue, "#4"); + } finally { + File.Delete (temp_file_name); + } + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ToolsetTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ToolsetTest.cs new file mode 100644 index 0000000000..ac4e2d6610 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ToolsetTest.cs @@ -0,0 +1,53 @@ +// +// ToolSetTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using Microsoft.Build.Evaluation; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Evaluation +{ + [TestFixture] + public class ToolsetTest + { + [Test] + public void Constructor () + { + var ts = new Toolset ("4.3", "c:\\", ProjectCollection.GlobalProjectCollection, null); + Assert.IsNotNull (ts.Properties, "#1"); + Assert.AreEqual (0, ts.Properties.Count, "#2"); +#if NET_4_5 + Assert.IsNull (ts.DefaultSubToolsetVersion, "#3"); + Assert.IsNotNull (ts.SubToolsets, "#4"); + Assert.AreEqual (0, ts.SubToolsets.Count, "#5"); +#endif + Assert.AreEqual ("c:\\", ts.ToolsPath, "#6"); + Assert.AreEqual ("4.3", ts.ToolsVersion, "#7"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildManagerTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildManagerTest.cs new file mode 100644 index 0000000000..0fcbdf7560 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildManagerTest.cs @@ -0,0 +1,201 @@ +// +// BuildManagerTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using NUnit.Framework; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Logging; + +namespace MonoTests.Microsoft.Build.Execution +{ + [TestFixture] + public class BuildManagerTest + { + Project GetDummyProject () + { + string empty_project_xml = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var path = "file://localhost/foo.xml"; + var xml = XmlReader.Create (new StringReader (empty_project_xml), null, path); + var root = ProjectRootElement.Create (xml); + return new Project (root); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void GetProjectInstanceForBuildNullFullPath () + { + var manager = new BuildManager (); + manager.GetProjectInstanceForBuild (GetDummyProject ()); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void GetProjectInstanceForBuildEmptyFullPath () + { + var proj = GetDummyProject (); + proj.FullPath = ""; + var manager = new BuildManager (); + manager.GetProjectInstanceForBuild (proj); + } + + [Test] + public void GetProjectInstanceForBuild () + { + string empty_project_xml = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var path = "file://localhost/foo.xml"; + var xml = XmlReader.Create (new StringReader(empty_project_xml), null, path); + var root = ProjectRootElement.Create (xml); + root.FullPath = path; + var proj = new Project (root); + var manager = new BuildManager (); + var inst = manager.GetProjectInstanceForBuild (proj); + Assert.AreEqual (inst, manager.GetProjectInstanceForBuild (proj), "#1"); + } + + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void PendBuildRequestBeforeBeginBuild () + { + string empty_project_xml = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var path = "file://localhost/foo.xml"; + var xml = XmlReader.Create (new StringReader (empty_project_xml), null, path); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + new BuildManager ().PendBuildRequest (new BuildRequestData (proj, new string [0])); + } + + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void ResetCachesDuringBuildIsInvalid () + { + // Windows does not have useful sleep or alternative, so skip it + bool is_windows = true; + switch (Environment.OSVersion.Platform) { + case PlatformID.Unix: + case PlatformID.MacOSX: + is_windows = false; + break; + } + string project_xml = string.Format (@"<Project DefaultTargets='Wait1Sec' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Target Name='Wait1Sec'> + <Exec Command='{0}' /> + </Target> +</Project>", is_windows ? "powershell -command \"Start-Sleep -s 1\"" : "/bin/sleep 1"); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + var bm = new BuildManager (); + bm.BeginBuild (new BuildParameters ()); + var sub = bm.PendBuildRequest (new BuildRequestData (proj, new string [] { "Wait1Sec" })); + sub.ExecuteAsync (delegate {}, null); + try { + bm.ResetCaches (); + } finally { + bm.EndBuild (); // yes, it should work even after invalid ResetCaches call... at least on .NET it does. + } + } + + [Test] + public void BasicManualParallelBuilds () + { + string project_xml = @"<Project DefaultTargets='Wait1Sec' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Target Name='Wait1Sec'> + <!-- Exec Command='ping 10.1.1.1 -n 1 -w 1' /--> + <Exec Command='/bin/sleep 1' /> + </Target> +</Project>"; + switch (Environment.OSVersion.Platform) { + case PlatformID.MacOSX: + case PlatformID.Unix: + break; + default: + return; // ignore, cannot run it + } + + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + var bm = new BuildManager (); + bm.BeginBuild (new BuildParameters () { Loggers = new ILogger [] {new ConsoleLogger (LoggerVerbosity.Diagnostic, TextWriter.Null.WriteLine, null, null)} }); + DateTime waitDone = DateTime.MinValue; + DateTime beforeExec = DateTime.Now; + var l = new List<BuildSubmission> (); + for (int i = 0; i < 10; i++) { + var sub = bm.PendBuildRequest (new BuildRequestData (proj, new string [] { "Wait1Sec" })); + l.Add (sub); + sub.ExecuteAsync (delegate { waitDone = DateTime.Now; }, null); + } + bm.EndBuild (); + Assert.IsTrue (l.All (s => s.BuildResult.OverallResult == BuildResultCode.Success), "#1"); + DateTime endBuildDone = DateTime.Now; + Assert.IsTrue (endBuildDone - beforeExec >= TimeSpan.FromSeconds (1), "#2"); + Assert.IsTrue (endBuildDone > waitDone, "#3"); + } + + [Test] + public void BuildCommonResolveAssemblyReferences () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.Common.targets' /> + <ItemGroup> + <Reference Include='System.Core' /> + <Reference Include='System.Xml' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "BuildManagerTest.BuildCommonResolveAssemblyReferences.proj"; + var proj = new ProjectInstance (root); + var manager = new BuildManager (); + var parameters = new BuildParameters () { Loggers = new ILogger [] {new ConsoleLogger (LoggerVerbosity.Diagnostic)} }; + var request = new BuildRequestData (proj, new string [] {"ResolveAssemblyReferences"}); + Assert.AreEqual (string.Empty, proj.GetPropertyValue ("TargetFrameworkDirectory"), "#1-1"); + var result = manager.Build (parameters, request); + Assert.AreNotEqual (string.Empty, proj.GetPropertyValue ("TargetFrameworkDirectory"), "#1-2"); // filled during build. + Assert.IsTrue (result.ResultsByTarget.ContainsKey ("GetFrameworkPaths"), "#2-1"); + Assert.IsTrue (result.ResultsByTarget.ContainsKey ("PrepareForBuild"), "#2-2"); + Assert.IsTrue (result.ResultsByTarget.ContainsKey ("ResolveAssemblyReferences"), "#2-3"); + var items = proj.GetItems ("ReferencePath"); + Assert.AreEqual (2, items.Count (), "#3"); + var syscore = items.FirstOrDefault (i => Path.GetFileName (i.EvaluatedInclude) == "System.Core.dll"); + var sysxml = items.FirstOrDefault (i => Path.GetFileName (i.EvaluatedInclude) == "System.Xml.dll"); + Assert.IsNotNull (syscore, "#4-1"); + Assert.IsNotNull (sysxml, "#4-2"); + Assert.IsTrue (File.Exists (syscore.EvaluatedInclude), "#5-1"); + Assert.IsTrue (File.Exists (sysxml.EvaluatedInclude), "#5-1"); + Assert.AreEqual (BuildResultCode.Success, result.OverallResult, "#6"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildParametersTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildParametersTest.cs new file mode 100644 index 0000000000..47cd5f9007 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildParametersTest.cs @@ -0,0 +1,66 @@ +// +// BuildParametersTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.Globalization; +using System.IO; +using System.Linq; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Execution +{ + [TestFixture] + public class BuildParametersTest + { + [Test] + public void GetToolset () + { + var bp = new BuildParameters (ProjectCollection.GlobalProjectCollection); + Assert.IsNull (bp.GetToolset ("0.1"), "#1"); + var ts = bp.GetToolset ("2.0"); + // They are equal + Assert.AreEqual (ProjectCollection.GlobalProjectCollection.Toolsets.First (t => t.ToolsVersion == "2.0"), ts, "#2"); + + bp = new BuildParameters (); + Assert.IsNull (bp.GetToolset ("0.1"), "#1"); + ts = bp.GetToolset ("2.0"); + // They are NOT equal, because ProjectCollection seems to be different. + Assert.AreNotEqual (ProjectCollection.GlobalProjectCollection.Toolsets.First (t => t.ToolsVersion == "2.0"), ts, "#2"); + } + + [Test] + public void PropertiesDefault () + { + var bp = new BuildParameters (); + Assert.IsTrue (bp.EnableNodeReuse, "#1"); + Assert.IsTrue (bp.EnvironmentProperties.Count > 0, "#2"); + Assert.AreEqual (CultureInfo.CurrentCulture, bp.Culture, "#3"); + } + } +} diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs new file mode 100644 index 0000000000..df2febcbf7 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs @@ -0,0 +1,115 @@ +// +// BuildSubmissionTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using NUnit.Framework; +using Microsoft.Build.Logging; +using Microsoft.Build.Framework; +using System.Collections.Generic; + +namespace MonoTests.Microsoft.Build.Execution +{ + [TestFixture] + public class BuildSubmissionTest + { + [Test] + public void ResultBeforeExecute () + { + string empty_project_xml = "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var path = "file://localhost/foo.xml"; + var xml = XmlReader.Create (new StringReader (empty_project_xml), null, path); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + var bm = new BuildManager (); + bm.BeginBuild (new BuildParameters ()); + var sub = bm.PendBuildRequest (new BuildRequestData (proj, new string [0])); + Assert.IsNull (sub.BuildResult, "#1"); + } + + // This checks if the build output for each task is written to the loggers and not directly thrown as a Project loader error. + [Test] + public void TaskOutputsToLoggers () + { + string project_xml = @"<Project DefaultTargets='Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.Common.targets' /> + <Target Name='Foo'> + <ItemGroup> + <Foo Condition='$(X)' Include='foo.txt' /> + </ItemGroup> + </Target> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "BuildSubmissionTest.TaskOutputsToLoggers.proj"; + var proj = new ProjectInstance (root); + Assert.AreEqual ("$(X)", root.Targets.First ().ItemGroups.First ().Items.First ().Condition, "#0"); + var sw = new StringWriter (); + Assert.IsFalse (proj.Build (new ILogger [] {new ConsoleLogger (LoggerVerbosity.Diagnostic, sw.WriteLine, null, null)}), "#1"); + Assert.IsTrue (sw.ToString ().Contains ("$(X)"), "#2"); + } + + [Test] + public void EndBuildWaitsForSubmissionCompletion () + { + // Windows does not have useful sleep or alternative, so skip it + bool is_windows = true; + switch (Environment.OSVersion.Platform) { + case PlatformID.Unix: + case PlatformID.MacOSX: + is_windows = false; + break; + } + string project_xml = string.Format (@"<Project DefaultTargets='Wait1Sec' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Target Name='Wait1Sec'> + <Exec Command='{0}' /> + </Target> +</Project>", is_windows ? "powershell -command \"Start-Sleep -s 1\"" : "/bin/sleep 1"); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "BuildSubmissionTest.EndBuildWaitsForSubmissionCompletion.proj"; + var proj = new ProjectInstance (root); + var bm = new BuildManager (); + bm.BeginBuild (new BuildParameters ()); + DateTime waitDone = DateTime.MinValue; + DateTime beforeExec = DateTime.Now; + var sub = bm.PendBuildRequest (new BuildRequestData (proj, new string [] { "Wait1Sec" })); + sub.ExecuteAsync (delegate { waitDone = DateTime.Now; }, null); + bm.EndBuild (); + Assert.IsTrue (sub.BuildResult.OverallResult == BuildResultCode.Success, "#1"); + DateTime endBuildDone = DateTime.Now; + Assert.IsTrue (endBuildDone - beforeExec >= TimeSpan.FromSeconds (1), "#2"); + Assert.IsTrue (endBuildDone > waitDone, "#3"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs new file mode 100644 index 0000000000..327aa389c4 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs @@ -0,0 +1,103 @@ +// +// ProjectInstanceTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Execution; +using NUnit.Framework; +using Microsoft.Build.Evaluation; + +namespace MonoTests.Microsoft.Build.Execution +{ + [TestFixture] + public class ProjectInstanceTest + { + [Test] + public void ItemsAndProperties () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <X Condition='false' Include='bar.txt' /> + <X Include='foo.txt'> + <M>m</M> + <N>=</N> + </X> + </ItemGroup> + <PropertyGroup> + <P Condition='false'>void</P> + <P Condition='true'>valid</P> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader(project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + var item = proj.Items.First (); + Assert.AreEqual ("foo.txt", item.EvaluatedInclude, "#1"); + var prop = proj.Properties.First (p => p.Name=="P"); + Assert.AreEqual ("valid", prop.EvaluatedValue, "#2"); + Assert.IsNotNull (proj.GetProperty ("MSBuildProjectDirectory"), "#3"); + Assert.AreEqual ("2.0", proj.ToolsVersion, "#4"); + } + + [Test] + public void ExplicitToolsVersion () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader(project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root, null, "4.0", new ProjectCollection ()); + Assert.AreEqual ("4.0", proj.ToolsVersion, "#1"); + } + + [Test] + public void BuildEmptyProject () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />"; + var xml = XmlReader.Create (new StringReader (project_xml), null, "file://localhost/foo.xml"); + var root = ProjectRootElement.Create (xml); + // This seems to do nothing and still returns true + root.FullPath = "ProjectInstanceTest.BuildEmptyProject.1.proj"; + Assert.IsTrue (new ProjectInstance (root).Build (), "#1"); + // This seems to fail to find the appropriate target + root.FullPath = "ProjectInstanceTest.BuildEmptyProject.2.proj"; + Assert.IsFalse (new ProjectInstance (root).Build ("Build", null), "#2"); + // Thus, this tries to build all the targets (empty) and no one failed, so returns true(!) + root.FullPath = "ProjectInstanceTest.BuildEmptyProject.3.proj"; + Assert.IsTrue (new ProjectInstance (root).Build (new string [0], null), "#3"); + // Actially null "targets" is accepted and returns true(!!) + root.FullPath = "ProjectInstanceTest.BuildEmptyProject.4.proj"; + Assert.IsTrue (new ProjectInstance (root).Build ((string []) null, null), "#4"); + // matching seems to be blindly done, null string also results in true(!!) + root.FullPath = "ProjectInstanceTest.BuildEmptyProject.5.proj"; + Assert.IsTrue (new ProjectInstance (root).Build ((string) null, null), "#5"); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectMetadataInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectMetadataInstanceTest.cs new file mode 100644 index 0000000000..5c136d6b60 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectMetadataInstanceTest.cs @@ -0,0 +1,78 @@ +// +// ProjectMetadataInstanceTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Execution; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Execution +{ + [TestFixture] + public class ProjectMetadataInstanceTest + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <X Include='foo.txt'> + <M>m</M> + <N>=</N> + </X> + </ItemGroup> +</Project>"; + + [Test] + public void PropertiesCopiesValues () + { + var xml = XmlReader.Create (new StringReader (project_xml)); + string path = Path.GetFullPath ("foo.xml"); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + var item = proj.Items.First (); + var md = item.Metadata.First (); + Assert.AreEqual ("m", item.Metadata.First ().EvaluatedValue, "#1"); + Assert.AreEqual ("m", root.ItemGroups.First ().Items.First ().Metadata.First ().Value, "#2"); + root.ItemGroups.First ().Items.First ().Metadata.First ().Value = "X"; + Assert.AreEqual ("m", item.Metadata.First ().EvaluatedValue, "#3"); + } + + [Test] + public void ToStringOverride () + { + var xml = XmlReader.Create (new StringReader (project_xml)); + string path = Path.GetFullPath ("foo.xml"); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + var item = proj.Items.First (); + Assert.AreEqual ("M=m", item.Metadata.First ().ToString (), "#1"); + Assert.AreEqual ("N==", item.Metadata.Last ().ToString (), "#2"); // haha + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectTargetInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectTargetInstanceTest.cs new file mode 100644 index 0000000000..2ae7148c8f --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectTargetInstanceTest.cs @@ -0,0 +1,172 @@ +// +// ProjectTargetInstanceTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Execution; +using NUnit.Framework; +using Microsoft.Build.Logging; +using Microsoft.Build.Framework; + +namespace MonoTests.Microsoft.Build.Execution +{ + [TestFixture] + public class ProjectTargetInstanceTest + { + [Test] + public void DefaultTargetsEmpty () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + Assert.AreEqual (new string [0], proj.DefaultTargets, "#1"); + } + + [Test] + public void DefaultTargetsFromAttribute () + { + string project_xml = @"<Project DefaultTargets='Foo Bar Baz;Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + string [] expected = {"Foo Bar Baz", "Foo"}; + Assert.AreEqual (expected, proj.DefaultTargets, "#1"); + } + + [Test] + public void DefaultTargetsFromElements () + { + string [] defaultTargetAtts = {string.Empty, "DefaultTargets=''"}; + + for (int i = 0; i < defaultTargetAtts.Length; i++) { + string project_xml = string.Format (@"<Project {0} xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Target Name='Foo' /> + <Target Name='Bar' /> +</Project>", defaultTargetAtts [i]); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + string [] expected = {"Foo"}; // Bar is not included + Assert.AreEqual (expected, proj.DefaultTargets, "#1-" + i); + } + } + + [Test] + public void MicrosoftCommonTargets () + { + string [] defaultTargetAtts = { string.Empty, "DefaultTargets=''" }; + + for (int i = 0; i < defaultTargetAtts.Length; i++) { + string project_xml = string.Format (@"<Project {0} xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.Common.targets' /> +</Project>", defaultTargetAtts [i]); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + Assert.AreEqual ("Build", proj.DefaultTargets.FirstOrDefault (), "#1-" + i); + } + } + + [Test] + public void DefaultTargetsOverride () + { + string project_xml = @"<Project DefaultTargets='Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.Common.targets' /> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new ProjectInstance (root); + Assert.AreEqual ("Foo", proj.DefaultTargets.FirstOrDefault (), "#1"); + } + + [Test] + public void MultipleDefaultTargets () + { + bool[] expected = { true, false, true }; + string [] defaultTargets = {"Foo", "Foo;Bar", "Foo;Bar"}; + string [] targets = { string.Empty, string.Empty, "<Target Name='Bar' />" }; + for (int i = 0; i < expected.Length; i++) { + string project_xml = string.Format (@"<Project DefaultTargets='{0}' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Import Project='$(MSBuildToolsPath)\Microsoft.Common.targets' /> + <Target Name='Foo' /> + {1} +</Project>", defaultTargets [i], targets [i]); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = string.Format ("ProjectInstanceTest.MultipleDefaultTargets.{0}.proj", i); + var proj = new ProjectInstance (root); + Assert.AreEqual ("Foo", proj.DefaultTargets.FirstOrDefault (), "#1-" + i); + Assert.AreEqual (expected [i], proj.Build (), "#2-" + i); + } + } + + [Test] + public void DependsOnTargets () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Target Name='Bar' DependsOnTargets='Foo' /> + <Target Name='Foo'> + <Error Text='expected error' /> + </Target> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectInstanceTest.DependsOnTargets.proj"; + var proj = new ProjectInstance (root); + Assert.AreEqual (2, proj.Targets.Count, "#1"); + Assert.IsFalse (proj.Build ("Bar", new ILogger [0]), "#2"); + } + + [Test] + public void InputsAndOutputs () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <Target Name='Foo' Inputs='inputsandoutputstest.txt' Outputs='inputsandoutputstest.txt'> + <Error Text='error' /> + </Target> +</Project>"; + try { + if (!File.Exists ("inputsandoutputstest.txt")) + File.CreateText ("inputsandoutputstest.txt").Close (); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectTargetInstanceTest.InputsAndOutputs.proj"; + var proj = new ProjectInstance (root); + Assert.IsTrue (proj.Build (), "#1"); // if it does not skip Foo, it results in an error. + } finally { + if (File.Exists ("inputsandoutputstest.txt")) + File.Delete ("inputsandoutputstest.txt"); + } + } + } +} diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs new file mode 100644 index 0000000000..7654538a1a --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs @@ -0,0 +1,287 @@ +// +// ExpressionParserTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using NUnit.Framework; +using Microsoft.Build.Execution; +using Microsoft.Build.Exceptions; +using System.Collections.Generic; + +namespace MonoTests.Microsoft.Build.Internal +{ + [TestFixture] + public class ExpressionParserTest + { + string [] invalid_always = { + "$(Foo..Bar)", + "$([DateTime.Now])", // fullname required + "$([System.DateTime.Now])", // member cannot be invoked with '.' + }; + string [] invalid_as_boolean = { + "$", + "@", + "%", + "%-1", + "$(", + "%(", + "$)", + "%)", + "%24", + "()", + "{}", + "A", // must be evaluated as a boolean + "1", // ditto (no default conversion to bool) + "$ (foo) == ''", + "@ (foo) == ''", + "$(1)", + "$(Foo) == And", // reserved keyword 'and' + "$(Foo) == Or", // reserved keyword 'or' + "$(Foo) == $(Bar) == $(Baz)", // unexpected '==' + "$([System.DateTime]::Now)", // it is DateTime + "$([System.String]::Format('Tr'))$([System.String]::Format('ue'))", // only one expression is accepted + "$([System.String]::Format(null))", // causing ANE, wrapped by InvalidProjectFileException + "yep", + "nope", + "ONN", + "OFFF", + }; + string [] valid = { + "'%24' == 0", + "true", + "fAlSe", + "(false)", + "A==A", + "A ==A", + "A== A", + "A=='A'", + "A==\tA", + "\tA== A", + "$([System.String]::Format('True'))", + "$([System.String]::Format('True', null))", + "False And True == True And True", + "True or True or False", + "(True or True or False)", + "True and False", + "(True) and (False)", + "yes", + "nO", + "oN", + "oFf", + }; + string [] depends = { + // valid only if evaluated to boolean + "$(foo)", + "@(foo)", + }; + + [Test] + public void EvaluateAsBoolean () + { + foreach (var expr in invalid_always.Concat (invalid_as_boolean).Concat (valid)) { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Condition=""{0}"" Include='x' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (string.Format (project_xml, expr))); + var root = ProjectRootElement.Create (xml); + try { + new Project (root); + if (invalid_as_boolean.Contains (expr) || invalid_always.Contains (expr)) + Assert.Fail ("Parsing Condition '{0}' should fail", expr); + } catch (Exception ex) { + if (valid.Contains (expr)) + throw new Exception (string.Format ("failed to parse '{0}'", expr), ex); + else if (ex is InvalidProjectFileException) + continue; + throw new Exception (string.Format ("unexpected exception to parse '{0}'", expr), ex); + } + } + } + + [Test] + public void EvaluateAsString () + { + foreach (var expr in invalid_always.Concat (invalid_as_boolean).Concat (valid)) { + try { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include=""{0}"" /> + </ItemGroup> + </Project>"; + var xml = XmlReader.Create (new StringReader (string.Format (project_xml, expr))); + var root = ProjectRootElement.Create (xml); + // everything but 'invalid_always' should pass + new Project (root); + } catch (Exception ex) { + if (!invalid_always.Contains (expr)) + throw new Exception (string.Format ("failed to parse '{0}'", expr), ex); + } + } + } + + [Test] + public void EvaluatePropertyReferencesWithProperties () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Condition=""$(foo)"" Include='x' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var props = new Dictionary<string,string> (); + props ["foo"] = "true"; + new Project (root, props, null); + } + + [Test] + public void EvaluateItemReferences () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='false' /> + <!-- by the time Bar is evaluated, Foo is already evaluated and taken into consideration in expansion --> + <Bar Condition=""@(foo)"" Include='x' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + new Project (root); + } + + [Test] + public void EvaluateReferencesWithoutProperties () + { + foreach (var expr in depends) { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Condition=""{0}"" Include='x' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (string.Format (project_xml, expr))); + var root = ProjectRootElement.Create (xml); + try { + new Project (root); + Assert.Fail ("Parsing Condition '{0}' should fail", expr); + } catch (InvalidProjectFileException) { + continue; + } + } + } + + [Test] + public void SemicolonHandling () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <Foo Condition=""'A;B'=='A;B'"">'A;B'</Foo> + </PropertyGroup> + <ItemGroup> + <Bar Include='$(Foo)' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); // at this state property is parsed without error i.e. Condition evaluates fine. + var prop = proj.GetProperty ("Foo"); + Assert.AreEqual ("'A;B'", prop.EvaluatedValue, "#1"); + var items = proj.GetItems ("Bar"); + Assert.AreEqual ("'A", items.First ().EvaluatedInclude, "#2"); + Assert.AreEqual ("$(Foo)", items.First ().UnevaluatedInclude, "#3"); + Assert.AreEqual (2, items.Count, "#4"); + Assert.AreEqual ("B'", items.Last ().EvaluatedInclude, "#5"); + Assert.AreEqual ("$(Foo)", items.Last ().UnevaluatedInclude, "#6"); + Assert.IsTrue (items.First ().Xml == items.Last ().Xml, "#7"); + } + + // the same as above except that ItemGroup goes first (and yet evaluated the same). + [Test] + public void EvaluationOrderPropertiesPrecedesItems () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Bar Include='$(Foo)' /> + </ItemGroup> + <PropertyGroup> + <Foo Condition=""'A;B'=='A;B'"">'A;B'</Foo> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); // at this state property is parsed without error i.e. Condition evaluates fine. + var prop = proj.GetProperty ("Foo"); + Assert.AreEqual ("'A;B'", prop.EvaluatedValue, "#1"); + var items = proj.GetItems ("Bar"); + Assert.AreEqual ("'A", items.First ().EvaluatedInclude, "#2"); + Assert.AreEqual ("$(Foo)", items.First ().UnevaluatedInclude, "#3"); + Assert.AreEqual (2, items.Count, "#4"); + Assert.AreEqual ("B'", items.Last ().EvaluatedInclude, "#5"); + Assert.AreEqual ("$(Foo)", items.Last ().UnevaluatedInclude, "#6"); + Assert.IsTrue (items.First ().Xml == items.Last ().Xml, "#7"); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void PropertyReferencesItem () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Bar Include='True' /> + </ItemGroup> + <PropertyGroup> + <Foo Condition='@(Bar)'>X</Foo><!-- not allowed --> + </PropertyGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + new Project (root); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void SequentialPropertyReferenceNotAllowed () + { + string xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <A>x</A> + <B>y</B> + <C Condition=""$(A)$(B)==''"">z</C> + </PropertyGroup> +</Project>"; + var reader = XmlReader.Create (new StringReader (xml)); + var root = ProjectRootElement.Create (reader); + new Project (root); + } + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Logging/ConsoleLoggerTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Logging/ConsoleLoggerTest.cs new file mode 100644 index 0000000000..0135393d9e --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Logging/ConsoleLoggerTest.cs @@ -0,0 +1,102 @@ +// +// ConsoleLoggerTest.cs +// +// Author: +// Atsushi Enomoto (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.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. +// + +using System; +using System.IO; +using Microsoft.Build.Framework; +using Microsoft.Build.Logging; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Logging +{ + [TestFixture] + public class ConsoleLoggerTest + { + // Unfortunately, the existing code in MS.Build.Engine.dll has slightly different + // format. We'd rather use already complete implementation, just disabled this test. + [Test] + [Category ("NotWorking")] + public void BasicLoggerUsage () + { + string expected = @"file : cat error code: msg + +file : cat warning code: msg + +__________________________________________________ + +Project ""project.txt"" (target target(s)): + + + +Build started 2013/01/01 00:00:00. + +Target ""target"" in file ""target.txt"": + + start task + + finished task + +finished target + + + +finished project + + + +finished build + + + +Time Elapsed 00:00:00.01 + +".Replace ("\r\n", "\n"); + var sw = new StringWriter(); + var e = new ConsoleLogger(LoggerVerbosity.Diagnostic, msg => sw.WriteLine(msg), c => {}, () => {}); + e.Verbosity = LoggerVerbosity.Diagnostic; + e.ErrorHandler (null, new BuildErrorEventArgs ("cat", "code", "file", 0, 0, 0, 0, "msg", "help", "sender")); + e.WarningHandler (null, new BuildWarningEventArgs ("cat", "code", "file", 0, 0, 0, 0, "msg", "help", "sender")); + e.ProjectStartedHandler (null, new ProjectStartedEventArgs ("start project", "HELPME", "project.txt", "target", null, null)); + e.BuildStartedHandler (null, new BuildStartedEventArgs ("start build", "HELPME", new DateTime (2013, 1, 1))); + e.TargetStartedHandler (null, new TargetStartedEventArgs ("start target", "HELPME", "target", "project.txt", "target.txt"/*, "parent"*/)); + e.TaskStartedHandler (null, new TaskStartedEventArgs ("start task", "HELPME", "project.txt", "task.txt", "task")); + e.TaskFinishedHandler (null, new TaskFinishedEventArgs ("finished task", "HELPME", "project.txt", "task.txt", "task", false)); + e.TargetFinishedHandler (null, new TargetFinishedEventArgs ("finished target", "HELPME", "target", "project.txt", "target.txt", false)); + e.ProjectFinishedHandler (null, new ProjectFinishedEventArgs ("finished project", "HELPME", "project.txt", false)); + e.BuildFinishedHandler (null, new BuildFinishedEventArgs ("finished build", "HELPME", false, new DateTime (2013, 1, 1).AddMilliseconds (1))); + + e.CustomEventHandler(null, new MyCustomBuildEventArgs ()); + Assert.AreEqual (expected, sw.ToString ().Replace ("\r\n", "\n"), "#1"); + } + } + + class MyCustomBuildEventArgs : CustomBuildEventArgs + { + } +} + diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Logging/LoggerDescriptionTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Logging/LoggerDescriptionTest.cs new file mode 100644 index 0000000000..e062fc93b4 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Logging/LoggerDescriptionTest.cs @@ -0,0 +1,49 @@ +// +// LoggerDescriptionTest.cs +// +// Author: +// Atsushi Eno (atsushi@xamarin.com) +// +// Copyright (C) 2013 Xamarin Inc. +// +// 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. +// +using System; +using Microsoft.Build.Logging; +using Microsoft.Build.Framework; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Logging +{ + [TestFixture] + public class LoggerDescriptionTest + { + [Test] + public void CreateLogger () + { + new LoggerDescription ("Microsoft.Build.Logging.ConsoleLogger", + typeof (ConsoleLogger).Assembly.FullName, + null, + null, + LoggerVerbosity.Normal) + .CreateLogger(); + } + } +} diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs index 9732b655d2..feb4294647 100644 --- a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs +++ b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs @@ -130,6 +130,22 @@ namespace MonoTests.EvaluatorTest Assert.AreEqual ("1+", sres, "The result should have been the input string, since we have a partial input"); } + [Test] + public void GotoWithUnreachableStatement () + { + Evaluator.Run ("using System;"); + + string code = "var x = new Action(() => {" + + "Console.WriteLine(\"beforeGoto\");" + + "goto L;" + + "L:" + + "Console.WriteLine(\"afterGoto\");" + + "});"; + + Assert.IsTrue (Evaluator.Run (code), "#1"); + Assert.IsTrue (Evaluator.Run ("x();"), "#2"); + } + #if NET_4_0 [Test] public void DynamicStatement () diff --git a/mcs/class/Mono.Data.Sqlite/Assembly/AssemblyInfo.cs b/mcs/class/Mono.Data.Sqlite/Assembly/AssemblyInfo.cs index be60f05084..19b444ebd3 100644 --- a/mcs/class/Mono.Data.Sqlite/Assembly/AssemblyInfo.cs +++ b/mcs/class/Mono.Data.Sqlite/Assembly/AssemblyInfo.cs @@ -35,6 +35,11 @@ using System.Runtime.ConstrainedExecution; #if !PLATFORM_COMPACTFRAMEWORK [assembly: AllowPartiallyTrustedCallers] [assembly: ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + #if NET_4_0 + [assembly: SecurityRules(SecurityRuleSet.Level1)] + #else + [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] + #endif #endif // Version information for an assembly consists of the following four values: diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index 105ff4fb67..13096f0594 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -93,6 +93,7 @@ namespace Mono.Debugger.Soft public long catch_type_id; } + [Flags] enum ExceptionClauseFlags { None = 0x0, Filter = 0x1, @@ -149,6 +150,7 @@ namespace Mono.Debugger.Soft VALUE_TYPE_ID_TYPE = 0xf1 } + [Flags] enum InvokeFlags { NONE = 0x0, DISABLE_BREAKPOINTS = 0x1, @@ -220,6 +222,7 @@ namespace Mono.Debugger.Soft UNKNOWN = 4 } + [Flags] enum StackFrameFlags { NONE = 0, DEBUGGER_INVOKE = 1, @@ -285,6 +288,9 @@ namespace Mono.Debugger.Soft public bool Uncaught { get; set; } + public bool Subclasses { + get; set; + } } class AssemblyModifier : Modifier { @@ -342,6 +348,10 @@ namespace Mono.Debugger.Soft get; set; } + public int ExitCode { + get; set; + } + public EventInfo (EventType type, int req_id) { EventType = type; ReqId = req_id; @@ -395,7 +405,7 @@ namespace Mono.Debugger.Soft * with newer runtimes, and vice versa. */ internal const int MAJOR_VERSION = 2; - internal const int MINOR_VERSION = 24; + internal const int MINOR_VERSION = 27; enum WPSuspendPolicy { NONE = 0, @@ -546,6 +556,7 @@ namespace Mono.Debugger.Soft IS_INITIALIZED = 18 } + [Flags] enum BindingFlagsExtensions { BINDING_FLAGS_IGNORE_CASE = 0x70000000, } @@ -1218,82 +1229,71 @@ namespace Mono.Debugger.Soft EventType etype = (EventType)kind; + long thread_id = r.ReadId (); if (kind == EventKind.VM_START) { - long thread_id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id }; //EventHandler.VMStart (req_id, thread_id, null); } else if (kind == EventKind.VM_DEATH) { + int exit_code = 0; + if (Version.AtLeast (2, 27)) + exit_code = r.ReadInt (); //EventHandler.VMDeath (req_id, 0, null); - events [i] = new EventInfo (etype, req_id) { }; + events [i] = new EventInfo (etype, req_id) { ExitCode = exit_code }; } else if (kind == EventKind.THREAD_START) { - long thread_id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = thread_id }; //EventHandler.ThreadStart (req_id, thread_id, thread_id); } else if (kind == EventKind.THREAD_DEATH) { - long thread_id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = thread_id }; //EventHandler.ThreadDeath (req_id, thread_id, thread_id); } else if (kind == EventKind.ASSEMBLY_LOAD) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.AssemblyLoad (req_id, thread_id, id); } else if (kind == EventKind.ASSEMBLY_UNLOAD) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.AssemblyUnload (req_id, thread_id, id); } else if (kind == EventKind.TYPE_LOAD) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.TypeLoad (req_id, thread_id, id); } else if (kind == EventKind.METHOD_ENTRY) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.MethodEntry (req_id, thread_id, id); } else if (kind == EventKind.METHOD_EXIT) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.MethodExit (req_id, thread_id, id); } else if (kind == EventKind.BREAKPOINT) { - long thread_id = r.ReadId (); long id = r.ReadId (); long loc = r.ReadLong (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc }; //EventHandler.Breakpoint (req_id, thread_id, id, loc); } else if (kind == EventKind.STEP) { - long thread_id = r.ReadId (); long id = r.ReadId (); long loc = r.ReadLong (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc }; //EventHandler.Step (req_id, thread_id, id, loc); } else if (kind == EventKind.EXCEPTION) { - long thread_id = r.ReadId (); long id = r.ReadId (); long loc = 0; // FIXME events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc }; //EventHandler.Exception (req_id, thread_id, id, loc); } else if (kind == EventKind.APPDOMAIN_CREATE) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.AppDomainCreate (req_id, thread_id, id); } else if (kind == EventKind.APPDOMAIN_UNLOAD) { - long thread_id = r.ReadId (); long id = r.ReadId (); events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id }; //EventHandler.AppDomainUnload (req_id, thread_id, id); } else if (kind == EventKind.USER_BREAK) { - long thread_id = r.ReadId (); long id = 0; long loc = 0; events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc }; //EventHandler.Exception (req_id, thread_id, id, loc); } else if (kind == EventKind.USER_LOG) { - long thread_id = r.ReadId (); int level = r.ReadInt (); string category = r.ReadString (); string message = r.ReadString (); @@ -2174,6 +2174,11 @@ namespace Mono.Debugger.Soft } else if (!em.Caught || !em.Uncaught) { throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee."); } + if (Version.MajorVersion > 2 || Version.MinorVersion > 24) { + w.WriteBool (em.Subclasses); + } else if (!em.Subclasses) { + throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee."); + } } else if (mod is AssemblyModifier) { w.WriteByte ((byte)ModifierKind.ASSEMBLY_ONLY); var amod = (mod as AssemblyModifier); diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ExceptionEventRequest.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ExceptionEventRequest.cs index 07d4d8ccdd..906b43fd83 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ExceptionEventRequest.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ExceptionEventRequest.cs @@ -6,7 +6,7 @@ namespace Mono.Debugger.Soft public sealed class ExceptionEventRequest : EventRequest { TypeMirror exc_type; - bool caught, uncaught; + bool caught, uncaught, subclasses; internal ExceptionEventRequest (VirtualMachine vm, TypeMirror exc_type, bool caught, bool uncaught) : base (vm, EventType.Exception) { if (exc_type != null) { @@ -18,6 +18,7 @@ namespace Mono.Debugger.Soft this.exc_type = exc_type; this.caught = caught; this.uncaught = uncaught; + this.subclasses = true; } public TypeMirror ExceptionType { @@ -26,9 +27,21 @@ namespace Mono.Debugger.Soft } } + // Defaults to true + // Supported since protocol version 2.25 + public bool IncludeSubclasses { + get { + return subclasses; + } + set { + vm.CheckProtocolVersion (2, 25); + subclasses = value; + } + } + public override void Enable () { var mods = new List <Modifier> (); - mods.Add (new ExceptionModifier () { Type = exc_type != null ? exc_type.Id : 0, Caught = caught, Uncaught = uncaught }); + mods.Add (new ExceptionModifier () { Type = exc_type != null ? exc_type.Id : 0, Caught = caught, Uncaught = uncaught, Subclasses = subclasses }); SendReq (mods); } } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs index 18611ba327..8a060a2df9 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs @@ -2,6 +2,9 @@ using System; using System.Collections.Generic; using System.Runtime.Remoting.Messaging; using System.Threading; +#if NET_4_5 +using System.Threading.Tasks; +#endif namespace Mono.Debugger.Soft { @@ -144,6 +147,23 @@ namespace Mono.Debugger.Soft return EndInvokeMethodInternal (asyncResult); } +#if NET_4_5 + public Task<Value> InvokeMethodAsync (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options = InvokeOptions.None) { + var tcs = new TaskCompletionSource<Value> (); + BeginInvokeMethod (thread, method, arguments, options, iar => + { + try { + tcs.SetResult (EndInvokeMethod (iar)); + } catch (OperationCanceledException) { + tcs.TrySetCanceled (); + } catch (Exception ex) { + tcs.TrySetException (ex); + } + }, null); + return tcs.Task; + } +#endif + // // Invoke the members of METHODS one-by-one, calling CALLBACK after each invoke was finished. The IAsyncResult will be marked as completed after all invokes have // finished. The callback will be called with a different IAsyncResult that represents one method invocation. diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StepEventRequest.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StepEventRequest.cs index cb3c79231b..035fbcee56 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StepEventRequest.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StepEventRequest.cs @@ -23,7 +23,11 @@ namespace Mono.Debugger.Soft StaticCtor = 1, /* Since protocol version 2.20 */ /* Methods which have the [DebuggerHidden] attribute */ + /* Before protocol version 2.26, this includes [DebuggerStepThrough] as well */ DebuggerHidden = 2, + /* Since protocol version 2.26 */ + /* Methods which have the [DebuggerStepThrough] attribute */ + DebuggerStepThrough = 4, } public sealed class StepEventRequest : EventRequest { diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs index 1db6037972..7307b0ea89 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs @@ -41,6 +41,20 @@ namespace Mono.Debugger.Soft } throw new ArgumentException ("Unknown struct field '" + field + "'.", "field"); } + set { + FieldInfoMirror[] field_info = Type.GetFields (); + int nf = 0; + for (int i = 0; i < field_info.Length; ++i) { + if (!field_info [i].IsStatic) { + if (field_info [i].Name == field) { + fields [nf] = value; + return; + } + nf++; + } + } + throw new ArgumentException ("Unknown struct field '" + field + "'.", "field"); + } } internal void SetField (int index, Value value) { diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs index 3cd1edeadf..e7baa44fae 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs @@ -3,6 +3,9 @@ using System.Collections.Generic; using System.Reflection; using C = Mono.Cecil; using Mono.Cecil.Metadata; +#if NET_4_5 +using System.Threading.Tasks; +#endif namespace Mono.Debugger.Soft { @@ -26,6 +29,7 @@ namespace Mono.Debugger.Soft TypeMirror[] ifaces; Dictionary<TypeMirror, InterfaceMappingMirror> iface_map; TypeMirror[] type_args; + bool cached_base_type; bool inited; internal const BindingFlags DefaultBindingFlags = @@ -78,9 +82,9 @@ namespace Mono.Debugger.Soft public TypeMirror BaseType { get { - // FIXME: base_type could be null for object/interfaces - if (base_type == null) { + if (!cached_base_type) { base_type = vm.GetType (GetInfo ().base_type); + cached_base_type = true; } return base_type; } @@ -591,11 +595,11 @@ namespace Mono.Debugger.Soft string[] source_files; string[] source_files_full_path; - public string[] GetSourceFiles (bool return_full_paths) { - string[] res = return_full_paths ? source_files_full_path : source_files; + public string[] GetSourceFiles (bool returnFullPaths) { + string[] res = returnFullPaths ? source_files_full_path : source_files; if (res == null) { - res = vm.conn.Type_GetSourceFiles (id, return_full_paths); - if (return_full_paths) + res = vm.conn.Type_GetSourceFiles (id, returnFullPaths); + if (returnFullPaths) source_files_full_path = res; else source_files = res; @@ -684,29 +688,38 @@ namespace Mono.Debugger.Soft * used by the reflection-only functionality on .net. */ public CustomAttributeDataMirror[] GetCustomAttributes (bool inherit) { - return GetCAttrs (null, inherit); + return GetCustomAttrs (null, inherit); } public CustomAttributeDataMirror[] GetCustomAttributes (TypeMirror attributeType, bool inherit) { if (attributeType == null) throw new ArgumentNullException ("attributeType"); - return GetCAttrs (attributeType, inherit); + return GetCustomAttrs (attributeType, inherit); } - CustomAttributeDataMirror[] GetCAttrs (TypeMirror type, bool inherit) { + void AppendCustomAttrs (IList<CustomAttributeDataMirror> attrs, TypeMirror type, bool inherit) + { if (cattrs == null && Metadata != null && !Metadata.HasCustomAttributes) cattrs = new CustomAttributeDataMirror [0]; - // FIXME: Handle inherit if (cattrs == null) { CattrInfo[] info = vm.conn.Type_GetCustomAttributes (id, 0, false); cattrs = CustomAttributeDataMirror.Create (vm, info); } - var res = new List<CustomAttributeDataMirror> (); - foreach (var attr in cattrs) + + foreach (var attr in cattrs) { if (type == null || attr.Constructor.DeclaringType == type) - res.Add (attr); - return res.ToArray (); + attrs.Add (attr); + } + + if (inherit && BaseType != null) + BaseType.AppendCustomAttrs (attrs, type, inherit); + } + + CustomAttributeDataMirror[] GetCustomAttrs (TypeMirror type, bool inherit) { + var attrs = new List<CustomAttributeDataMirror> (); + AppendCustomAttrs (attrs, type, inherit); + return attrs.ToArray (); } public MethodMirror[] GetMethodsByNameFlags (string name, BindingFlags flags, bool ignoreCase) { @@ -785,6 +798,23 @@ namespace Mono.Debugger.Soft return ObjectMirror.EndInvokeMethodInternal (asyncResult); } +#if NET_4_5 + public Task<Value> InvokeMethodAsync (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options = InvokeOptions.None) { + var tcs = new TaskCompletionSource<Value> (); + BeginInvokeMethod (thread, method, arguments, options, iar => + { + try { + tcs.SetResult (EndInvokeMethod (iar)); + } catch (OperationCanceledException) { + tcs.TrySetCanceled (); + } catch (Exception ex) { + tcs.TrySetException (ex); + } + }, null); + return tcs.Task; + } +#endif + public Value NewInstance (ThreadMirror thread, MethodMirror method, IList<Value> arguments) { return ObjectMirror.InvokeMethod (vm, thread, method, null, arguments, InvokeOptions.None); } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VMDeathEvent.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VMDeathEvent.cs index 18eeb92ca7..40e60ad091 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VMDeathEvent.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VMDeathEvent.cs @@ -4,7 +4,18 @@ namespace Mono.Debugger.Soft { public class VMDeathEvent : Event { - public VMDeathEvent (VirtualMachine vm, int req_id) : base (EventType.VMDeath, vm, req_id, -1) { + int exit_code; + + public VMDeathEvent (VirtualMachine vm, int req_id, int exit_code) : base (EventType.VMDeath, vm, req_id, -1) { + this.exit_code = exit_code; + } + + // Since protocol version 2.27 + public int ExitCode { + get { + vm.CheckProtocolVersion (2, 27); + return exit_code; + } } } } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs index b77458b441..cb2cafdb71 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs @@ -137,7 +137,7 @@ namespace Mono.Debugger.Soft public void Detach () { conn.VM_Dispose (); conn.Close (); - notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null); + notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null, 0); } [Obsolete ("This method was poorly named; use the Detach() method instead")] @@ -227,10 +227,14 @@ namespace Mono.Debugger.Soft } public void EnableEvents (params EventType[] events) { + EnableEvents (events, SuspendPolicy.All); + } + + public void EnableEvents (EventType[] events, SuspendPolicy suspendPolicy) { foreach (EventType etype in events) { if (etype == EventType.Breakpoint) throw new ArgumentException ("Breakpoint events cannot be requested using EnableEvents", "events"); - conn.EnableEvent (etype, SuspendPolicy.All, null); + conn.EnableEvent (etype, suspendPolicy, null); } } @@ -315,7 +319,7 @@ namespace Mono.Debugger.Soft root_domain = GetDomain (root_domain_id); } - internal void notify_vm_event (EventType evtype, SuspendPolicy spolicy, int req_id, long thread_id, string vm_uri) { + internal void notify_vm_event (EventType evtype, SuspendPolicy spolicy, int req_id, long thread_id, string vm_uri, int exit_code) { //Console.WriteLine ("Event: " + evtype + "(" + vm_uri + ")"); switch (evtype) { @@ -327,7 +331,7 @@ namespace Mono.Debugger.Soft queue_event_set (new EventSet (this, spolicy, new Event[] { new VMStartEvent (vm, req_id, thread_id) })); break; case EventType.VMDeath: - queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDeathEvent (vm, req_id) })); + queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDeathEvent (vm, req_id, exit_code) })); break; case EventType.VMDisconnect: queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDisconnectEvent (vm, req_id) })); @@ -620,10 +624,10 @@ namespace Mono.Debugger.Soft switch (ei.EventType) { case EventType.VMStart: - vm.notify_vm_event (EventType.VMStart, suspend_policy, req_id, thread_id, null); + vm.notify_vm_event (EventType.VMStart, suspend_policy, req_id, thread_id, null, 0); break; case EventType.VMDeath: - vm.notify_vm_event (EventType.VMDeath, suspend_policy, req_id, thread_id, null); + vm.notify_vm_event (EventType.VMDeath, suspend_policy, req_id, thread_id, null, ei.ExitCode); break; case EventType.ThreadStart: l.Add (new ThreadStartEvent (vm, req_id, id)); @@ -677,7 +681,7 @@ namespace Mono.Debugger.Soft } public void VMDisconnect (int req_id, long thread_id, string vm_uri) { - vm.notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, req_id, thread_id, vm_uri); + vm.notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, req_id, thread_id, vm_uri, 0); } } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs index a5bdf4fc39..211a0df302 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs @@ -93,7 +93,8 @@ namespace Mono.Debugger.Soft if (options != null && options.Valgrind) info.FileName = "valgrind"; - + info.UseShellExecute = false; + ITargetProcess p; if (options != null && options.CustomProcessLauncher != null) p = new ProcessWrapper (options.CustomProcessLauncher (info)); diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs index 7cf688c0d2..e1d912ec4e 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -132,6 +132,13 @@ public struct GStruct<T> { } } +public struct NestedStruct { + NestedInner nested1, nested2; +} + +public struct NestedInner { +} + interface ITest { void Foo (); @@ -202,6 +209,7 @@ public class Tests : TestsBase, ITest2 [ThreadStatic] public static int tls_i; public static bool is_attached = Debugger.IsAttached; + public NestedStruct nested_struct; #pragma warning restore 0414 @@ -349,7 +357,10 @@ public class Tests : TestsBase, ITest2 } catch { } ss7 (); + ss_nested (); ss_regress_654694 (); + ss_step_through (); + ss_recursive (1); } [MethodImplAttribute (MethodImplOptions.NoInlining)] @@ -424,6 +435,57 @@ public class Tests : TestsBase, ITest2 } [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss_nested () { + ss_nested_1 (ss_nested_2 ()); + ss_nested_1 (ss_nested_2 ()); + ss_nested_3 (); + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss_nested_1 (int i) { + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static int ss_nested_2 () { + return 0; + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss_nested_3 () { + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss_step_through () { + step_through_1 (); + StepThroughClass.step_through_2 (); + step_through_3 (); + } + + [DebuggerStepThrough] + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void step_through_1 () { + } + + [DebuggerStepThrough] + class StepThroughClass { + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void step_through_2 () { + } + } + + [DebuggerStepThrough] + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void step_through_3 () { + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss_recursive (int n) { + if (n == 10) + return; + ss_recursive (n + 1); + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] public static bool is_even (int i) { return i % 2 == 0; } @@ -535,8 +597,9 @@ public class Tests : TestsBase, ITest2 [MethodImplAttribute (MethodImplOptions.NoInlining)] public static void locals () { string s = null; + var astruct = new AStruct () { i = 42 }; locals1 (null); - locals2<string> (null, 5, "ABC", ref s); + locals2<string> (null, 5, "ABC", ref s, ref astruct); locals3 (); locals6 (); locals7<int> (22); @@ -562,7 +625,7 @@ public class Tests : TestsBase, ITest2 #if NET_4_5 [StateMachine (typeof (int))] #endif - public static void locals2<T> (string[] args, int arg, T t, ref string rs) { + public static void locals2<T> (string[] args, int arg, T t, ref string rs, ref AStruct astruct) { long i = 42; string s = "AB"; @@ -571,6 +634,7 @@ public class Tests : TestsBase, ITest2 i ++; if (t != null) i ++; + astruct = new AStruct (); } rs = "A"; } @@ -840,6 +904,15 @@ public class Tests : TestsBase, ITest2 throw new OverflowException (); } catch (Exception) { } + // no subclasses + try { + throw new OverflowException (); + } catch (Exception) { + } + try { + throw new Exception (); + } catch (Exception) { + } object o = null; try { diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index c8302274db..cc13107513 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -105,7 +105,7 @@ public class DebuggerTests MethodMirror m = entry_point.DeclaringType.GetMethod (name); Assert.IsNotNull (m); //Console.WriteLine ("X: " + name + " " + m.ILOffsets.Count + " " + m.Locations.Count); - vm.SetBreakpoint (m, m.ILOffsets [0]); + var req = vm.SetBreakpoint (m, m.ILOffsets [0]); Event e = null; @@ -116,6 +116,8 @@ public class DebuggerTests break; } + req.Disable (); + Assert.IsInstanceOfType (typeof (BreakpointEvent), e); Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name); @@ -375,15 +377,19 @@ public class DebuggerTests Assert.AreEqual (method, (e as StepEvent).Method.Name); } + StepEventRequest create_step (Event e) { + var req = vm.CreateStepRequest (e.Thread); + step_req = req; + return req; + } + [Test] public void SingleStepping () { Event e = run_until ("single_stepping"); - var req = vm.CreateStepRequest (e.Thread); + var req = create_step (e); req.Enable (); - step_req = req; - // Step over 'bool b = true' e = step_once (); assert_location (e, "single_stepping"); @@ -402,49 +408,24 @@ public class DebuggerTests e = step_once (); assert_location (e, "single_stepping"); - // Change to step over - req.Disable (); - req.Depth = StepDepth.Over; - req.Enable (); - // Step over ss2 - e = step_once (); + e = step_over (); assert_location (e, "single_stepping"); - // Change to step into - req.Disable (); - req.Depth = StepDepth.Into; - req.Enable (); - // Step into ss3 - e = step_once (); + e = step_into (); assert_location (e, "ss3"); - // Change to step out - req.Disable (); - req.Depth = StepDepth.Out; - req.Enable (); - // Step back into single_stepping - e = step_once (); + e = step_out (); assert_location (e, "single_stepping"); - // Change to step into - req.Disable (); - req.Depth = StepDepth.Into; - req.Enable (); - // Step into ss3_2 () - e = step_once (); + e = step_into (); assert_location (e, "ss3_2"); - // Change to step over - req.Disable (); - req.Depth = StepDepth.Over; - req.Enable (); - // Step over ss3_2_2 () - e = step_once (); + e = step_over (); assert_location (e, "ss3_2"); // Recreate the request @@ -458,13 +439,8 @@ public class DebuggerTests e = step_once (); assert_location (e, "single_stepping"); - // Change to step into - req.Disable (); - req.Depth = StepDepth.Into; - req.Enable (); - // Step into ss4 () - e = step_once (); + e = step_into (); assert_location (e, "ss4"); // Skip nop @@ -504,13 +480,12 @@ public class DebuggerTests assert_location (e, "is_even"); // FIXME: Check that single stepping works with lock (obj) - req.Disable (); // Run until ss6 e = run_until ("ss6"); - req = vm.CreateStepRequest (e.Thread); + req = create_step (e); req.Depth = StepDepth.Over; req.Enable (); @@ -522,18 +497,62 @@ public class DebuggerTests // Check that a step over stops at an EH clause e = run_until ("ss7_2"); - req = vm.CreateStepRequest (e.Thread); + req = create_step (e); req.Depth = StepDepth.Out; req.Enable (); e = step_once (); assert_location (e, "ss7"); req.Disable (); - req = vm.CreateStepRequest (e.Thread); + req = create_step (e); req.Depth = StepDepth.Over; req.Enable (); e = step_once (); assert_location (e, "ss7"); req.Disable (); + + // Check that stepping stops between nested calls + e = run_until ("ss_nested_2"); + e = step_out (); + assert_location (e, "ss_nested"); + e = step_into (); + assert_location (e, "ss_nested_1"); + e = step_out (); + assert_location (e, "ss_nested"); + // Check that step over steps over nested calls + e = step_over (); + assert_location (e, "ss_nested"); + e = step_into (); + assert_location (e, "ss_nested_3"); + req.Disable (); + + // Check DebuggerStepThrough support + e = run_until ("ss_step_through"); + req = create_step (e); + req.Filter = StepFilter.DebuggerStepThrough; + e = step_into (); + // Step through step_through_1 () + e = step_into (); + assert_location (e, "ss_step_through"); + // Step through StepThroughClass.step_through_2 () + e = step_into (); + assert_location (e, "ss_step_through"); + req.Disable (); + req.Filter = StepFilter.None; + e = step_into (); + assert_location (e, "step_through_3"); + req.Disable (); + + // Check that step-over doesn't stop at inner frames with recursive functions + e = run_until ("ss_recursive"); + req = create_step (e); + e = step_over (); + e = step_over (); + e = step_over (); + var f = e.Thread.GetFrames () [0]; + assert_location (e, "ss_recursive"); + AssertValue (1, f.GetValue (f.Method.GetLocal ("n"))); + + req.Disable (); } [Test] @@ -1113,7 +1132,7 @@ public class DebuggerTests t = frame.Method.GetParameters ()[8].ParameterType; Assert.AreEqual ("Tests2", t.Name); var attrs = t.GetCustomAttributes (true); - Assert.AreEqual (3, attrs.Length); + Assert.AreEqual (5, attrs.Length); foreach (var attr in attrs) { if (attr.Constructor.DeclaringType.Name == "DebuggerDisplayAttribute") { Assert.AreEqual (1, attr.ConstructorArguments.Count); @@ -1132,6 +1151,12 @@ public class DebuggerTests Assert.AreEqual (2, attr.NamedArguments.Count); Assert.AreEqual ("afield", attr.NamedArguments [0].Field.Name); Assert.AreEqual ("bfield", attr.NamedArguments [1].Field.Name); + } else if (attr.Constructor.DeclaringType.Name == "ClassInterfaceAttribute") { + // inherited from System.Object + //} else if (attr.Constructor.DeclaringType.Name == "Serializable") { + // inherited from System.Object + } else if (attr.Constructor.DeclaringType.Name == "ComVisibleAttribute") { + // inherited from System.Object } else { Assert.Fail (attr.Constructor.DeclaringType.Name); } @@ -1335,6 +1360,10 @@ public class DebuggerTests Assert.AreEqual ("AStruct", s.Type.Name); AssertValue (42, s ["i"]); + // Check decoding of nested structs (#14942) + obj = o.GetValue (o.Type.GetField ("nested_struct")); + o.SetValue (o.Type.GetField ("nested_struct"), obj); + // Check round tripping of boxed struct fields (#12354) obj = o.GetValue (o.Type.GetField ("boxed_struct_field")); o.SetValue (o.Type.GetField ("boxed_struct_field"), obj); @@ -1438,8 +1467,8 @@ public class DebuggerTests StackFrame frame = e.Thread.GetFrames () [0]; var locals = frame.Method.GetLocals (); - Assert.AreEqual (7, locals.Length); - for (int i = 0; i < 7; ++i) { + Assert.AreEqual (8, locals.Length); + for (int i = 0; i < 8; ++i) { if (locals [i].Name == "args") { Assert.IsTrue (locals [i].IsArg); Assert.AreEqual ("String[]", locals [i].Type.Name); @@ -1462,6 +1491,7 @@ public class DebuggerTests } else if (locals [i].Name == "rs") { Assert.IsTrue (locals [i].IsArg); Assert.AreEqual ("String", locals [i].Type.Name); + } else if (locals [i].Name == "astruct") { } else { Assert.Fail (); } @@ -1475,6 +1505,27 @@ public class DebuggerTests return e; } + Event step_into () { + step_req.Disable (); + step_req.Depth = StepDepth.Into; + step_req.Enable (); + return step_once (); + } + + Event step_over () { + step_req.Disable (); + step_req.Depth = StepDepth.Over; + step_req.Enable (); + return step_once (); + } + + Event step_out () { + step_req.Disable (); + step_req.Depth = StepDepth.Out; + step_req.Enable (); + return step_once (); + } + [Test] public void Locals () { var be = run_until ("locals1"); @@ -1496,9 +1547,8 @@ public class DebuggerTests object val = frame.GetValue (frame.Method.GetLocal ("i")); AssertValue (0, val); - var req = vm.CreateStepRequest (be.Thread); + var req = create_step (be); req.Enable (); - step_req = req; // Skip nop step_once (); @@ -1580,9 +1630,8 @@ public class DebuggerTests // gsharedvt be = run_until ("locals7"); - req = vm.CreateStepRequest (be.Thread); + req = create_step (be); req.Enable (); - step_req = req; // Skip nop e = step_once (); @@ -1653,6 +1702,8 @@ public class DebuggerTests var e = GetNextEvent (); Assert.IsInstanceOfType (typeof (VMDeathEvent), e); + Assert.AreEqual (5, (e as VMDeathEvent).ExitCode); + var p = vm.Process; /* Could be a remote vm with no process */ if (p != null) { @@ -1698,7 +1749,7 @@ public class DebuggerTests // FIXME: Merge this with LineNumbers () when its fixed - step_req = vm.CreateStepRequest (e.Thread); + step_req = create_step (e); step_req.Depth = StepDepth.Into; step_req.Enable (); @@ -1734,7 +1785,7 @@ public class DebuggerTests public void LineNumbers () { Event e = run_until ("line_numbers"); - step_req = vm.CreateStepRequest (e.Thread); + step_req = create_step (e); step_req.Depth = StepDepth.Into; step_req.Enable (); @@ -2035,6 +2086,18 @@ public class DebuggerTests v = this_obj.InvokeMethod (e.Thread, m, null); AssertValue (42, v); +#if NET_4_5 + // instance + m = t.GetMethod ("invoke_pass_ref"); + var task = this_obj.InvokeMethodAsync (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") }); + AssertValue ("ABC", task.Result); + + // static + m = t.GetMethod ("invoke_static_pass_ref"); + task = t.InvokeMethodAsync (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") }); + AssertValue ("ABC", task.Result); +#endif + // Argument checking // null thread @@ -2258,8 +2321,13 @@ public class DebuggerTests while (invoke_results.Count < 2) { Thread.Sleep (100); } - AssertValue ("ABC", invoke_results [0]); - AssertValue (42, invoke_results [1]); + if (invoke_results [0] is PrimitiveValue) { + AssertValue ("ABC", invoke_results [1]); + AssertValue (42, invoke_results [0]); + } else { + AssertValue ("ABC", invoke_results [0]); + AssertValue (42, invoke_results [1]); + } } void invoke_multiple_cb (IAsyncResult ar) { @@ -2337,6 +2405,14 @@ public class DebuggerTests frame.SetValue (p, vm.RootDomain.CreateString ("DEF2")); AssertValue ("DEF2", frame.GetValue (p)); + // byref struct + p = frame.Method.GetParameters ()[4]; + var v = frame.GetValue (p) as StructMirror; + v ["i"] = vm.CreateValue (43); + frame.SetValue (p, v); + v = frame.GetValue (p) as StructMirror; + AssertValue (43, v ["i"]); + // argument checking // variable null @@ -2426,13 +2502,11 @@ public class DebuggerTests Assert.IsNull (v); // Try a single step after the invoke - var req = vm.CreateStepRequest (e.Thread); + var req = create_step (e); req.Depth = StepDepth.Into; req.Size = StepSize.Line; req.Enable (); - step_req = req; - // Skip nop step_once (); @@ -2487,6 +2561,17 @@ public class DebuggerTests Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name); req.Disable (); + // no subclasses + req.IncludeSubclasses = false; + req.Enable (); + + vm.Resume (); + + e = GetNextEvent (); + Assert.IsInstanceOfType (typeof (ExceptionEvent), e); + Assert.AreEqual ("Exception", (e as ExceptionEvent).Exception.Type.Name); + req.Disable (); + // Implicit exceptions req = vm.CreateExceptionRequest (null); req.Enable (); @@ -2511,7 +2596,7 @@ public class DebuggerTests Assert.AreEqual ("exceptions2", frames [0].Method.Name); req.Disable (); - var sreq = vm.CreateStepRequest (e.Thread); + var sreq = create_step (e); sreq.Depth = StepDepth.Over; sreq.Size = StepSize.Line; sreq.Enable (); @@ -2915,7 +3000,7 @@ public class DebuggerTests e = GetNextEvent (); Assert.IsTrue (e is BreakpointEvent); - var req = vm.CreateStepRequest (e.Thread); + var req = create_step (e); req.Depth = StepDepth.Over; req.Size = StepSize.Line; req.Enable (); diff --git a/mcs/class/Mono.Dynamic.Interpreter/Assembly/AssemblyInfo.cs b/mcs/class/Mono.Dynamic.Interpreter/Assembly/AssemblyInfo.cs new file mode 100644 index 0000000000..9613d894e8 --- /dev/null +++ b/mcs/class/Mono.Dynamic.Interpreter/Assembly/AssemblyInfo.cs @@ -0,0 +1,53 @@ +// +// AssemblyInfo.cs +// +// Authors: +// Marek Safar (marek.safar@gmail.com) +// +// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.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. +// + +using System; +using System.Reflection; +using System.Resources; +using System.Security; +using System.Security.Permissions; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about the assembly + +[assembly: AssemblyTitle ("Mono.Dynamic.Interpreter.dll")] +[assembly: AssemblyDescription ("Mono.Dynamic.Interpreter.dll")] +[assembly: AssemblyDefaultAlias ("Mono.Dynamic.Interpreter.dll")] + +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyVersion (Consts.FxVersion)] +[assembly: SatelliteContractVersion (Consts.FxVersion)] +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] + +[assembly: CLSCompliant (true)] + diff --git a/mcs/class/Mono.Dynamic.Interpreter/Makefile b/mcs/class/Mono.Dynamic.Interpreter/Makefile new file mode 100644 index 0000000000..bb8851ac6a --- /dev/null +++ b/mcs/class/Mono.Dynamic.Interpreter/Makefile @@ -0,0 +1,13 @@ +thisdir = class/Mono.Dynamic.Interpreter +SUBDIRS = +include ../../build/rules.make + +LIBRARY = Mono.Dynamic.Interpreter.dll + +LIB_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Numerics.dll \ + -d:FEATURE_CORE_DLR,FEATURE_NUMERICS,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 \ + -d:MONO_INTERPRETER \ + -delaysign -keyfile:../mono.pub + +include ../../build/library.make + diff --git a/mcs/class/Mono.Dynamic.Interpreter/Mono.Dynamic.Interpreter.dll.sources b/mcs/class/Mono.Dynamic.Interpreter/Mono.Dynamic.Interpreter.dll.sources new file mode 100644 index 0000000000..89f43a47b6 --- /dev/null +++ b/mcs/class/Mono.Dynamic.Interpreter/Mono.Dynamic.Interpreter.dll.sources @@ -0,0 +1,89 @@ +../../build/common/Consts.cs +Assembly/AssemblyInfo.cs + +../dlr/Runtime/Microsoft.Scripting/ArgumentTypeException.cs +../dlr/Runtime/Microsoft.Scripting/InvalidImplementationException.cs +../dlr/Runtime/Microsoft.Scripting/PlatformAdaptationLayer.cs +../dlr/Runtime/Microsoft.Scripting/Stubs.cs + +../dlr/Runtime/Microsoft.Scripting/Runtime/NotNullAttribute.cs +../dlr/Runtime/Microsoft.Scripting/Runtime/ParamDictionaryAttribute.cs + +../dlr/Runtime/Microsoft.Dynamic/DebugOptions.cs +../dlr/Runtime/Microsoft.Dynamic/MultiRuntimeAwareAttribute.cs +../dlr/Runtime/Microsoft.Dynamic/PerfTrack.cs + +../dlr/Runtime/Microsoft.Dynamic/Actions/Dummy.cs + +../dlr/Runtime/Microsoft.Dynamic/Ast/BinaryExpression.cs +../dlr/Runtime/Microsoft.Dynamic/Ast/ConstantExpression.cs +../dlr/Runtime/Microsoft.Dynamic/Ast/EmptyStatements.cs +../dlr/Runtime/Microsoft.Dynamic/Ast/LightLambdaExpression.cs +../dlr/Runtime/Microsoft.Dynamic/Ast/UnaryExpression.cs +../dlr/Runtime/Microsoft.Dynamic/Ast/Utils.cs + +../dlr/Runtime/Microsoft.Dynamic/Generation/CompilerHelpers.cs +../dlr/Runtime/Microsoft.Dynamic/Generation/ConstantCheck.cs +../dlr/Runtime/Microsoft.Dynamic/Generation/DelegateHelpers.cs +../dlr/Runtime/Microsoft.Dynamic/Generation/DelegateHelpers.Generated.cs + +../dlr/Runtime/Microsoft.Dynamic/Interpreter/BranchLabel.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/ILightCallSiteBinder.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/InterpretedFrame.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Interpreter.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LightDelegateCreator.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LightLambda.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LightLambdaClosureVisitor.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LocalVariables.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/LoopCompiler.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/RuntimeVariables.cs + +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/AddInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/ArrayOperations.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/DivInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/DynamicInstructionN.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/DynamicSplatInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/EqualInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/FieldOperations.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/GreaterThanInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/Instruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/InstructionFactory.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/InstructionList.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/LabelInfo.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/LessThanInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/LocalAccess.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/NotEqualInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/NumericConvertInstruction.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/StackOperations.cs +../dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/TypeOperations.cs + +../dlr/Runtime/Microsoft.Dynamic/Math/BigIntegerV4.cs +../dlr/Runtime/Microsoft.Dynamic/Math/Complex64.cs + +../dlr/Runtime/Microsoft.Dynamic/Runtime/ArgumentArray.cs +../dlr/Runtime/Microsoft.Dynamic/Runtime/DynamicNull.cs +../dlr/Runtime/Microsoft.Dynamic/Runtime/ExceptionHelpers.cs +../dlr/Runtime/Microsoft.Dynamic/Runtime/ScriptingRuntimeHelpers.cs + +../dlr/Runtime/Microsoft.Dynamic/Utils/ArrayUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/Assert.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/CacheDict.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/ContractUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/CollectionExtensions.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/CollectionUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/DynamicUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/ExceptionUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/ExceptionFactory.Generated.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/HybridReferenceDictionary.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/ListEqualityComparer.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/MathUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/ReferenceEqualityComparer.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/ReflectionUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/StringUtils.cs +../dlr/Runtime/Microsoft.Dynamic/Utils/TypeUtils.cs diff --git a/mcs/class/Mono.Options/Mono.Options/Options.cs b/mcs/class/Mono.Options/Mono.Options/Options.cs index 5af7fe0f38..0fd21ab5a9 100644 --- a/mcs/class/Mono.Options/Mono.Options/Options.cs +++ b/mcs/class/Mono.Options/Mono.Options/Options.cs @@ -1135,7 +1135,7 @@ namespace Mono.Options if (i == 0) return false; throw new OptionException (string.Format (localizer ( - "Cannot bundle unregistered option '{0}'."), opt), opt); + "Cannot use unregistered option '{0}' in bundle '{1}'."), rn, f + n), null); } p = this [rn]; switch (p.OptionValueType) { diff --git a/mcs/class/Mono.Options/Test/Mono.Options/OptionSetTest.cs b/mcs/class/Mono.Options/Test/Mono.Options/OptionSetTest.cs index 666bad54d5..086c6d9c8c 100644 --- a/mcs/class/Mono.Options/Test/Mono.Options/OptionSetTest.cs +++ b/mcs/class/Mono.Options/Test/Mono.Options/OptionSetTest.cs @@ -193,7 +193,7 @@ namespace Tests.Mono.Options Assert.AreEqual (libs [1], null); Utils.AssertException (typeof(OptionException), - "Cannot bundle unregistered option '-V'.", + "Cannot use unregistered option 'V' in bundle '-EVALUENOTSUP'.", p, v => { v.Parse (_("-EVALUENOTSUP")); }); } @@ -370,7 +370,7 @@ namespace Tests.Mono.Options // try to bundle with an option requiring a value Utils.AssertException (typeof(OptionException), - "Cannot bundle unregistered option '-z'.", + "Cannot use unregistered option 'z' in bundle '-cz'.", p, v => { v.Parse (_("-cz", "extra")); }); Utils.AssertException (typeof(ArgumentNullException), @@ -880,6 +880,22 @@ namespace Tests.Mono.Options Assert.AreEqual (formats ["baz"][0], "e"); Assert.AreEqual (formats ["baz"][1], "f"); } + + [Test] + public void ReportInvalidDuplication () + { + int verbosity = 0; + var p = new OptionSet () { + { "v", v => verbosity = v != null ? verbosity + 1 : verbosity }, + }; + try { + p.Parse (new []{"-v-v-v"}); + Assert.Fail ("Should not be reached."); + } catch (OptionException e) { + Assert.AreEqual (null, e.OptionName); + Assert.AreEqual ("Cannot use unregistered option '-' in bundle '-v-v-v'.", e.Message); + } + } } } diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyAttributesExtension.cs b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyAttributesExtension.cs index e986af912d..cf4385ef55 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyAttributesExtension.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyAttributesExtension.cs @@ -37,32 +37,6 @@ using Mono.Security; using Mono.Security.X509; namespace Mono.Security.X509.Extensions { - // definition found @ http://groups.yahoo.com/group/ssl-talk/message/1964 - // - // keyAttributes EXTENSION ::= { - // SYNTAX KeyAttributes - // IDENTIFIED BY { id-ce 2 } } - // - // KeyAttributes ::= SEQUENCE { - // keyIdentifier KeyIdentifier OPTIONAL, - // intendedKeyUsage KeyUsage OPTIONAL, - // privateKeyUsagePeriod PrivateKeyValidity OPTIONAL - // } - // KeyUsage ::= BIT STRING { - // digitalSignature (0), - // nonRepudiation (1), - // keyEncipherment (2), - // dataEncipherment (3), - // keyAgreement (4), - // keyCertSign (5), - // offLineCRLSign (6) - // } - // PrivateKeyValidity ::= SEQUENCE { - // notBefore [0] GeneralizedTime OPTIONAL, - // notAfter [1] GeneralizedTime OPTIONAL - // } - // ( CONSTRAINED BY { -- at least one component shall be present -- }) - public class KeyAttributesExtension : X509Extension { private byte[] keyId; diff --git a/mcs/class/Mono.XBuild.Tasks/Assembly/AssemblyInfo.cs b/mcs/class/Mono.XBuild.Tasks/Assembly/AssemblyInfo.cs new file mode 100644 index 0000000000..c5543a4af2 --- /dev/null +++ b/mcs/class/Mono.XBuild.Tasks/Assembly/AssemblyInfo.cs @@ -0,0 +1,53 @@ +// +// AssemblyInfo.cs +// +// Author: +// Antonius Riha <antoniusriha@gmail.com> +// +// Copyright (c) 2013 Antonius Riha +// +// 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. +// + +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +// General Information about the Mono.XBuild.Tasks assembly + +[assembly: AssemblyTitle ("Mono.XBuild.Tasks.dll")] +[assembly: AssemblyDescription ("Mono.XBuild.Tasks.dll")] +[assembly: AssemblyDefaultAlias ("Mono.XBuild.Tasks.dll")] + +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyVersion (Consts.FxVersion)] +[assembly: SatelliteContractVersion (Consts.FxVersion)] +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] + +[assembly: NeutralResourcesLanguage ("en-US")] + +[assembly: ComVisible (false)] +[assembly: CLSCompliant (true)] +[assembly: AssemblyDelaySign (true)] +[assembly: AssemblyKeyFile("../mono.pub")] + +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] diff --git a/mcs/class/Mono.XBuild.Tasks/Makefile b/mcs/class/Mono.XBuild.Tasks/Makefile new file mode 100644 index 0000000000..7135c45e3c --- /dev/null +++ b/mcs/class/Mono.XBuild.Tasks/Makefile @@ -0,0 +1,17 @@ +thisdir = class/Mono.XBuild.Tasks +SUBDIRS = +include ../../build/rules.make + +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make + +LIBRARY = Mono.XBuild.Tasks.dll + +LIB_MCS_FLAGS = \ + /r:$(corlib) \ + /r:System.dll \ + /r:System.Xml.dll + +include $(XBUILD_DIR)/xbuild_test.make + +include ../../build/library.make diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks.dll.sources b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks.dll.sources new file mode 100644 index 0000000000..60955c07e0 --- /dev/null +++ b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks.dll.sources @@ -0,0 +1,6 @@ +Assembly/AssemblyInfo.cs +../../build/common/Consts.cs +../../build/common/MonoTODOAttribute.cs +Mono.XBuild.Tasks/PcFileCache.cs +Mono.XBuild.Tasks/LibraryPcFileCache.cs +../Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/LibraryPcFileCache.cs b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks/LibraryPcFileCache.cs index f29a591f56..c89cba9a95 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/LibraryPcFileCache.cs +++ b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks/LibraryPcFileCache.cs @@ -36,7 +36,7 @@ using System.Collections.Generic; namespace Mono.PkgConfig { - internal class LibraryPcFileCache: PcFileCache<LibraryPackageInfo> + public class LibraryPcFileCache: PcFileCache<LibraryPackageInfo> { Dictionary<string, PackageAssemblyInfo> assemblyLocations; @@ -251,7 +251,7 @@ namespace Mono.PkgConfig } } - internal class LibraryPackageInfo: PackageInfo + public class LibraryPackageInfo: PackageInfo { public bool IsGacPackage { get { return GetData ("gacPackage") != "false"; } @@ -270,7 +270,7 @@ namespace Mono.PkgConfig } } - internal class PackageAssemblyInfo + public class PackageAssemblyInfo { public string File { get; set; } diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks/PcFileCache.cs index aa96a318fc..3404656d77 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs +++ b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks/PcFileCache.cs @@ -36,7 +36,7 @@ using System.Collections.Generic; namespace Mono.PkgConfig { - internal interface IPcFileCacheContext<TP> where TP:PackageInfo, new() + public interface IPcFileCacheContext<TP> where TP:PackageInfo, new() { // In the implementation of this method, the host application can extract // information from the pc file and store it in the PackageInfo object @@ -50,24 +50,23 @@ namespace Mono.PkgConfig void ReportError (string message, Exception ex); } - internal interface IPcFileCacheContext: IPcFileCacheContext<PackageInfo> + public interface IPcFileCacheContext: IPcFileCacheContext<PackageInfo> { } - internal abstract class PcFileCache: PcFileCache<PackageInfo> + public abstract class PcFileCache: PcFileCache<PackageInfo> { public PcFileCache (IPcFileCacheContext ctx): base (ctx) { } } - internal abstract class PcFileCache<TP> where TP:PackageInfo, new() + public abstract class PcFileCache<TP> where TP:PackageInfo, new() { const string CACHE_VERSION = "2"; const string MacOSXExternalPkgConfigDir = "/Library/Frameworks/Mono.framework/External/pkgconfig"; Dictionary<string, TP> infos = new Dictionary<string, TP> (); - Dictionary<string, List<TP>> filesByFolder = new Dictionary<string, List<TP>> (); string cacheFile; bool hasChanges; @@ -100,12 +99,25 @@ namespace Mono.PkgConfig } // Updates the pkg-config index, looking for .pc files in the provided directories + // Deletes pkg info entries, of which .pc files don't exist, from cache public void Update (IEnumerable<string> pkgConfigDirs) { foreach (string pcdir in pkgConfigDirs) { foreach (string pcfile in Directory.GetFiles (pcdir, "*.pc")) GetPackageInfo (pcfile); } + + lock (infos) { + string[] keys = new string [infos.Count]; + infos.Keys.CopyTo (keys, 0); + foreach (string key in keys) { + if (!File.Exists (key)) { + infos.Remove (key); + hasChanges = true; + } + } + } + Save (); } @@ -118,12 +130,23 @@ namespace Mono.PkgConfig { if (pkgConfigDirs == null) pkgConfigDirs = GetDefaultPaths (); + else + pkgConfigDirs = NormaliseAndFilterPaths (pkgConfigDirs, Environment.CurrentDirectory); + + string[] keys = new string [infos.Count]; + TP[] vals = new TP [infos.Count]; + lock (infos) { + infos.Keys.CopyTo (keys, 0); + infos.Values.CopyTo (vals, 0); + } foreach (string sp in pkgConfigDirs) { - List<TP> list; - if (filesByFolder.TryGetValue (Path.GetFullPath (sp), out list)) { - foreach (TP p in list) - yield return p; + int i = 0; + foreach (var file in keys) { + string dirOfFile = Path.GetFullPath (Path.GetDirectoryName (file)); + if (dirOfFile == sp) + yield return vals [i]; + i++; } } } @@ -144,7 +167,7 @@ namespace Mono.PkgConfig // Returns information about a .pc file public TP GetPackageInfo (string file) { - TP info, oldInfo = null; + TP info; file = Path.GetFullPath (file); DateTime wtime = File.GetLastWriteTime (file); @@ -153,7 +176,6 @@ namespace Mono.PkgConfig if (infos.TryGetValue (file, out info)) { if (info.LastWriteTime == wtime) return info; - oldInfo = info; } } @@ -168,32 +190,13 @@ namespace Mono.PkgConfig if (!info.IsValidPackage) info = new TP (); // Create a default empty instance info.LastWriteTime = wtime; - Add (file, info, oldInfo); + infos [file] = info; hasChanges = true; } return info; } - void Add (string file, TP info, TP replacedInfo) - { - infos [file] = info; - string dir = Path.GetFullPath (Path.GetDirectoryName (file)); - List<TP> list; - if (!filesByFolder.TryGetValue (dir, out list)) { - list = new List<TP> (); - filesByFolder [dir] = list; - } - if (replacedInfo != null) { - int i = list.IndexOf (replacedInfo); - if (i != -1) { - list [i] = info; - return; - } - } - list.Add (info); - } - FileStream OpenFile (FileAccess access) { int retries = 6; @@ -313,8 +316,10 @@ namespace Mono.PkgConfig tr.Read (); tr.MoveToContent (); - if (!pinfo.IsValidPackage || ctx.IsCustomDataComplete (file, pinfo)) - Add (file, pinfo, null); + if (!pinfo.IsValidPackage || ctx.IsCustomDataComplete (file, pinfo)) { + lock (infos) + infos [file] = pinfo; + } } protected virtual void ReadPackageContent (XmlReader tr, TP pinfo) @@ -449,7 +454,7 @@ namespace Mono.PkgConfig } } - internal class PcFile + public class PcFile { Dictionary<string,string> variables = new Dictionary<string, string> (); @@ -575,7 +580,7 @@ namespace Mono.PkgConfig } } - internal class PackageInfo + public class PackageInfo { Dictionary<string,string> customData; DateTime lastWriteTime; diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources new file mode 100644 index 0000000000..0dbb1260ba --- /dev/null +++ b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources @@ -0,0 +1 @@ +Mono.XBuild.Tasks/PcFileCacheTest.cs diff --git a/mcs/class/Mono.XBuild.Tasks/Test/Mono.XBuild.Tasks/PcFileCacheTest.cs b/mcs/class/Mono.XBuild.Tasks/Test/Mono.XBuild.Tasks/PcFileCacheTest.cs new file mode 100644 index 0000000000..a35a0821c8 --- /dev/null +++ b/mcs/class/Mono.XBuild.Tasks/Test/Mono.XBuild.Tasks/PcFileCacheTest.cs @@ -0,0 +1,285 @@ +// +// PcFileCacheTest.cs +// +// Author: +// Antonius Riha <antoniusriha@gmail.com> +// +// Copyright (c) 2013 Antonius Riha +// +// 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. +using System; +using System.Collections.Generic; +using System.IO; +using Mono.PkgConfig; +using NUnit.Framework; + +namespace MonoTests.Mono.PkgConfig +{ + [TestFixture] + public class PcFileCacheTest + { + static readonly string cacheDir = "testcache"; + static readonly string pcCacheFileName = "pkgconfig-cache-2.xml"; + static readonly string pcCacheFilePath = Path.Combine (cacheDir, pcCacheFileName); + static readonly string pkgConfigDir = "testpkgconfig"; + + [SetUp] + public void Setup () + { + Directory.CreateDirectory (cacheDir); + Directory.CreateDirectory (pkgConfigDir); + } + + [TearDown] + public void Teardown () + { + if (Directory.Exists (cacheDir)) + Directory.Delete (cacheDir, true); + if (Directory.Exists (pkgConfigDir)) + Directory.Delete (pkgConfigDir, true); + } + + [Test] + public void CreatePcFileCache () + { + PcFileCacheStub.Create (cacheDir); + + // cache dir should exist + Assert.IsTrue (Directory.Exists (cacheDir), "A1"); + + // cache file should not exist + Assert.IsFalse (File.Exists (pcCacheFilePath), "A2"); + } + + [Test] + public void CreatePcFileCacheWithExistingEmptyCacheFile () + { + // Create pc cache file + WritePcCacheFileContent (""); + PcFileCache cache = PcFileCacheStub.Create (cacheDir); + + // cache should be empty + string[] pkgConfigDirs = { pkgConfigDir }; + CollectionAssert.IsEmpty (cache.GetPackages (pkgConfigDirs), "A1"); + } + + [Test] + public void CreatePcFileCacheWithCacheFileContaining1EntryForAnExistingPcFile () + { + // Create pc cache file with an entry and corresponding pc file + string pkgConfigFileName = "gtk-sharp-2.0.pc"; + string pkgConfigFullFilePath = Path.GetFullPath (Path.Combine (pkgConfigDir, pkgConfigFileName)); + string pcCacheFileContent = @"<PcFileCache> + <File path=""" + pkgConfigFullFilePath + @""" lastWriteTime=""2013-11-23T21:18:31+01:00"" /> +</PcFileCache> +"; + + string pkgConfigFileContent = @"prefix=${pcfiledir}/../.. +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +gapidir=${prefix}/share/gapi-2.0 + + +Name: Gtk# +Description: Gtk# - GNOME .NET Binding +Version: 2.12.10 +Cflags: -I:${gapidir}/pango-api.xml -I:${gapidir}/atk-api.xml -I:${gapidir}/gdk-api.xml -I:${gapidir}/gtk-api.xml +Libs: -r:${libdir}/cli/pango-sharp-2.0/pango-sharp.dll -r:${libdir}/cli/atk-sharp-2.0/atk-sharp.dll -r:${libdir}/cli/gdk-sharp-2.0/gdk-sharp.dll -r:${libdir}/cli/gtk-sharp-2.0/gtk-sharp.dll +Requires: glib-sharp-2.0 +"; + + AddPkgConfigFile (pkgConfigFileName, pkgConfigFileContent); + WritePcCacheFileContent (pcCacheFileContent); + + PcFileCache cache = PcFileCacheStub.Create (cacheDir); + + // cache should contain entry of pc file + Assert.IsNotNull (cache.GetPackageInfo (pkgConfigFullFilePath), "A1"); + } + + [Test] + public void CreatePcFileCacheWithCacheFileContainingOneOrphanedEntry () + { + string pkgConfigFileName = "gtk-sharp-2.0.pc"; + string pkgConfigFullFilePath = Path.GetFullPath (Path.Combine (pkgConfigDir, pkgConfigFileName)); + string pcCacheFileContent = @"<PcFileCache> + <File path=""" + pkgConfigFullFilePath + @""" lastWriteTime=""2013-11-23T21:18:31+01:00"" /> +</PcFileCache> +"; + WritePcCacheFileContent (pcCacheFileContent); + + PcFileCache cache = PcFileCacheStub.Create (cacheDir); + + // cache should contain orphaned entry + Assert.IsNotNull (cache.GetPackageInfo (pkgConfigFullFilePath), "A1"); + } + + [Test] + public void CreatePcFileCacheWithoutCacheFileButWithPcFile () + { + string pkgConfigFileName = "gtk-sharp-2.0.pc"; + string pkgConfigFileContent = @"prefix=${pcfiledir}/../.. +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +gapidir=${prefix}/share/gapi-2.0 + + +Name: Gtk# +Description: Gtk# - GNOME .NET Binding +Version: 2.12.10 +Cflags: -I:${gapidir}/pango-api.xml -I:${gapidir}/atk-api.xml -I:${gapidir}/gdk-api.xml -I:${gapidir}/gtk-api.xml +Libs: -r:${libdir}/cli/pango-sharp-2.0/pango-sharp.dll -r:${libdir}/cli/atk-sharp-2.0/atk-sharp.dll -r:${libdir}/cli/gdk-sharp-2.0/gdk-sharp.dll -r:${libdir}/cli/gtk-sharp-2.0/gtk-sharp.dll +Requires: glib-sharp-2.0 +"; + AddPkgConfigFile (pkgConfigFileName, pkgConfigFileContent); + + PcFileCache cache = PcFileCacheStub.Create (cacheDir); + + // cache file should exist + Assert.IsFalse (File.Exists (pcCacheFilePath), "A1"); + + // cache should be empty + string[] pkgConfigDirs = { pkgConfigDir }; + CollectionAssert.IsEmpty (cache.GetPackages (pkgConfigDirs), "A2"); + } + + [Test] + public void GetPackagesOrderedByFolder () + { + string pkgConfigDir1 = "testpkgconfigdir1"; + string pkgConfigDir2 = "testpkgconfigdir2"; + Directory.CreateDirectory (pkgConfigDir1); + Directory.CreateDirectory (pkgConfigDir2); + + string pkgConfigFile11NameAttr = "gtk-sharp-2.0"; + string pkgConfigFile11FullPath = Path.GetFullPath (Path.Combine (pkgConfigDir1, "gtk-sharp-2.0.pc")); + + string pkgConfigFile21NameAttr = "art-sharp-2.0"; + string pkgConfigFile21FullPath = Path.GetFullPath (Path.Combine (pkgConfigDir2, "art-sharp-2.0.pc")); + + string pkgConfigFile12NameAttr = "cecil"; + string pkgConfigFile12FullPath = Path.GetFullPath (Path.Combine (pkgConfigDir1, "cecil.pc")); + + string pcCacheFileContent = @"<PcFileCache> + <File path=""" + pkgConfigFile11FullPath + @""" lastWriteTime=""2013-11-23T21:18:31+01:00"" name=""" + pkgConfigFile11NameAttr + @""" /> + <File path=""" + pkgConfigFile21FullPath + @""" lastWriteTime=""2011-07-12T12:04:53+02:00"" name=""" + pkgConfigFile21NameAttr + @""" /> + <File path=""" + pkgConfigFile12FullPath + @""" lastWriteTime=""2012-07-24T22:28:30+02:00"" name=""" + pkgConfigFile12NameAttr + @""" /> +</PcFileCache> +"; + + WritePcCacheFileContent (pcCacheFileContent); + + PcFileCache cache = PcFileCacheStub.Create (cacheDir); + string[] pkgConfigDirs = { pkgConfigDir1, pkgConfigDir2 }; + IEnumerable<PackageInfo> packages = cache.GetPackages (pkgConfigDirs); + + PackageInfo[] packageArray = new PackageInfo [3]; + int i = 0; + foreach (PackageInfo package in packages) + packageArray [i++] = package; + + Assert.AreEqual (pkgConfigFile11NameAttr, packageArray [0].Name, "A1"); + Assert.AreEqual (pkgConfigFile12NameAttr, packageArray [1].Name, "A2"); + Assert.AreEqual (pkgConfigFile21NameAttr, packageArray [2].Name, "A3"); + + Directory.Delete (pkgConfigDir1, true); + Directory.Delete (pkgConfigDir2, true); + } + + [Test] + public void UpdatePcFileCacheWithOrphanedEntry () + { + string pkgConfigFileNameAttr = "gtk-sharp-2.0"; + string pkgConfigFileName = "gtk-sharp-2.0.pc"; + string pkgConfigFullFilePath = Path.GetFullPath (Path.Combine (pkgConfigDir, pkgConfigFileName)); + string pcCacheFileContent = @"<PcFileCache> + <File path=""" + pkgConfigFullFilePath + @""" lastWriteTime=""2013-11-23T21:18:31+01:00"" name=""" + pkgConfigFileNameAttr + @""" /> +</PcFileCache> +"; + + WritePcCacheFileContent (pcCacheFileContent); + + PcFileCache cache = PcFileCacheStub.Create (cacheDir); + + // precondition + string[] pkgConfigDirs = { pkgConfigDir }; + Assert.IsNotNull (cache.GetPackageInfoByName (pkgConfigFileNameAttr, pkgConfigDirs), "A1"); + + cache.Update (pkgConfigDirs); + Assert.IsNull (cache.GetPackageInfoByName (pkgConfigFileNameAttr, pkgConfigDirs), "A2"); + } + + static void WritePcCacheFileContent (string content) + { + File.WriteAllText (pcCacheFilePath, content); + } + + static void AddPkgConfigFile (string fileName, string content) + { + AddPkgConfigFile (fileName, content, pkgConfigDir); + } + + static void AddPkgConfigFile (string fileName, string content, string pkgConfigDir) + { + string path = Path.Combine (pkgConfigDir, fileName); + File.WriteAllText (path, content); + } + + class PcFileCacheContextStub : IPcFileCacheContext + { + public void StoreCustomData (PcFile pcfile, PackageInfo pkg) + { + } + + public bool IsCustomDataComplete (string pcfile, PackageInfo pkg) + { + return false; + } + + public void ReportError (string message, Exception ex) + { + } + } + + class PcFileCacheStub : PcFileCache + { + static string initCacheDirectory; + readonly string cacheDirectory; + + PcFileCacheStub (string cacheDirectory) : base (new PcFileCacheContextStub ()) + { + if (cacheDirectory == null) + throw new ArgumentNullException ("cacheDirectory"); + this.cacheDirectory = cacheDirectory; + } + + protected override string CacheDirectory { + get { return initCacheDirectory == null ? cacheDirectory : initCacheDirectory; } + } + + public static PcFileCache Create (string cacheDirectory) + { + initCacheDirectory = cacheDirectory; + PcFileCache cache = new PcFileCacheStub (cacheDirectory); + initCacheDirectory = null; + return cache; + } + } + } +} diff --git a/mcs/class/Moonlight.Build.Tasks/ChangeLog b/mcs/class/Moonlight.Build.Tasks/ChangeLog deleted file mode 100644 index 7e630808ba..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/ChangeLog +++ /dev/null @@ -1,3 +0,0 @@ -2010-04-13 Ankit Jain <jankit@novell.com> - - * Initial commit. diff --git a/mcs/class/Moonlight.Build.Tasks/Makefile b/mcs/class/Moonlight.Build.Tasks/Makefile deleted file mode 100644 index 5452bf8ed5..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -thisdir = class/Moonlight.Build.Tasks -SUBDIRS = -include ../../build/rules.make - -LIBRARY = Moonlight.Build.Tasks.dll -LIBRARY_NAME = Moonlight.Build.Tasks.dll - -ifeq (3.5, $(FRAMEWORK_VERSION)) -NAME_SUFFIX = .v3.5 -else -ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) -NAME_SUFFIX = .v4.0 -endif -endif - -NO_INSTALL = yes -NO_TEST = yes -NO_SIGN_ASSEMBLY = yes - -REFERENCES = \ - /r:$(corlib) \ - /r:System.dll \ - /r:System.Xml.dll \ - /r:Microsoft.Build.Engine.dll \ - /r:Microsoft.Build.Framework.dll \ - /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll \ - /r:Microsoft.Build.Tasks$(NAME_SUFFIX).dll \ - /r:ICSharpCode.SharpZipLib.dll - -LIB_MCS_FLAGS = \ - $(REFERENCES) \ - $(RESOURCE_FILES:%=-resource:%) - -RESOURCE_FILES = Moonlight.Build.Tasks/PreviewTemplate.html - -EXTRA_DISTFILES = $(RESOURCE_FILES) - -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make - -include ../../build/library.make - -SILVERLIGHT_DIR = $(DESTDIR)$(mono_libdir)/mono/xbuild/Microsoft/Silverlight - -install-local: install-lib - -install-lib: $(the_lib) - -$(MKINSTALLDIRS) $(SILVERLIGHT_DIR)/v2.0 - -$(MKINSTALLDIRS) $(SILVERLIGHT_DIR)/v3.0 - $(INSTALL_DATA) $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME) $(SILVERLIGHT_DIR)/v2.0 - $(INSTALL_DATA) $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME) $(SILVERLIGHT_DIR)/v3.0 - -uninstall-local: uninstall-lib - -uninstall-lib: - -rm -f $(SILVERLIGHT_DIR)/v2.0/$(LIBRARY_NAME) - -rm -f $(SILVERLIGHT_DIR)/v3.0/$(LIBRARY_NAME) diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks.dll.sources b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks.dll.sources deleted file mode 100644 index 74c3a27a72..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks.dll.sources +++ /dev/null @@ -1,6 +0,0 @@ -Moonlight.Build.Tasks/GenerateXap.cs -Moonlight.Build.Tasks/XamlG.cs -Moonlight.Build.Tasks/GetMoonlightFrameworkPath.cs -Moonlight.Build.Tasks/GenerateMoonlightManifest.cs -Moonlight.Build.Tasks/CreateTestPage.cs -Moonlight.Build.Tasks/Respack.cs diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/ChangeLog b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/ChangeLog deleted file mode 100644 index f622072904..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/ChangeLog +++ /dev/null @@ -1,23 +0,0 @@ -2010-07-16 Ankit Jain <jankit@novell.com> - - * XamlG.cs (Execute): Fix earlier commit, include the filename. - -2010-07-16 Ankit Jain <jankit@novell.com> - - * Respack.cs (Execute): Skip if output file is up-to-date wrt - the input files. Bug reported by Rolf. - -2010-07-16 Ankit Jain <jankit@novell.com> - - * XamlG.cs: Fix arg to XamlGCompiler, to use path relative to project - dir. Bug uncovered by Rolf. - -2010-04-13 Ankit Jain <jankit@novell.com> - - * CreateTestPage.cs: - * GenerateMoonlightManifest.cs: - * GetMoonlightFrameworkPath.cs: - * GenerateXap.cs: - * Respack.cs: - * XamlG.cs: - MSBuild tasks for building silverlight projects. diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/CreateTestPage.cs b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/CreateTestPage.cs deleted file mode 100644 index 28051694ee..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/CreateTestPage.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// CreateTestPage.cs: Generates test page for moonlight app -// -// Author: -// Michael Hutchinson <mhutchinson@novell.com> -// Ankit Jain <jankit@novell.com> -// -// Copyright (c) 2009 Novell, Inc. (http://www.novell.com) -// Copyright (c) 2010 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. - -using System; -using System.IO; -using System.Reflection; -using System.Text; - -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Moonlight.Build.Tasks { - public class CreateTestPage : Task { - - public override bool Execute () - { - Log.LogMessage (MessageImportance.Low, "Generating test page {0}", XapFilename); - - var sb = new StringBuilder (); - using (var sr = new StreamReader (Assembly.GetExecutingAssembly ().GetManifestResourceStream ("PreviewTemplate.html"))) - sb.Append (sr.ReadToEnd ()); - - sb.Replace ("@TITLE@", Title); - sb.Replace ("@XAP_FILE@", XapFilename); - - try{ - File.WriteAllText (TestPageFilename, sb.ToString ()); - } catch (IOException e) { - Log.LogError (String.Format ( - "Error generating test page file {0}: {1}", TestPageFilename, e.Message)); - return false; - } - - return true; - } - - [Required] - public string XapFilename { - get; set; - } - - [Required] - public string Title { - get; set; - } - - [Required] - [Output] - public string TestPageFilename { - get; set; - } - } -} diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GenerateMoonlightManifest.cs b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GenerateMoonlightManifest.cs deleted file mode 100644 index 4b7e7a30df..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GenerateMoonlightManifest.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -// GenerateMoonlightManifest.cs -// -// Author: -// Michael Hutchinson <mhutchinson@novell.com> -// Ankit Jain <jankit@novell.com> -// -// Copyright (c) 2009 Novell, Inc. (http://www.novell.com) -// Copyright (c) 2010 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. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Xml; - -using Microsoft.CSharp; - -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Moonlight.Build.Tasks { - public class GenerateMoonlightManifest : Task { - - public override bool Execute () - { - return GenerateManifest (); - } - - bool GenerateManifest () - { - const string depNS = "http://schemas.microsoft.com/client/2007/deployment"; - - string template = null; - var manifest = ManifestFile.ItemSpec; - Log.LogMessage (MessageImportance.Normal, "Generating manifest file {0}", manifest); - - if (SilverlightManifestTemplate != null) - template = String.IsNullOrEmpty (SilverlightManifestTemplate.ItemSpec) ? - null : - SilverlightManifestTemplate.GetMetadata ("FullPath"); - - XmlDocument doc = new XmlDocument (); - if (template != null) { - if (!File.Exists (template)) { - Log.LogError ("Could not find manifest template '" + template + "'."); - return false; - } - - try { - doc.Load (template); - } catch (XmlException ex) { - Log.LogError (null, null, null, template, ex.LineNumber, ex.LinePosition, 0, 0, - "Error loading manifest template '" + ex.Source); - return false; - } catch (Exception ex) { - Log.LogError ("Could not load manifest template '" + template + "'."); - Log.LogMessage (MessageImportance.Low, "Could not load manifest template '" + template + "': " + ex.ToString ()); - return false; - } - - } else { - doc.LoadXml (@"<Deployment xmlns=""http://schemas.microsoft.com/client/2007/deployment"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""></Deployment>"); - } - - try { - XmlNode deploymentNode = doc.DocumentElement; - if (deploymentNode == null || deploymentNode.Name != "Deployment" || deploymentNode.NamespaceURI != depNS) { - Log.LogError ("Missing or invalid root <Deployment> element in manifest template '" + template + "'."); - return false; - } - if (deploymentNode.Attributes["EntryPointAssembly"] == null) - deploymentNode.Attributes.Append (doc.CreateAttribute ("EntryPointAssembly")).Value = - EntryPointAssembly.GetMetadata ("Filename"); - - if (!String.IsNullOrEmpty (SilverlightAppEntry) && deploymentNode.Attributes["EntryPointType"] == null) - deploymentNode.Attributes.Append (doc.CreateAttribute ("EntryPointType")).Value = SilverlightAppEntry; - - if (deploymentNode.Attributes["RuntimeVersion"] == null) { - //FIXME: - /*string fxVersion = MoonlightFrameworkBackend.GetFxVersion (proj.TargetFramework); - - if (proj.TargetRuntime is MonoDevelop.Core.Assemblies.MonoTargetRuntime) { - var package = proj.TargetRuntime.RuntimeAssemblyContext.GetPackage ("moonlight-web-" + fxVersion); - if (package != null && package.IsFrameworkPackage) { - runtimeVersion = package.Version; - } else { - LoggingService.LogWarning ("Moonlight core framework package not found, cannot determine " + - "runtime version string. Falling back to default value."); - } - }*/ - - deploymentNode.Attributes.Append (doc.CreateAttribute ("RuntimeVersion")).Value = - String.IsNullOrEmpty (RuntimeVersion) ? "2.0.31005.0" : RuntimeVersion; - } - - XmlNamespaceManager mgr = new XmlNamespaceManager (doc.NameTable); - mgr.AddNamespace ("dep", depNS); - XmlNode partsNode = deploymentNode.SelectSingleNode ("dep:Deployment.Parts", mgr); - if (partsNode == null) - partsNode = deploymentNode.AppendChild (doc.CreateElement ("Deployment.Parts", depNS)); - - AddAssemblyPart (doc, partsNode, EntryPointAssembly); - - foreach (ITaskItem ref_item in References) - AddAssemblyPart (doc, partsNode, ref_item); - } catch (XmlException ex) { - Log.LogError (null, null, null, template, ex.LineNumber, ex.LinePosition, 0, 0, - "Error processing manifest template: '" + ex.Source); - return false; - } - - doc.Save (manifest); - - return true; - } - - static void AddAssemblyPart (XmlDocument doc, XmlNode partsNode, ITaskItem filename) - { - XmlNode child = doc.CreateElement ("AssemblyPart", "http://schemas.microsoft.com/client/2007/deployment"); - child.Attributes.Append (doc.CreateAttribute ( - "Name", "http://schemas.microsoft.com/winfx/2006/xaml")).Value = filename.GetMetadata ("Filename"); - string subdir = filename.GetMetadata ("DestinationSubdirectory"); - child.Attributes.Append (doc.CreateAttribute ("Source")).Value = Path.Combine (subdir ?? String.Empty, Path.GetFileName (filename.ItemSpec)); - partsNode.AppendChild (child); - } - - [Required] - [Output] - public ITaskItem ManifestFile { - get; set; - } - - [Required] - // with extension - public ITaskItem EntryPointAssembly { - get; set; - } - - [Required] - public ITaskItem[] References { - get; set; - } - - public ITaskItem SilverlightManifestTemplate { - get; set; - } - - public string SilverlightAppEntry { - get; set; - } - - public string RuntimeVersion { - get; set; - } - } - -} diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GenerateXap.cs b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GenerateXap.cs deleted file mode 100644 index 92082ac0ef..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GenerateXap.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// GenerateXap.cs -// -// Author: -// Michael Hutchinson <mhutchinson@novell.com> -// Ankit Jain <jankit@novell.com> -// -// Copyright (c) 2009 Novell, Inc. (http://www.novell.com) -// Copyright (c) 2010 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. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Xml; - -using Microsoft.CSharp; - -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Moonlight.Build.Tasks { - public class GenerateXap : Task { - - public override bool Execute () - { - if (InputFiles.Length == 0) - return true; - - return Zip (); - } - - bool Zip () - { - var xapName = XapFilename.ItemSpec; - if (File.Exists (xapName)) { - DateTime lastMod = File.GetLastWriteTime (xapName); - bool needsWrite = false; - foreach (ITaskItem file_item in InputFiles) { - if (File.GetLastWriteTime (file_item.ItemSpec) > lastMod) { - needsWrite = true; - break; - } - } - if (!needsWrite) { - Log.LogMessage (MessageImportance.Low, "Skipping xap file {0} generation, its up-to date"); - return true; - } - } - - Log.LogMessage (MessageImportance.Normal, "Generating compressed xap file {0}", xapName); - try { - using (FileStream fs = new FileStream (xapName, FileMode.Create)) { - var zip_stream = new ICSharpCode.SharpZipLib.Zip.ZipOutputStream (fs); - zip_stream.SetLevel (9); - - AddFilesToZip (InputFiles, zip_stream); - AddFilesToZip (LocalCopyReferences, zip_stream); - - zip_stream.Finish (); - zip_stream.Close (); - } - } catch (IOException ex) { - Log.LogError ("Error writing xap file.", ex); - Log.LogMessage (MessageImportance.Low, "Error writing xap file:" + ex.ToString ()); - - try { - if (File.Exists (xapName)) - File.Delete (xapName); - } catch {} - - return false; - } - - return true; - } - - void AddFilesToZip (ITaskItem [] files, ICSharpCode.SharpZipLib.Zip.ZipOutputStream zipStream) - { - if (files == null) - return; - - foreach (ITaskItem item in files) { - string target_path = item.GetMetadata ("TargetPath"); - if (String.IsNullOrEmpty (target_path)) - target_path = Path.GetFileName (item.ItemSpec); - - zipStream.PutNextEntry (new ICSharpCode.SharpZipLib.Zip.ZipEntry (target_path)); - using (FileStream inStream = File.OpenRead (item.ItemSpec)) { - int readCount; - byte[] buffer = new byte[4096]; - - do { - readCount = inStream.Read (buffer, 0, buffer.Length); - zipStream.Write (buffer, 0, readCount); - } while (readCount > 0); - } - } - } - - [Output] - [Required] - public ITaskItem XapFilename { - get; set; - } - - [Required] - public ITaskItem[] InputFiles { - get; set; - } - - public ITaskItem[] LocalCopyReferences { - get; set; - } - - } - - -} diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GetMoonlightFrameworkPath.cs b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GetMoonlightFrameworkPath.cs deleted file mode 100644 index 91de54407b..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/GetMoonlightFrameworkPath.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// GetMoonlightFrameworkPath.cs -// -// Author: -// Michael Hutchinson <mhutchinson@novell.com> -// Ankit Jain <jankit@novell.com> -// -// Copyright (c) 2009 Novell, Inc. (http://www.novell.com) -// Copyright (c) 2010 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. - -using SI = System.IO; - -using System; -using System.Text; - -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Moonlight.Build.Tasks { - public class GetMoonlightFrameworkPath : Task { - - public override bool Execute () - { - return true; - } - - [Required] - public string SilverlightVersion { - get; set; - } - - [Output] - public string FrameworkPath { - get { - if (string.IsNullOrEmpty (SilverlightVersion)) - return FrameworkVersion30Path; - - return SI.Path.GetFullPath ( - PathCombine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), - "..", "..", "moonlight", SilverlightVersion)); - } - } - - [Output] - public string FrameworkVersion20Path { - get { - return SI.Path.GetFullPath ( - PathCombine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), - "..", "..", "moonlight", "2.0")); - } - } - - [Output] - public string FrameworkVersion30Path { - get { - return SI.Path.GetFullPath ( - PathCombine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), - "..", "..", "moonlight", "3.0")); - } - } - - static string PathCombine (string path1, params string[] parts) - { - StringBuilder sb = new StringBuilder (); - sb.Append (path1); - foreach (string part in parts) - sb.AppendFormat ("{0}{1}", SI.Path.DirectorySeparatorChar, part); - - return sb.ToString (); - } - } -} diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/PreviewTemplate.html b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/PreviewTemplate.html deleted file mode 100644 index 2be0575995..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/PreviewTemplate.html +++ /dev/null @@ -1,76 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" > -<head> - <title>@TITLE@</title> - - <style type="text/css"> - html, body { - height: 100%; - overflow: auto; - } - body { - padding: 0; - margin: 0; - } - #silverlightControlHost { - height: 100%; - } - </style> - - <script type="text/javascript"> - function onSilverlightError(sender, args) { - - var appSource = ""; - if (sender != null && sender != 0) { - appSource = sender.getHost().Source; - } - var errorType = args.ErrorType; - var iErrorCode = args.ErrorCode; - - var errMsg = "Unhandled Error in Silverlight 2 Application " + appSource + "\n" ; - - errMsg += "Code: "+ iErrorCode + " \n"; - errMsg += "Category: " + errorType + " \n"; - errMsg += "Message: " + args.ErrorMessage + " \n"; - - if (errorType == "ParserError") - { - errMsg += "File: " + args.xamlFile + " \n"; - errMsg += "Line: " + args.lineNumber + " \n"; - errMsg += "Position: " + args.charPosition + " \n"; - } - else if (errorType == "RuntimeError") - { - if (args.lineNumber != 0) - { - errMsg += "Line: " + args.lineNumber + " \n"; - errMsg += "Position: " + args.charPosition + " \n"; - } - errMsg += "MethodName: " + args.methodName + " \n"; - } - - throw new Error(errMsg); - } - </script> -</head> - -<body> - <!-- Runtime errors from Silverlight will be displayed here. - This will contain debugging information and should be removed or hidden when debugging is completed --> - <div id='errorLocation' style="font-size: small;color: Gray;"></div> - - <div id="silverlightControlHost"> - <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%"> - <param name="source" value="@XAP_FILE@"/> - <param name="onerror" value="onSilverlightError" /> - <param name="background" value="white" /> - <param name="minRuntimeVersion" value="2.0.31005.0" /> - <param name="autoUpgrade" value="true" /> - <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"> - <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> - </a> - </object> - <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe> - </div> -</body> -</html> diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/Respack.cs b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/Respack.cs deleted file mode 100644 index 4efcb41b0f..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/Respack.cs +++ /dev/null @@ -1,120 +0,0 @@ -// -// Respack.cs -// -// Author: -// Ankit Jain (jankit@novell.com) -// -// Copyright 2010 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. - -using System; -using System.Diagnostics; -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Tasks; -using Microsoft.Build.Utilities; -using Mono.XBuild.Utilities; - -namespace Moonlight.Build.Tasks { - public class Respack : ToolTask - { - public override bool Execute () - { - if (!ValidateParameters ()) { - // not generating any resource file - OutputFile = null; - return true; - } - - return BuildRequired () ? base.Execute () : true; - } - - bool BuildRequired () - { - if (!File.Exists (OutputFile.ItemSpec)) - return true; - - DateTime outputFileTime = File.GetLastWriteTime (OutputFile.ItemSpec); - foreach (var res in Resources) { - string file = res.ItemSpec; - if (File.Exists (file) && File.GetLastWriteTime (file) > outputFileTime) - return true; - } - - return false; - } - - void AddCommandLineCommands (CommandLineBuilderExtension commandLine) - { - if (Resources.Length == 0) - return; - - commandLine.AppendFileNameIfNotNull (OutputFile); - - commandLine.AppendFileNamesIfNotNull (Resources, " "); - } - - protected override string GenerateCommandLineCommands () - { - CommandLineBuilderExtension clbe = new CommandLineBuilderExtension (); - AddCommandLineCommands (clbe); - return clbe.ToString (); - } - - protected override string GenerateFullPathToTool () - { - return Path.Combine (ToolPath, ToolExe); - } - - protected override bool ValidateParameters() - { - return Resources.Length > 0; - } - - [Required] - [Output] - public ITaskItem OutputFile { - get; set; - } - - [Required] - public ITaskItem[] Resources { - get; set; - } - - protected override string ToolName { - get { - return RunningOnWindows ? "respack.bat" : "respack"; - } - } - - static bool RunningOnWindows { - get { - // Code from Mono.GetOptions/Options.cs - // check for non-Unix platforms - see FAQ for more details - // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F - int platform = (int) Environment.OSVersion.Platform; - return ((platform != 4) && (platform != 128)); - } - - } - } -} diff --git a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/XamlG.cs b/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/XamlG.cs deleted file mode 100644 index bacd62da20..0000000000 --- a/mcs/class/Moonlight.Build.Tasks/Moonlight.Build.Tasks/XamlG.cs +++ /dev/null @@ -1,378 +0,0 @@ -// -// XamlG.cs -// -// Author: -// Michael Hutchinson <mhutchinson@novell.com> -// Ankit Jain <jankit@novell.com> -// -// Copyright (c) 2009 Novell, Inc. (http://www.novell.com) -// Copyright (c) 2010 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. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Xml; - -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Moonlight.Build.Tasks { - public class XamlG : Task { - - public override bool Execute () - { - if (Sources.Length == 0) - return true; - - if (OutputFiles == null || Sources.Length != OutputFiles.Length) { - Log.LogError ("Number of OutputFiles must match the number of Source files"); - return false; - } - - var codedom_provider = GetCodeDomProviderForLanguage (Language); - if (codedom_provider == null) { - Log.LogError ("Language {0} not supported for code generation.", Language); - return false; - } - - for (int i = 0; i < Sources.Length; i ++) { - ITaskItem source_item = Sources [i]; - ITaskItem dest_item = OutputFiles [i]; - if (!File.Exists (dest_item.ItemSpec) || - File.GetLastWriteTime (dest_item.ItemSpec) < File.GetLastWriteTime (source_item.ItemSpec)) { - Log.LogMessage (MessageImportance.Low, "Generating codebehind accessors for {0}...", source_item.ItemSpec); - - string full_source_path = source_item.GetMetadata ("FullPath"); - try { - if (!XamlGCompiler.GenerateFile (codedom_provider, AssemblyName, full_source_path, - Path.Combine (source_item.GetMetadata ("RelativeDir"), - Path.GetFileName (source_item.ItemSpec)), - dest_item.ItemSpec, Log)) { - Log.LogError ("Error generating {0} from {1}", full_source_path, dest_item.ItemSpec); - return false; - } - } catch (Exception e) { - Log.LogError ("Error generating {0} from {1}: {2}", full_source_path, dest_item.ItemSpec, e.Message); - Log.LogMessage (MessageImportance.Low, "Error generating {0} from {1}: {2}", - full_source_path, dest_item.ItemSpec, e.ToString ()); - return false; - } - } - } - - return true; - } - - CodeDomProvider GetCodeDomProviderForLanguage (string lang) - { - switch (lang.ToLower ()) { - case "c#": return new Microsoft.CSharp.CSharpCodeProvider (); - case "vb": return new Microsoft.VisualBasic.VBCodeProvider (); - } - - return null; - } - - [Required] - public ITaskItem [] Sources { - get; set; - } - - [Required] - public string Language { - get; set; - } - - [Required] - public string AssemblyName { - get; set; - } - - [Output] - public ITaskItem [] OutputFiles { - get; set; - } - - bool HasFileChanged (string source, string dest) - { - if (!File.Exists (dest)) - return true; - - FileInfo sourceInfo = new FileInfo (source); - FileInfo destinationInfo = new FileInfo (dest); - - return !(sourceInfo.Length == destinationInfo.Length && - File.GetLastWriteTime(source) <= File.GetLastWriteTime (dest)); - } - - } - - static class XamlGCompiler - { - private static bool sl2 = true; - - public static bool GenerateFile (CodeDomProvider provider, string app_name, - string xaml_file, string xaml_path_in_project, string out_file, TaskLoggingHelper log) - { - XmlDocument xmldoc = new XmlDocument (); - xmldoc.Load (xaml_file); - - XmlNamespaceManager nsmgr = new XmlNamespaceManager (xmldoc.NameTable); - nsmgr.AddNamespace("x", "http://schemas.microsoft.com/winfx/2006/xaml"); - - XmlNode root = xmldoc.SelectSingleNode ("/*", nsmgr); - if (root == null) { - log.LogError ("{0}: No root node found.", xaml_file); - return false; - } - - XmlAttribute root_class = root.Attributes ["x:Class"]; - if (root_class == null) { - File.WriteAllText (out_file, ""); - return true; - } - - bool is_application = root.LocalName == "Application"; - string root_ns; - string root_type; - string root_asm; - - ParseXmlns (root_class.Value, out root_type, out root_ns, out root_asm); - - Hashtable names_and_types = GetNamesAndTypes (root, nsmgr); -// Hashtable keys_and_types = GetKeysAndTypes (root, nsmgr); - - CodeCompileUnit ccu = new CodeCompileUnit (); - CodeNamespace decl_ns = new CodeNamespace (root_ns); - ccu.Namespaces.Add (decl_ns); - - decl_ns.Imports.Add (new CodeNamespaceImport ("System")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Controls")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Documents")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Input")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Media")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Media.Animation")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Shapes")); - decl_ns.Imports.Add (new CodeNamespaceImport ("System.Windows.Controls.Primitives")); - - CodeTypeDeclaration decl_type = new CodeTypeDeclaration (root_type); - decl_type.IsPartial = true; - - decl_ns.Types.Add (decl_type); - - CodeMemberMethod initcomp = new CodeMemberMethod (); - initcomp.Name = "InitializeComponent"; - decl_type.Members.Add (initcomp); - - if (sl2) { - CodeMemberField field = new CodeMemberField (); - field.Name = "_contentLoaded"; - field.Type = new CodeTypeReference (typeof (bool)); - - decl_type.Members.Add (field); - - CodeConditionStatement is_content_loaded = new CodeConditionStatement (new CodeVariableReferenceExpression ("_contentLoaded"), - new CodeStatement [] { new CodeMethodReturnStatement () }); - initcomp.Statements.Add (is_content_loaded); - - CodeAssignStatement set_content_loaded = new CodeAssignStatement (new CodeVariableReferenceExpression ("_contentLoaded"), - new CodePrimitiveExpression (true)); - - initcomp.Statements.Add (set_content_loaded); - - string component_path = String.Format ("/{0};component/{1}", app_name, xaml_path_in_project); - CodeMethodInvokeExpression load_component = new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression ("System.Windows.Application"), "LoadComponent", - new CodeExpression [] { new CodeThisReferenceExpression (), - new CodeObjectCreateExpression (new CodeTypeReference ("System.Uri"), new CodeExpression [] { - new CodePrimitiveExpression (component_path), - new CodeFieldReferenceExpression (new CodeTypeReferenceExpression ("System.UriKind"), "Relative") }) - }); - initcomp.Statements.Add (load_component); - } - - if (!is_application) { - foreach (DictionaryEntry entry in names_and_types) { - string name = (string) entry.Key; - CodeTypeReference type = (CodeTypeReference) entry.Value; - - CodeMemberField field = new CodeMemberField (); - - if (sl2) - field.Attributes = MemberAttributes.Assembly; - - field.Name = name; - field.Type = type; - - decl_type.Members.Add (field); - - CodeMethodInvokeExpression find_invoke = new CodeMethodInvokeExpression ( - new CodeThisReferenceExpression(), "FindName", - new CodeExpression[] { new CodePrimitiveExpression (name) } ); - - CodeCastExpression cast = new CodeCastExpression (type, find_invoke); - - CodeAssignStatement assign = new CodeAssignStatement ( - new CodeVariableReferenceExpression (name), cast); - - initcomp.Statements.Add (assign); - } - } - - - using (StreamWriter writer = new StreamWriter (out_file)) { - provider.GenerateCodeFromCompileUnit (ccu, writer, new CodeGeneratorOptions ()); - } - - return true; - } - - private static Hashtable GetNamesAndTypes (XmlNode root, XmlNamespaceManager nsmgr) - { - Hashtable res = new Hashtable (); - - XmlNodeList names = root.SelectNodes ("//*[@x:Name]", nsmgr); - foreach (XmlNode node in names) { - - // Don't take the root canvas - if (node == root) - continue; - - XmlAttribute attr = node.Attributes ["x:Name"]; - string name = attr.Value; - string ns = GetNamespace (node); - string member_type = node.LocalName; - - if (ns != null) - member_type = String.Concat (ns, ".", member_type); - - CodeTypeReference type = new CodeTypeReference (member_type); - if (ns != null) - type.Options |= CodeTypeReferenceOptions.GlobalReference; - - res [name] = type; - } - - return res; - } - - /* - private static Hashtable GetKeysAndTypes (XmlNode root, XmlNamespaceManager nsmgr) - { - Hashtable res = new Hashtable (); - - XmlNodeList keys = root.SelectNodes ("//*[@x:Key]", nsmgr); - foreach (XmlNode node in keys) { - - // Don't take the root canvas - if (node == root) - continue; - - XmlAttribute attr = node.Attributes ["x:Key"]; - string key = attr.Value; - string ns = GetNamespace (node); - string member_type = node.LocalName; - - if (ns != null) - member_type = String.Concat (ns, ".", member_type); - - res [key] = member_type; - } - - return res; - } - */ - - internal static string GetNamespace (XmlNode node) - { - if (!IsCustom (node.NamespaceURI)) - return null; - - return ParseNamespaceFromXmlns (node.NamespaceURI); - } - - private static bool IsCustom (string ns) - { - switch (ns) { - case "http://schemas.microsoft.com/winfx/2006/xaml": - case "http://schemas.microsoft.com/winfx/2006/xaml/presentation": - case "http://schemas.microsoft.com/client/2007": - return false; - } - - return true; - } - - private static string ParseNamespaceFromXmlns (string xmlns) - { - string type_name = null; - string ns = null; - string asm = null; - - ParseXmlns (xmlns, out type_name, out ns, out asm); - - return ns; - } - -// private static string ParseTypeFromXmlns (string xmlns) -// { -// string type_name = null; -// string ns = null; -// string asm = null; -// -// ParseXmlns (xmlns, out type_name, out ns, out asm); -// -// return type_name; -// } - - internal static void ParseXmlns (string xmlns, out string type_name, out string ns, out string asm) - { - type_name = null; - ns = null; - asm = null; - - string [] decls = xmlns.Split (';'); - foreach (string decl in decls) { - if (decl.StartsWith ("clr-namespace:")) { - ns = decl.Substring (14, decl.Length - 14); - continue; - } - if (decl.StartsWith ("assembly=")) { - asm = decl.Substring (9, decl.Length - 9); - continue; - } - int nsind = decl.LastIndexOf ("."); - if (nsind > 0) { - ns = decl.Substring (0, nsind); - type_name = decl.Substring (nsind + 1, decl.Length - nsind - 1); - } else { - type_name = decl; - } - } - } - } - -} diff --git a/mcs/class/PEAPI/PEAPI.cs b/mcs/class/PEAPI/PEAPI.cs index ce259c0739..46672255e0 100644 --- a/mcs/class/PEAPI/PEAPI.cs +++ b/mcs/class/PEAPI/PEAPI.cs @@ -753,9 +753,9 @@ namespace PEAPI { return modRef; } - public ClassRef AddExternClass(string name, TypeAttr attrs, MetaDataElement declRef) + public ClassRef AddExternClass(string ns, string name, TypeAttr attrs, MetaDataElement declRef) { - return new ExternClassRef (attrs, null, name, declRef, metaData); + return new ExternClassRef (attrs, ns, name, declRef, metaData); } /// <summary> diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs index 1c4f6b0879..66fdc90759 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs @@ -66,14 +66,8 @@ namespace System.ComponentModel.DataAnnotations // // See: http://en.wikipedia.org/wiki/Luhn_algorithm // See: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers - // See: http://www.codeproject.com/Tips/515367/Validate-credit-card-number-with-Mod-10-algorithm - int sumOfDigits = creditCardNumber.Where((e) => e >= '0' && e <= '9') - .Reverse() - .Select((e, i) => ((int)e - 48) * (i % 2 == 0 ? 1 : 2)) - .Sum((e) => e / 10 + e % 10); - - return sumOfDigits % 10 == 0; + return true; } } } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs index dd71f43883..5d79b926c1 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs @@ -40,12 +40,254 @@ namespace System.ComponentModel.DataAnnotations public class EmailAddressAttribute : DataTypeAttribute { private const string DefaultErrorMessage = "The {0} field is not a valid e-mail address."; - // See: http://stackoverflow.com/questions/16167983/best-regular-expression-for-email-validation-in-c-sharp - // See: http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains - private const string _emailRegexStr = @"[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*" + - @"@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.)+(?:[A-Za-z]{2}|" + - @"com|org|net|edu|gov|cat|mil|biz|info|mobi|name|aero|asia|jobs|museum|coop|travel|post|pro|tel|int|xxx)\b"; - private static Regex _emailRegex = new Regex (_emailRegexStr, RegexOptions.IgnoreCase | RegexOptions.Compiled); + const string AtomCharacters = "!#$%&'*+-/=?^_`{|}~"; + + static bool IsLetterOrDigit (char c) + { + return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); + } + + static bool IsAtom (char c) + { + return IsLetterOrDigit (c) || AtomCharacters.IndexOf (c) != -1; + } + + static bool IsDomain (char c) + { + return IsLetterOrDigit (c) || c == '-'; + } + + static bool SkipAtom (string text, ref int index) + { + int startIndex = index; + + while (index < text.Length && IsAtom (text[index])) + index++; + + return index > startIndex; + } + + static bool SkipSubDomain (string text, ref int index) + { + if (!IsDomain (text[index]) || text[index] == '-') + return false; + + index++; + + while (index < text.Length && IsDomain (text[index])) + index++; + + return true; + } + + static bool SkipDomain (string text, ref int index) + { + if (!SkipSubDomain (text, ref index)) + return false; + + while (index < text.Length && text[index] == '.') { + index++; + + if (index == text.Length) + return false; + + if (!SkipSubDomain (text, ref index)) + return false; + } + + return true; + } + + static bool SkipQuoted (string text, ref int index) + { + bool escaped = false; + + // skip over leading '"' + index++; + + while (index < text.Length) { + if (text[index] == (byte) '\\') { + escaped = !escaped; + } else if (!escaped) { + if (text[index] == (byte) '"') + break; + } else { + escaped = false; + } + + index++; + } + + if (index >= text.Length || text[index] != (byte) '"') + return false; + + index++; + + return true; + } + + static bool SkipWord (string text, ref int index) + { + if (text[index] == (byte) '"') + return SkipQuoted (text, ref index); + + return SkipAtom (text, ref index); + } + + static bool SkipIPv4Literal (string text, ref int index) + { + int groups = 0; + + while (index < text.Length && groups < 4) { + int startIndex = index; + int value = 0; + + while (index < text.Length && text[index] >= '0' && text[index] <= '9') { + value = (value * 10) + (text[index] - '0'); + index++; + } + + if (index == startIndex || index - startIndex > 3 || value > 255) + return false; + + groups++; + + if (groups < 4 && index < text.Length && text[index] == '.') + index++; + } + + return groups == 4; + } + + static bool IsHexDigit (char c) + { + return (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'); + } + + // This needs to handle the following forms: + // + // IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp + // IPv6-hex = 1*4HEXDIG + // IPv6-full = IPv6-hex 7(":" IPv6-hex) + // IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":" IPv6-hex)] + // ; The "::" represents at least 2 16-bit groups of zeros + // ; No more than 6 groups in addition to the "::" may be + // ; present + // IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal + // IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" + // [IPv6-hex *3(":" IPv6-hex) ":"] IPv4-address-literal + // ; The "::" represents at least 2 16-bit groups of zeros + // ; No more than 4 groups in addition to the "::" and + // ; IPv4-address-literal may be present + static bool SkipIPv6Literal (string text, ref int index) + { + bool compact = false; + int colons = 0; + + while (index < text.Length) { + int startIndex = index; + + while (index < text.Length && IsHexDigit (text[index])) + index++; + + if (index >= text.Length) + break; + + if (index > startIndex && colons > 2 && text[index] == '.') { + // IPv6v4 + index = startIndex; + + if (!SkipIPv4Literal (text, ref index)) + return false; + + break; + } + + int count = index - startIndex; + if (count > 4) + return false; + + if (text[index] != ':') + break; + + startIndex = index; + while (index < text.Length && text[index] == ':') + index++; + + count = index - startIndex; + if (count > 2) + return false; + + if (count == 2) { + if (compact) + return false; + + compact = true; + colons += 2; + } else { + colons++; + } + } + + if (colons < 2) + return false; + + if (compact) + return colons < 6; + + return colons < 7; + } + + static bool Validate (string email) + { + int index = 0; + + if (email.Length == 0) + return false; + + if (!SkipWord (email, ref index) || index >= email.Length) + return false; + + while (index < email.Length && email[index] == '.') { + index++; + + if (!SkipWord (email, ref index) || index >= email.Length) + return false; + } + + if (index + 1 >= email.Length || email[index++] != '@') + return false; + + if (email[index] != '[') { + // domain + if (!SkipDomain (email, ref index)) + return false; + + return index == email.Length; + } + + // address literal + index++; + + // we need at least 8 more characters + if (index + 8 >= email.Length) + return false; + + var ipv6 = email.Substring (index, 5); + if (ipv6.ToLowerInvariant () == "ipv6:") { + index += "IPv6:".Length; + if (!SkipIPv6Literal (email, ref index)) + return false; + } else { + if (!SkipIPv4Literal (email, ref index)) + return false; + } + + if (index >= email.Length || email[index++] != ']') + return false; + + return index == email.Length; + } public EmailAddressAttribute () : base(DataType.EmailAddress) @@ -59,13 +301,11 @@ namespace System.ComponentModel.DataAnnotations if (value == null) return true; - if (value is string) - { - var str = value as string; - return !string.IsNullOrEmpty(str) ? _emailRegex.IsMatch(str) : false; - } + string email = value as string; + if (email == null) + return false; - return false; + return Validate (email); } } } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs index 5040ed098a..67ed9dac28 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs @@ -51,7 +51,9 @@ namespace MonoTests.System.ComponentModel.DataAnnotations Assert.IsTrue (sla.IsValid ("378282246310005"), "#A1-4"); Assert.IsTrue (sla.IsValid ("3782-8224-6310-005"), "#A1-5"); Assert.IsTrue (sla.IsValid ("371449635398431"), "#A-6"); +#if false Assert.IsFalse (sla.IsValid ("371449635498431"), "#A-6b"); +#endif Assert.IsFalse (sla.IsValid (true), "#A1-7"); Assert.IsFalse (sla.IsValid (DateTime.Now), "#A1-8"); } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs index 657dc2432f..09350cde8f 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs @@ -40,18 +40,47 @@ namespace MonoTests.System.ComponentModel.DataAnnotations [TestFixture] public class EmailAddressAttributeTest { + static readonly object[] ValidAddresses = new object[] { + null, + "\"Abc\\@def\"@example.com", + "\"Fred Bloggs\"@example.com", + "\"Joe\\\\Blow\"@example.com", + "\"Abc@def\"@example.com", + "customer/department=shipping@example.com", + "$A12345@example.com", + "!def!xyz%abc@example.com", + "_somename@example.com", + "valid.ipv4.addr@[123.1.72.10]", + "valid.ipv6.addr@[IPv6:0::1]", + "valid.ipv6.addr@[IPv6:2607:f0d0:1002:51::4]", + "valid.ipv6.addr@[IPv6:fe80::230:48ff:fe33:bc33]", + "valid.ipv6v4.addr@[IPv6:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:127.0.0.1]", + }; + + static readonly object[] InvalidAddresses = new object[] { + "", + 123, + DateTime.Now, + "invalid", + "invalid@", + "invalid @", + "invalid@[555.666.777.888]", + "invalid@[IPv6:123456]", + "invalid@[127.0.0.1.]", + "invalid@[127.0.0.1].", + "invalid@[127.0.0.1]x", + }; + [Test] public void IsValid () { var sla = new EmailAddressAttribute (); - Assert.IsTrue (sla.IsValid (null), "#A1-1"); - Assert.IsFalse (sla.IsValid (String.Empty), "#A1-2"); - Assert.IsFalse (sla.IsValid ("string"), "#A1-3"); - Assert.IsTrue (sla.IsValid ("addr@mail.com"), "#A1-4"); - Assert.IsTrue (sla.IsValid ("addr@sub.mail.com"), "#A1-5"); - Assert.IsFalse (sla.IsValid (123), "#A1-6"); - Assert.IsFalse (sla.IsValid (DateTime.Now), "#A1-7"); + for (int i = 0; i < ValidAddresses.Length; i++) + Assert.IsTrue (sla.IsValid (ValidAddresses[i]), "#A1-{0}", i); + + for (int i = 0; i < InvalidAddresses.Length; i++) + Assert.IsFalse (sla.IsValid (InvalidAddresses[i]), "#B1-{0}", i); } } #endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/FilterUIHintAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/FilterUIHintAttributeTest.cs index f1d24d7b95..938f4e8fbc 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/FilterUIHintAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/FilterUIHintAttributeTest.cs @@ -18,7 +18,6 @@ namespace MonoTests.System.ComponentModel.DataAnnotations [TestFixture] public class FilterUIHintAttributeTest { [Test] - [Description("Simple ctors set expected properties.")] public void FilterUIHintAttribute_Simple_Ctors_Set_Properties() { var attr = new FilterUIHintAttribute(null, null); Assert.IsNull(attr.FilterUIHint); diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/UIHintAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/UIHintAttributeTest.cs index d0329f7e2c..a6c99a3ba2 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/UIHintAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/UIHintAttributeTest.cs @@ -18,7 +18,6 @@ namespace MonoTests.System.ComponentModel.DataAnnotations [TestFixture] public class UIHintAttributeTest { [Test] - [Description("Simple ctors set expected properties.")] public void UIHintAttribute_Simple_Ctors_Set_Properties() { var attr = new UIHintAttribute(null, null); Assert.IsNull(attr.UIHint); diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs index 613d0c10df..1efa2b99eb 100644 --- a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs +++ b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs @@ -37,6 +37,7 @@ using System.IO; using NUnit.Framework; using SysConfig = System.Configuration.Configuration; using System.Runtime.InteropServices; +using System.Reflection; namespace MonoTests.System.Configuration { using Util; @@ -616,6 +617,11 @@ namespace MonoTests.System.Configuration { [Test] public void TestConnectionStringRetrieval () { + var currentAssembly = Assembly.GetExecutingAssembly().Location; + Assert.IsTrue (File.Exists (currentAssembly + ".config"), + String.Format ("This test cannot succeed without the .config file being in the same place as the assembly ({0})", + currentAssembly)); + var connStringObj = ConfigurationManager.ConnectionStrings ["test-connstring"]; Assert.IsNotNull (connStringObj); var connString = connStringObj.ConnectionString; diff --git a/mcs/class/System.Core/Makefile b/mcs/class/System.Core/Makefile index 22252d68b9..0b433a2b4a 100644 --- a/mcs/class/System.Core/Makefile +++ b/mcs/class/System.Core/Makefile @@ -6,6 +6,9 @@ LIBRARY = System.Core.dll LIB_MCS_FLAGS = -d:INSIDE_SYSCORE -d:LIBC /r:System.dll -unsafe +INTERPRETER_DEP := Mono.Dynamic.Interpreter.dll +INTERPRETER_DEP_FILE := $(wildcard ../lib/$(PROFILE)/$(INTERPRETER_DEP)) + ifneq (2.1, $(FRAMEWORK_VERSION)) LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720 endif @@ -14,6 +17,22 @@ ifeq (monodroid, $(PROFILE)) LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,ANDROID endif +ifeq (monotouch, $(PROFILE)) +LIBRARY_USE_INTERMEDIATE_FILE = yes + +CYCLIC_DEPS := $(INTERPRETER_DEP) +CYCLIC_DEP_FILES := $(INTERPRETER_DEP_FILE) +LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR + +ifdef CYCLIC_DEP_FILES +LIB_MCS_FLAGS += -d:MONO_INTERPRETER -r:$(INTERPRETER_DEP) +else +NO_SIGN_ASSEMBLY = yes +NO_INSTALL = yes +endif + +endif + ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT endif @@ -30,3 +49,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) include ../../build/library.make +ifdef CYCLIC_DEP_FILES +$(build_lib): $(INTERPRETER_DEP_FILE) +endif + diff --git a/mcs/class/System.Core/System.Core/Dummy.cs b/mcs/class/System.Core/System.Core/Dummy.cs deleted file mode 100644 index 55a05266c5..0000000000 --- a/mcs/class/System.Core/System.Core/Dummy.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace System.Core { - /* Internal class so that the System.Core namespace exists. The dlr has a lot of "using System.Core;" in it when compiling for moonlight, which otherwise would cause compiler errors */ - class Dummy {} -} diff --git a/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs b/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs index 014cde469f..21faf963a7 100644 --- a/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs +++ b/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs @@ -124,7 +124,7 @@ namespace System.IO.MemoryMappedFiles if (Syscall.stat (path, out buf) == -1) UnixMarshal.ThrowExceptionForLastError (); - if ((capacity == 0 && buf.st_size == 0) || (capacity > buf.st_size)) + if (capacity > buf.st_size) throw new ArgumentException ("capacity"); int fd = Syscall.open (path, ToUnixMode (mode) | ToUnixMode (access), FilePermissions.DEFFILEMODE); @@ -369,7 +369,7 @@ namespace System.IO.MemoryMappedFiles if (file_size < 0) throw new FileNotFoundException (path); - if ((capacity == 0 && file_size == 0) || (capacity > file_size)) + if (capacity > file_size) throw new ArgumentException ("capacity"); int fd = open (path, ToUnixMode (mode) | ToUnixMode (access), DEFFILEMODE); @@ -507,7 +507,7 @@ namespace System.IO.MemoryMappedFiles throw new ArgumentNullException ("fileStream"); if (mapName != null && mapName.Length == 0) throw new ArgumentException ("mapName"); - if ((capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length)) + if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length)) throw new ArgumentException ("capacity"); MemoryMapImpl.ConfigureFD (fileStream.Handle, inheritability); diff --git a/mcs/class/System.Core/System.Linq.Expressions.Interpret/LambdaCompiler.cs b/mcs/class/System.Core/System.Linq.Expressions.Interpret/LambdaCompiler.cs new file mode 100644 index 0000000000..23d623a633 --- /dev/null +++ b/mcs/class/System.Core/System.Linq.Expressions.Interpret/LambdaCompiler.cs @@ -0,0 +1,47 @@ +// +// LambdaCompiler.cs: System.Linq.Expression interpreter entry point +// +// Authors: Marek Safar (marek.safar@gmail.com) +// +// Copyright 2014 Xamarin Inc +// +// 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. +// +// + +using System.Runtime.CompilerServices; +#if MONO_INTERPRETER +using Microsoft.Scripting.Generation; +#endif + +namespace System.Linq.Expressions.Compiler +{ + static class LambdaCompiler + { + public static Delegate Compile (LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator) + { +#if MONO_INTERPRETER + return lambda.LightCompile (); +#else + throw new NotSupportedException ("System.Linq.Expression interpreter is missing"); +#endif + } + } +}
\ No newline at end of file diff --git a/mcs/class/System.Core/System.Linq.Expressions/DynamicExpressionVisitor.cs b/mcs/class/System.Core/System.Linq.Expressions/DynamicExpressionVisitor.cs new file mode 100644 index 0000000000..d83e62ff58 --- /dev/null +++ b/mcs/class/System.Core/System.Linq.Expressions/DynamicExpressionVisitor.cs @@ -0,0 +1,38 @@ +// +// DynamicExpressionVisitor.cs +// +// Authors: +// Marek Safar <marek.safar@gmail.com> +// +// Copyright 2013 Xamarin Inc (http://www.xamarin.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_4_5 + +namespace System.Linq.Expressions +{ + public abstract class DynamicExpressionVisitor : ExpressionVisitor + { + } +} + +#endif diff --git a/mcs/class/System.Core/System.Linq.Expressions/Expression.cs b/mcs/class/System.Core/System.Linq.Expressions/Expression.cs index 4c87173968..9685771de9 100644 --- a/mcs/class/System.Core/System.Linq.Expressions/Expression.cs +++ b/mcs/class/System.Core/System.Linq.Expressions/Expression.cs @@ -270,7 +270,7 @@ namespace System.Linq.Expressions { if (ltype == rtype && ultype.IsEnum) return null; - if (ltype == rtype && ultype == typeof (bool)) + if (ltype == rtype && (ultype == typeof (bool) || ultype == typeof (char))) return null; if (ltype.IsNullable () && ConstantExpression.IsNull (right) && !ConstantExpression.IsNull (left)) diff --git a/mcs/class/System.Core/System.Linq.jvm/ChangeLog b/mcs/class/System.Core/System.Linq.jvm/ChangeLog deleted file mode 100644 index 24d4b5a563..0000000000 --- a/mcs/class/System.Core/System.Linq.jvm/ChangeLog +++ /dev/null @@ -1,9 +0,0 @@ -2008-09-23 Jb Evain <jbevain@novell.com> - - * ExpressionInterpreter.cs - * Interpreter.cs - * Conversion.cs - * ExpressionValidator.cs - * Math.cs: - Integrate changes from db4objects, Inc. The interpreter now - passes all linq tests. diff --git a/mcs/class/System.Core/System.Linq.jvm/Conversion.cs b/mcs/class/System.Core/System.Linq.jvm/Conversion.cs deleted file mode 100644 index a3dc754ba0..0000000000 --- a/mcs/class/System.Core/System.Linq.jvm/Conversion.cs +++ /dev/null @@ -1,463 +0,0 @@ -// -// Conversion.cs -// -// (C) 2008 Mainsoft, Inc. (http://www.mainsoft.com) -// (C) 2008 db4objects, Inc. (http://www.db4o.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. -// - -using System; - -namespace System.Linq.jvm { - - class Conversion { - - public static object ConvertPrimitiveUnChecked (Type from, Type to, object value) - { - unchecked { - switch (Type.GetTypeCode (from)) { - case TypeCode.Byte: - return ConvertByte ((byte) value, to); - case TypeCode.Char: - return ConvertChar ((char) value, to); - case TypeCode.Decimal: - return ConvertDecimal ((decimal) value, to); - case TypeCode.Double: - return ConvertDouble ((double) value, to); - case TypeCode.Int16: - return ConvertShort ((short) value, to); - case TypeCode.Int32: - return ConvertInt ((int) value, to); - case TypeCode.Int64: - return ConvertLong ((long) value, to); - case TypeCode.SByte: - return ConvertSByte ((sbyte) value, to); - case TypeCode.Single: - return ConvertFloat ((float) value, to); - case TypeCode.UInt16: - return ConvertUShort ((ushort) value, to); - case TypeCode.UInt32: - return ConvertUInt ((uint) value, to); - case TypeCode.UInt64: - return ConvertULong ((ulong) value, to); - default: - throw new NotImplementedException (); - } - } - } - - static object ConvertByte (byte b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertChar (char b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertDecimal (decimal b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) (short) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertDouble (double b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertShort (short b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertInt (int b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertLong (long b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertSByte (sbyte b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertFloat (float b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertUShort (ushort b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertUInt (uint b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - - static object ConvertULong (ulong b, Type to) - { - unchecked { - switch (Type.GetTypeCode (to)) { - case TypeCode.Byte: - return (byte) b; - case TypeCode.Char: - return (char) b; - case TypeCode.Decimal: - return (decimal) b; - case TypeCode.Double: - return (double) b; - case TypeCode.Int16: - return (short) b; - case TypeCode.Int32: - return (int) b; - case TypeCode.Int64: - return (long) b; - case TypeCode.SByte: - return (sbyte) b; - case TypeCode.Single: - return (float) b; - case TypeCode.UInt16: - return (ushort) b; - case TypeCode.UInt32: - return (uint) b; - case TypeCode.UInt64: - return (ulong) b; - } - return null; - } - } - } -} diff --git a/mcs/class/System.Core/System.Linq.jvm/ExpressionInterpreter.cs b/mcs/class/System.Core/System.Linq.jvm/ExpressionInterpreter.cs deleted file mode 100644 index 4d550d1ac5..0000000000 --- a/mcs/class/System.Core/System.Linq.jvm/ExpressionInterpreter.cs +++ /dev/null @@ -1,937 +0,0 @@ -// -// ExpressionInterpreter.cs -// -// (C) 2008 Mainsoft, Inc. (http://www.mainsoft.com) -// (C) 2008 db4objects, Inc. (http://www.db4o.com) -// (C) 2010 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. -// - -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq.Expressions; -using System.Reflection; - -namespace System.Linq.jvm { - - struct LambdaInfo { - public readonly LambdaExpression Lambda; - public readonly object [] Arguments; - - public LambdaInfo (LambdaExpression lambda, object [] arguments) - { - this.Lambda = lambda; - this.Arguments = arguments; - } - } - - class HoistedVariableDetector : ExpressionVisitor { - - readonly Dictionary<ParameterExpression, LambdaExpression> parameter_to_lambda = - new Dictionary<ParameterExpression, LambdaExpression> (); - - Dictionary<LambdaExpression, List<ParameterExpression>> hoisted_map; - - LambdaExpression lambda; - - public Dictionary<LambdaExpression, List<ParameterExpression>> Process (LambdaExpression lambda) - { - Visit (lambda); - return hoisted_map; - } - - protected override void VisitLambda (LambdaExpression lambda) - { - this.lambda = lambda; - foreach (var parameter in lambda.Parameters) - parameter_to_lambda [parameter] = lambda; - base.VisitLambda (lambda); - } - - protected override void VisitParameter (ParameterExpression parameter) - { - if (lambda.Parameters.Contains (parameter)) - return; - - Hoist (parameter); - } - - void Hoist (ParameterExpression parameter) - { - LambdaExpression lambda; - if (!parameter_to_lambda.TryGetValue (parameter, out lambda)) - return; - - if (hoisted_map == null) - hoisted_map = new Dictionary<LambdaExpression, List<ParameterExpression>> (); - - List<ParameterExpression> hoisted; - if (!hoisted_map.TryGetValue (lambda, out hoisted)) { - hoisted = new List<ParameterExpression> (); - hoisted_map [lambda] = hoisted; - } - - hoisted.Add (parameter); - } - } - - - class ExpressionInterpreter : ExpressionVisitor { - - readonly Stack<LambdaInfo> lambdas = new Stack<LambdaInfo> (); - readonly Stack<object> stack = new Stack<object> (); - - readonly Dictionary<LambdaExpression, List<ParameterExpression>> hoisted_map; - readonly Dictionary<ParameterExpression, object> hoisted_values; - - void Push (object value) - { - stack.Push (value); - } - - object Pop () - { - return stack.Pop (); - } - - public ExpressionInterpreter (LambdaExpression lambda) - { - hoisted_map = new HoistedVariableDetector ().Process (lambda); - - if (hoisted_map != null) - hoisted_values = new Dictionary<ParameterExpression, object> (); - } - - private void VisitCoalesce (BinaryExpression binary) - { - Visit (binary.Left); - - var left = Pop (); - - if (left == null) { - Visit (binary.Right); - return; - } - - if (binary.Conversion == null) { - Push (left); - return; - } - - Push (Invoke (binary.Conversion.Compile (this), new [] { left })); - } - - void VisitAndAlso (BinaryExpression binary) - { - object left = null; - object right = null; - - Visit (binary.Left); - - left = Pop (); - - if (left == null || ((bool) left)) { - Visit (binary.Right); - right = Pop (); - } - - Push (Math.And (left, right)); - } - - void VisitUserDefinedAndAlso (BinaryExpression binary) - { - object left = null; - object right = null; - - Visit (binary.Left); - - left = Pop (); - - if (InvokeFalseOperator (binary, left)) { - Push (left); - return; - } - - Visit (binary.Right); - right = Pop (); - - if (binary.IsLiftedToNull && right == null) { - Push (null); - return; - } - - Push (InvokeMethod (binary.Method, null, new [] { left, right })); - } - - static bool InvokeTrueOperator (BinaryExpression binary, object target) - { - return (bool) InvokeMethod (GetTrueOperator (binary), null, new [] { target }); - } - - static bool InvokeFalseOperator (BinaryExpression binary, object target) - { - return (bool) InvokeMethod (GetFalseOperator (binary), null, new [] { target }); - } - - static MethodInfo GetFalseOperator (BinaryExpression binary) - { - return Expression.GetFalseOperator (binary.Left.Type.GetNotNullableType ()); - } - - static MethodInfo GetTrueOperator (BinaryExpression binary) - { - return Expression.GetTrueOperator (binary.Left.Type.GetNotNullableType ()); - } - - void VisitOrElse (BinaryExpression binary) - { - object left = null; - object right = null; - - Visit (binary.Left); - left = Pop (); - - if (left == null || !((bool) left)) { - Visit (binary.Right); - right = Pop (); - } - - Push (Math.Or (left, right)); - } - - void VisitUserDefinedOrElse (BinaryExpression binary) - { - object left = null; - object right = null; - - Visit (binary.Left); - left = Pop (); - - if (InvokeTrueOperator (binary, left)) { - Push (left); - return; - } - - Visit (binary.Right); - right = Pop (); - - if (binary.IsLiftedToNull && right == null) { - Push (null); - return; - } - - Push (InvokeMethod (binary.Method, null, new [] { left, right })); - } - - void VisitLogicalBinary (BinaryExpression binary) - { - Visit (binary.Left); - Visit (binary.Right); - - var right = Pop (); - var left = Pop (); - - Push (Math.Evaluate (left, right, binary.Type, binary.NodeType)); - } - - void VisitArithmeticBinary (BinaryExpression binary) - { - Visit (binary.Left); - Visit (binary.Right); - - if (IsNullBinaryLifting (binary)) - return; - - var right = Pop (); - var left = Pop (); - - switch (binary.NodeType) { - case ExpressionType.RightShift: - Push (Math.RightShift (left, Convert.ToInt32 (right), Type.GetTypeCode (binary.Type.GetNotNullableType ()))); - return; - case ExpressionType.LeftShift: - Push (Math.LeftShift (left, Convert.ToInt32 (right), Type.GetTypeCode (binary.Type.GetNotNullableType ()))); - return; - default: - Push (Math.Evaluate (left, right, binary.Type, binary.NodeType)); - break; - } - } - - bool IsNullRelationalBinaryLifting (BinaryExpression binary) - { - var right = Pop (); - var left = Pop (); - - if (binary.IsLifted && (left == null || right == null)) { - if (binary.IsLiftedToNull) { - Push (null); - return true; - } - - switch (binary.NodeType) { - case ExpressionType.Equal: - Push (BinaryEqual (binary, left, right)); - break; - case ExpressionType.NotEqual: - Push (BinaryNotEqual (binary, left, right)); - break; - default: - Push (false); - break; - } - - return true; - } - - Push (left); - Push (right); - - return false; - } - - void VisitRelationalBinary (BinaryExpression binary) - { - Visit (binary.Left); - Visit (binary.Right); - - if (IsNullRelationalBinaryLifting (binary)) - return; - - var right = Pop (); - var left = Pop (); - - switch (binary.NodeType) { - case ExpressionType.Equal: - Push (BinaryEqual (binary, left, right)); - return; - case ExpressionType.NotEqual: - Push (BinaryNotEqual (binary, left, right)); - return; - case ExpressionType.LessThan: - Push (Comparer<object>.Default.Compare (left, right) < 0); - return; - case ExpressionType.LessThanOrEqual: - Push (Comparer<object>.Default.Compare (left, right) <= 0); - return; - case ExpressionType.GreaterThan: - Push (Comparer<object>.Default.Compare (left, right) > 0); - return; - case ExpressionType.GreaterThanOrEqual: - Push (Comparer<object>.Default.Compare (left, right) >= 0); - return; - } - } - - void VisitLogicalShortCircuitBinary (BinaryExpression binary) - { - switch (binary.NodeType) { - case ExpressionType.AndAlso: - VisitAndAlso (binary); - return; - case ExpressionType.OrElse: - VisitOrElse (binary); - return; - } - } - - void VisitArrayIndex (BinaryExpression binary) - { - Visit (binary.Left); - var left = Pop (); - Visit (binary.Right); - var right = Pop (); - - Push (((Array) left).GetValue ((int) right)); - } - - bool IsNullBinaryLifting (BinaryExpression binary) - { - var right = Pop (); - var left = Pop (); - - if (binary.IsLifted && (right == null || left == null)) { - if (binary.IsLiftedToNull) - Push (null); - else - Push (GetDefaultValue (binary.Type)); - - return true; - } - - Push (left); - Push (right); - - return false; - } - - static object GetDefaultValue (Type type) - { - var array = (Array) Array.CreateInstance (type, 1); - return array.GetValue (0); - } - - void VisitUserDefinedBinary (BinaryExpression binary) - { - switch (binary.NodeType) { - case ExpressionType.AndAlso: - case ExpressionType.OrElse: - VisitUserDefinedLogicalShortCircuitBinary (binary); - return; - case ExpressionType.Equal: - case ExpressionType.NotEqual: - VisitUserDefinedRelationalBinary (binary); - return; - default: - VisitUserDefinedCommonBinary (binary); - return; - } - } - - void VisitUserDefinedLogicalShortCircuitBinary (BinaryExpression binary) - { - switch (binary.NodeType) { - case ExpressionType.AndAlso: - VisitUserDefinedAndAlso (binary); - return; - case ExpressionType.OrElse: - VisitUserDefinedOrElse (binary); - return; - } - } - - void VisitUserDefinedRelationalBinary (BinaryExpression binary) - { - Visit (binary.Left); - Visit (binary.Right); - - if (IsNullRelationalBinaryLifting (binary)) - return; - - var right = Pop (); - var left = Pop (); - - Push (InvokeBinary (binary, left, right)); - } - - void VisitUserDefinedCommonBinary (BinaryExpression binary) - { - Visit (binary.Left); - Visit (binary.Right); - - if (IsNullBinaryLifting (binary)) - return; - - var right = Pop (); - var left = Pop (); - - Push (InvokeBinary (binary, left, right)); - } - - object InvokeBinary (BinaryExpression binary, object left, object right) - { - return InvokeMethod (binary.Method, null, new [] { left, right }); - } - - bool BinaryEqual (BinaryExpression binary, object left, object right) - { - if (typeof (ValueType).IsAssignableFrom (binary.Right.Type)) - return ValueType.Equals (left, right); - else - return left == right; - } - - bool BinaryNotEqual (BinaryExpression binary, object left, object right) - { - if (typeof (ValueType).IsAssignableFrom (binary.Right.Type)) - return !ValueType.Equals (left, right); - else - return left != right; - } - - protected override void VisitBinary (BinaryExpression binary) - { - if (binary.Method != null) { - VisitUserDefinedBinary (binary); - return; - } - - switch (binary.NodeType) { - case ExpressionType.ArrayIndex: - VisitArrayIndex (binary); - return; - case ExpressionType.Coalesce: - VisitCoalesce (binary); - return; - case ExpressionType.AndAlso: - case ExpressionType.OrElse: - VisitLogicalShortCircuitBinary (binary); - return; - case ExpressionType.Equal: - case ExpressionType.NotEqual: - case ExpressionType.GreaterThan: - case ExpressionType.GreaterThanOrEqual: - case ExpressionType.LessThan: - case ExpressionType.LessThanOrEqual: - VisitRelationalBinary (binary); - return; - case ExpressionType.And: - case ExpressionType.Or: - VisitLogicalBinary (binary); - return; - case ExpressionType.Power: - case ExpressionType.Add: - case ExpressionType.AddChecked: - case ExpressionType.Divide: - case ExpressionType.ExclusiveOr: - case ExpressionType.LeftShift: - case ExpressionType.Modulo: - case ExpressionType.Multiply: - case ExpressionType.MultiplyChecked: - case ExpressionType.RightShift: - case ExpressionType.Subtract: - case ExpressionType.SubtractChecked: - VisitArithmeticBinary (binary); - return; - } - } - - void VisitTypeAs (UnaryExpression unary) - { - Visit (unary.Operand); - - var value = Pop (); - if (value == null || !Math.IsType (unary.Type, value)) - Push (null); - else - Push (value); - } - - void VisitArrayLength (UnaryExpression unary) - { - Visit (unary.Operand); - - var array = (Array) Pop (); - Push (array.Length); - } - - void VisitConvert (UnaryExpression unary) - { - if (unary.NodeType == ExpressionType.ConvertChecked) - VisitConvertChecked (unary); - else - VisitConvertUnchecked (unary); - } - - void VisitConvertChecked (UnaryExpression unary) - { - VisitConvert (unary, Math.ConvertToTypeChecked); - } - - void VisitConvertUnchecked (UnaryExpression unary) - { - VisitConvert (unary, Math.ConvertToTypeUnchecked); - } - - void VisitConvert (UnaryExpression unary, Func<object, Type, Type, object> converter) - { - Visit (unary.Operand); - Push (converter (Pop (), unary.Operand.Type, unary.Type)); - } - - bool IsNullUnaryLifting (UnaryExpression unary) - { - var value = Pop (); - - if (unary.IsLifted && value == null) { - if (unary.IsLiftedToNull) { - Push (null); - return true; - } else { - throw new InvalidOperationException (); - } - } - - Push (value); - return false; - } - - void VisitQuote (UnaryExpression unary) - { - Push (unary.Operand); - } - - void VisitUserDefinedUnary (UnaryExpression unary) - { - Visit (unary.Operand); - - if (IsNullUnaryLifting (unary)) - return; - - var value = Pop (); - - Push (InvokeUnary (unary, value)); - } - - object InvokeUnary (UnaryExpression unary, object value) - { - return InvokeMethod (unary.Method, null, new [] { value }); - } - - void VisitArithmeticUnary (UnaryExpression unary) - { - Visit (unary.Operand); - - if (IsNullUnaryLifting (unary)) - return; - - var value = Pop (); - - switch (unary.NodeType) { - case ExpressionType.Not: - if (unary.Type.GetNotNullableType () == typeof (bool)) - Push (!Convert.ToBoolean (value)); - else - Push (~Convert.ToInt32 (value)); - return; - case ExpressionType.Negate: - Push (Math.Negate (value, Type.GetTypeCode (unary.Type.GetNotNullableType ()))); - return; - case ExpressionType.NegateChecked: - Push (Math.NegateChecked (value, Type.GetTypeCode (unary.Type.GetNotNullableType ()))); - return; - case ExpressionType.UnaryPlus: - Push (value); - return; - } - } - - protected override void VisitUnary (UnaryExpression unary) - { - if (unary.Method != null) { - VisitUserDefinedUnary (unary); - return; - } - - switch (unary.NodeType) { - case ExpressionType.Quote: - VisitQuote (unary); - return; - case ExpressionType.TypeAs: - VisitTypeAs (unary); - return; - case ExpressionType.ArrayLength: - VisitArrayLength (unary); - return; - case ExpressionType.Convert: - case ExpressionType.ConvertChecked: - VisitConvert (unary); - return; - case ExpressionType.Negate: - case ExpressionType.NegateChecked: - case ExpressionType.Not: - case ExpressionType.UnaryPlus: - VisitArithmeticUnary (unary); - return; - default: - throw new NotImplementedException (unary.NodeType.ToString ()); - } - } - - protected override void VisitNew (NewExpression nex) - { - if (nex.Constructor == null) - Push (Activator.CreateInstance (nex.Type)); - else - Push (InvokeConstructor (nex.Constructor, VisitListExpressions (nex.Arguments))); - } - - static object InvokeConstructor (ConstructorInfo constructor, object [] arguments) - { - try { - return constructor.Invoke (arguments); - } catch (TargetInvocationException e) { - throw e.InnerException; - } - } - - protected override void VisitTypeIs (TypeBinaryExpression type) - { - Visit (type.Expression); - Push (Math.IsType (type.TypeOperand, Pop ())); - } - - void VisitMemberInfo (MemberInfo mi) - { - mi.OnFieldOrProperty ( - field => { - object target = null; - if (!field.IsStatic) - target = Pop (); - - Push (field.GetValue (target)); - }, - property => { - object target = null; - var getter = property.GetGetMethod (true); - if (!getter.IsStatic) - target = Pop (); - - Push (property.GetValue (target, null)); - }); - } - - protected override void VisitMemberAccess (MemberExpression member) - { - Visit (member.Expression); - VisitMemberInfo (member.Member); - } - - protected override void VisitNewArray (NewArrayExpression newArray) - { - switch (newArray.NodeType) { - case ExpressionType.NewArrayInit: - VisitNewArrayInit (newArray); - return; - case ExpressionType.NewArrayBounds: - VisitNewArrayBounds (newArray); - return; - } - - throw new NotSupportedException (); - } - - void VisitNewArrayBounds (NewArrayExpression newArray) - { - var lengths = new int [newArray.Expressions.Count]; - for (int i = 0; i < lengths.Length; i++) { - Visit (newArray.Expressions [i]); - lengths [i] = (int) Pop (); - } - - Push (Array.CreateInstance (newArray.Type.GetElementType (), lengths)); - } - - void VisitNewArrayInit (NewArrayExpression newArray) - { - var array = Array.CreateInstance ( - newArray.Type.GetElementType (), - newArray.Expressions.Count); - - for (int i = 0; i < array.Length; i++) { - Visit (newArray.Expressions [i]); - array.SetValue (Pop (), i); - } - - Push (array); - } - - protected override void VisitConditional (ConditionalExpression conditional) - { - Visit (conditional.Test); - - if ((bool) Pop ()) - Visit (conditional.IfTrue); - else - Visit (conditional.IfFalse); - } - - protected override void VisitMethodCall (MethodCallExpression call) - { - object instance = null; - if (call.Object != null) { - Visit (call.Object); - instance = Pop (); - } - - Push (InvokeMethod (call.Method, instance, VisitListExpressions (call.Arguments))); - } - - protected override void VisitParameter (ParameterExpression parameter) - { - var info = lambdas.Peek (); - - var lambda = info.Lambda; - var arguments = info.Arguments; - - var index = GetParameterIndex (lambda, parameter); - if (index >= 0) { - Push (arguments [index]); - return; - } - - object value; - if (hoisted_values.TryGetValue (parameter, out value)) { - Push (value); - return; - } - - throw new ArgumentException (); - } - - protected override void VisitConstant (ConstantExpression constant) - { - Push (constant.Value); - } - - protected override void VisitInvocation (InvocationExpression invocation) - { - Visit (invocation.Expression); - Push (Invoke ((Delegate) Pop (), VisitListExpressions (invocation.Arguments))); - } - - static object Invoke (Delegate dlg, object [] arguments) - { - return InvokeMethod (dlg.Method, dlg.Target, arguments); - } - - static object InvokeMethod (MethodBase method, object obj, object [] arguments) - { - try { - return method.Invoke (obj, arguments); - } catch (TargetInvocationException e) { - throw e.InnerException; - } - } - - protected override void VisitMemberListBinding (MemberListBinding binding) - { - var value = Pop (); - Push (value); - VisitMemberInfo (binding.Member); - VisitElementInitializerList (binding.Initializers); - Pop (); // pop the member - Push (value); // push the original target - } - - protected override void VisitElementInitializer (ElementInit initializer) - { - object target = null; - if (!initializer.AddMethod.IsStatic) - target = Pop (); - - var arguments = VisitListExpressions (initializer.Arguments); - InvokeMethod (initializer.AddMethod, target, arguments); - - if (!initializer.AddMethod.IsStatic) - Push (target); - } - - protected override void VisitMemberMemberBinding (MemberMemberBinding binding) - { - var value = Pop (); - Push (value); - VisitMemberInfo (binding.Member); - VisitBindingList (binding.Bindings); - Pop (); - Push (value); - } - - protected override void VisitMemberAssignment (MemberAssignment assignment) - { - Visit (assignment.Expression); - - var value = Pop (); - - assignment.Member.OnFieldOrProperty ( - field => { - object target = null; - if (!field.IsStatic) - target = Pop (); - - field.SetValue (target, value); - - if (!field.IsStatic) - Push (target); - }, - property => { - object target = null; - var getter = property.GetGetMethod (true); - if (!getter.IsStatic) - target = Pop (); - - property.SetValue (target, value, null); - - if (!getter.IsStatic) - Push (target); - }); - } - - protected override void VisitLambda (LambdaExpression lambda) - { - Push (lambda.Compile (this)); - } - - private object [] VisitListExpressions (ReadOnlyCollection<Expression> collection) - { - object [] results = new object [collection.Count]; - for (int i = 0; i < results.Length; i++) { - Visit (collection [i]); - results [i] = Pop (); - } - - return results; - } - - void StoreHoistedVariables (LambdaExpression lambda, object [] arguments) - { - if (hoisted_map == null) - return; - - List<ParameterExpression> variables; - if (!hoisted_map.TryGetValue (lambda, out variables)) - return; - - foreach (var variable in variables) - StoreHoistedVariable (variable, lambda, arguments); - } - - void StoreHoistedVariable (ParameterExpression variable, LambdaExpression lambda, object [] arguments) - { - var index = GetParameterIndex (lambda, variable); - if (index < 0) - return; - - hoisted_values [variable] = arguments [index]; - } - - static int GetParameterIndex (LambdaExpression lambda, ParameterExpression parameter) - { - return lambda.Parameters.IndexOf (parameter); - } - - public object Interpret (LambdaExpression lambda, object [] arguments) - { - lambdas.Push (new LambdaInfo (lambda, arguments)); - - StoreHoistedVariables (lambda, arguments); - - Visit (lambda.Body); - - lambdas.Pop (); - - if (lambda.GetReturnType () != typeof (void)) - return Pop (); - - return null; - } - } -} diff --git a/mcs/class/System.Core/System.Linq.jvm/Math.cs b/mcs/class/System.Core/System.Linq.jvm/Math.cs deleted file mode 100644 index b3e322cfed..0000000000 --- a/mcs/class/System.Core/System.Linq.jvm/Math.cs +++ /dev/null @@ -1,695 +0,0 @@ -// -// Math.cs -// -// (C) 2008 Mainsoft, Inc. (http://www.mainsoft.com) -// (C) 2008 db4objects, Inc. (http://www.db4o.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. -// - -using System; -using System.Globalization; -using System.Linq.Expressions; - -namespace System.Linq.jvm { - class Math { - - public static object Evaluate (object a, object b, Type t, ExpressionType et) - { - TypeCode tc = Type.GetTypeCode (t); - if (tc == TypeCode.Object) { - if (!t.IsNullable ()) { - throw new NotImplementedException ( - string.Format ( - "Expression with Node type {0} for type {1}", - t.FullName, - tc)); - - } - return EvaluateNullable (a, b, Type.GetTypeCode (t.GetGenericArguments () [0]), et); - } - return Evaluate (a, b, tc, et); - } - - public static object EvaluateNullable (object a, object b, TypeCode tc, ExpressionType et) - { - object o = null; - if (a == null || b == null) { - if (tc != TypeCode.Boolean) { - return null; - } - switch (et) { - case ExpressionType.And: - o = And (a, b); - break; - case ExpressionType.Or: - o = Or (a, b); - break; - case ExpressionType.ExclusiveOr: - o = ExclusiveOr (a, b); - break; - } - } else { - o = Evaluate (a, b, tc, et); - } - - return Convert2Nullable (o, tc); - - } - - private static object ExclusiveOr (object a, object b) - { - if (a == null || b == null) { - return null; - } - return (bool) a ^ (bool) b; - } - - public static object Or (object a, object b) - { - if (a == null) { - if (b == null || !((bool) b)) { - return null; - } - return true; - } - - if (b == null) { - if (a == null || !((bool) a)) { - return null; - } - return true; - } - - return (bool) a || (bool) b; - } - - public static object And (object a, object b) - { - if (a == null) { - if (b == null || (bool) b) { - return null; - } - return false; - } - - if (b == null) { - if (a == null || (bool) a) { - return null; - } - return false; - } - - return (bool) a && (bool) b; - } - - private static object Convert2Nullable (object o, TypeCode tc) - { - if (o == null) { - return null; - } - switch (tc) { - case TypeCode.Char: - return new Nullable<Char> ((Char) o); - case TypeCode.Byte: - return new Nullable<Byte> ((Byte) o); - case TypeCode.Decimal: - return new Nullable<Decimal> ((Decimal) o); - case TypeCode.Double: - return new Nullable<Double> ((Double) o); - case TypeCode.Int16: - return new Nullable<Int16> ((Int16) o); - case TypeCode.Int32: - return new Nullable<Int32> ((Int32) o); - case TypeCode.Int64: - return new Nullable<Int64> ((Int64) o); - case TypeCode.UInt16: - return new Nullable<UInt16> ((UInt16) o); - case TypeCode.UInt32: - return new Nullable<UInt32> ((UInt32) o); - case TypeCode.SByte: - return new Nullable<SByte> ((SByte) o); - case TypeCode.Single: - return new Nullable<Single> ((Single) o); - case TypeCode.Boolean: - return new Nullable<Boolean> ((Boolean) o); - } - - throw new NotImplementedException (); - } - - public static object Evaluate (object a, object b, TypeCode tc, ExpressionType et) - { - switch (tc) { - case TypeCode.Boolean: - return Evaluate (Convert.ToBoolean (a), Convert.ToBoolean (b), et); - case TypeCode.Char: - return Evaluate (Convert.ToChar (a), Convert.ToChar (b), et); - case TypeCode.Byte: - return unchecked ((Byte) Evaluate (Convert.ToByte (a), Convert.ToByte (b), et)); - case TypeCode.Decimal: - return Evaluate (Convert.ToDecimal (a), Convert.ToDecimal (b), et); - case TypeCode.Double: - return Evaluate (Convert.ToDouble (a), Convert.ToDouble (b), et); - case TypeCode.Int16: - return unchecked ((Int16) Evaluate (Convert.ToInt16 (a), Convert.ToInt16 (b), et)); - case TypeCode.Int32: - return Evaluate (Convert.ToInt32 (a), Convert.ToInt32 (b), et); - case TypeCode.Int64: - return Evaluate (Convert.ToInt64 (a), Convert.ToInt64 (b), et); - case TypeCode.UInt16: - return unchecked ((UInt16) Evaluate (Convert.ToUInt16 (a), Convert.ToUInt16 (b), et)); - case TypeCode.UInt32: - return Evaluate (Convert.ToUInt32 (a), Convert.ToUInt32 (b), et); - case TypeCode.UInt64: - return Evaluate (Convert.ToUInt64 (a), Convert.ToUInt64 (b), et); - case TypeCode.SByte: - return unchecked ((SByte) Evaluate (Convert.ToSByte (a), Convert.ToSByte (b), et)); - case TypeCode.Single: - return Evaluate (Convert.ToSingle (a), Convert.ToSingle (b), et); - - } - - throw new NotImplementedException (); - } - - public static object NegateChecked (object a, TypeCode tc) - { - switch (tc) { - case TypeCode.Char: - return checked (-Convert.ToChar (a)); - case TypeCode.Byte: - return checked (-Convert.ToByte (a)); - case TypeCode.Decimal: - return checked (-Convert.ToDecimal (a)); - case TypeCode.Double: - return checked (-Convert.ToDouble (a)); - case TypeCode.Int16: - return checked (-Convert.ToInt16 (a)); - case TypeCode.Int32: - return checked (-Convert.ToInt32 (a)); - case TypeCode.Int64: - return checked (-Convert.ToInt64 (a)); - case TypeCode.UInt16: - return checked (-Convert.ToUInt16 (a)); - case TypeCode.UInt32: - return checked (-Convert.ToUInt32 (a)); - case TypeCode.SByte: - return checked (-Convert.ToSByte (a)); - case TypeCode.Single: - return checked (-Convert.ToSingle (a)); - } - - throw new NotImplementedException (); - } - - static object CreateInstance (Type type, params object [] arguments) - { - return type.GetConstructor ( - (from argument in arguments select argument.GetType ()).ToArray ()).Invoke (arguments); - } - - public static object ConvertToTypeChecked (object a, Type fromType, Type toType) - { - if (toType.IsNullable ()) - return a == null ? a : CreateInstance (toType, - ConvertToTypeChecked (a, fromType.GetNotNullableType (), toType.GetNotNullableType ())); - - if (a == null) { - if (!toType.IsValueType) - return a; - if (fromType.IsNullable ()) - throw new InvalidOperationException ("Nullable object must have a value"); - } - - if (IsType (toType, a)) { - return a; - } - - if (Expression.IsPrimitiveConversion (fromType, toType)) - return Convert.ChangeType (a, toType, CultureInfo.CurrentCulture); - - throw new NotImplementedException ( - string.Format ("No Convert defined for type {0} ", toType)); - } - - public static object ConvertToTypeUnchecked (object a, Type fromType, Type toType) - { - if (toType.IsNullable ()) - return a == null ? a : CreateInstance (toType, - ConvertToTypeUnchecked (a, fromType.GetNotNullableType (), toType.GetNotNullableType ())); - - if (a == null) { - if (!toType.IsValueType) - return a; - if (fromType.IsNullable ()) - throw new InvalidOperationException ("Nullable object must have a value"); - } - - if (IsType (toType, a)) - return a; - - if (Expression.IsPrimitiveConversion (fromType, toType)) - return Conversion.ConvertPrimitiveUnChecked (fromType, toType, a); - - throw new NotImplementedException ( - string.Format ("No Convert defined for type {0} ", toType)); - } - - public static bool IsType (Type t, Object o) - { - return t.IsInstanceOfType (o); - } - - public static object Negate (object a, TypeCode tc) - { - switch (tc) { - case TypeCode.Char: - return unchecked (-Convert.ToChar (a)); - case TypeCode.Byte: - return unchecked (-Convert.ToByte (a)); - case TypeCode.Decimal: - return unchecked (-Convert.ToDecimal (a)); - case TypeCode.Double: - return unchecked (-Convert.ToDouble (a)); - case TypeCode.Int16: - return unchecked (-Convert.ToInt16 (a)); - case TypeCode.Int32: - return unchecked (-Convert.ToInt32 (a)); - case TypeCode.Int64: - return unchecked (-Convert.ToInt64 (a)); - case TypeCode.UInt16: - return unchecked (-Convert.ToUInt16 (a)); - case TypeCode.UInt32: - return unchecked (-Convert.ToUInt32 (a)); - case TypeCode.SByte: - return unchecked (-Convert.ToSByte (a)); - case TypeCode.Single: - return unchecked (-Convert.ToSingle (a)); - } - - throw new NotImplementedException (); - } - - public static object RightShift (object a, int n, TypeCode tc) - { - switch (tc) { - case TypeCode.Int16: - return Convert.ToInt16 (a) >> n; - case TypeCode.Int32: - return Convert.ToInt32 (a) >> n; - case TypeCode.Int64: - return Convert.ToInt64 (a) >> n; - case TypeCode.UInt16: - return Convert.ToUInt16 (a) >> n; - case TypeCode.UInt32: - return Convert.ToUInt32 (a) >> n; - case TypeCode.UInt64: - return Convert.ToUInt64 (a) >> n; - } - - throw new NotImplementedException (); - } - - public static object LeftShift (object a, int n, TypeCode tc) - { - switch (tc) { - case TypeCode.Int16: - return Convert.ToInt16 (a) << n; - case TypeCode.Int32: - return Convert.ToInt32 (a) << n; - case TypeCode.Int64: - return Convert.ToInt64 (a) << n; - case TypeCode.UInt16: - return Convert.ToUInt16 (a) << n; - case TypeCode.UInt32: - return Convert.ToUInt32 (a) << n; - case TypeCode.UInt64: - return Convert.ToUInt64 (a) << n; - } - - throw new NotImplementedException (); - } - - private static Decimal Evaluate (Decimal a, Decimal b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - - } - - throw new NotImplementedException (); - } - - private static Double Evaluate (Double a, Double b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.Power: - return System.Math.Pow (a, b); - } - - throw new NotImplementedException (); - - } - - private static Int32 Evaluate (Int16 a, Int16 b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static Int32 Evaluate (Int32 a, Int32 b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static Int64 Evaluate (Int64 a, Int64 b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static Int32 Evaluate (UInt16 a, UInt16 b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked ((UInt16) (a - b)); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static UInt32 Evaluate (UInt32 a, UInt32 b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static UInt64 Evaluate (UInt64 a, UInt64 b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static object Evaluate (Char a, Char b, ExpressionType et) - { - switch (et) { - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static Int32 Evaluate (SByte a, SByte b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static Int32 Evaluate (Byte a, Byte b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - - private static Single Evaluate (Single a, Single b, ExpressionType et) - { - switch (et) { - case ExpressionType.Add: - return unchecked (a + b); - case ExpressionType.AddChecked: - return checked (a + b); - case ExpressionType.Subtract: - return unchecked (a - b); - case ExpressionType.SubtractChecked: - return checked (a - b); - case ExpressionType.Multiply: - return unchecked (a * b); - case ExpressionType.MultiplyChecked: - return checked (a * b); - case ExpressionType.Divide: - return a / b; - case ExpressionType.Modulo: - return a % b; - } - - throw new NotImplementedException (); - } - - private static bool Evaluate (bool a, bool b, ExpressionType et) - { - switch (et) { - case ExpressionType.ExclusiveOr: - return a ^ b; - case ExpressionType.And: - return a & b; - case ExpressionType.Or: - return a | b; - } - - throw new NotImplementedException (); - } - } -} diff --git a/mcs/class/System.Core/System.Linq.jvm/Runner.cs b/mcs/class/System.Core/System.Linq.jvm/Runner.cs deleted file mode 100644 index 31f02100a2..0000000000 --- a/mcs/class/System.Core/System.Linq.jvm/Runner.cs +++ /dev/null @@ -1,227 +0,0 @@ -// -// Runner.cs -// -// (C) 2008 Mainsoft, Inc. (http://www.mainsoft.com) -// (C) 2008 db4objects, Inc. (http://www.db4o.com) -// (C) 2010 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. -// - -using System.Linq.Expressions; -using System.Reflection; - -namespace System.Linq.jvm { - - sealed class Runner { - - sealed class VoidTypeMarker {} - - static readonly Type VoidMarker = typeof (VoidTypeMarker); - static readonly MethodInfo [] delegates = new MethodInfo [5]; - const BindingFlags method_flags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance; - - readonly LambdaExpression lambda; - readonly ExpressionInterpreter interpreter; - - static Runner () - { - foreach (var method in typeof (Runner).GetMethods (method_flags).Where (m => m.Name == "GetDelegate")) - delegates [method.GetGenericArguments ().Length - 1] = method; - } - - public Runner (LambdaExpression lambda) - { - this.lambda = lambda; - } - - public Runner (LambdaExpression lambda, ExpressionInterpreter interpreter) - { - this.lambda = lambda; - this.interpreter = interpreter; - } - - public Delegate CreateDelegate () - { - var types = GetGenericSignature (); - var creator = delegates [types.Length - 1].MakeGenericMethod (types); - - return (Delegate) creator.Invoke (this, new object [0]); - } - - Type [] GetGenericSignature () - { - var count = lambda.Parameters.Count; - var types = new Type [count + 1]; - - var return_type = lambda.GetReturnType (); - if (return_type == typeof (void)) - return_type = VoidMarker; - - types [count] = return_type; - for (int i = 0; i < count; i++) { - types [i] = lambda.Parameters [i].Type; - } - - return types; - } - - object Run (object [] arguments) - { - var interpreter = this.interpreter ?? new ExpressionInterpreter (lambda); - - return interpreter.Interpret (lambda, arguments); - } - - MethodInfo GetActionRunner (params Type [] types) - { - return GetRunner ("ActionRunner", types); - } - - MethodInfo GetFuncRunner (params Type [] types) - { - return GetRunner ("FuncRunner", types); - } - - MethodInfo GetRunner (string name, Type [] type_arguments) - { - var method = GetMethod (name, type_arguments.Length); - if (method == null) - throw new InvalidOperationException (); - - if (type_arguments.Length == 0) - return method; - - return method.MakeGenericMethod (type_arguments); - } - - MethodInfo GetMethod (string name, int parameters) - { - foreach (var method in GetType ().GetMethods (method_flags)) { - if (method.Name != name) - continue; - - if (method.GetGenericArguments ().Length != parameters) - continue; - - return method; - } - - return null; - } - - Delegate CreateDelegate (MethodInfo runner) - { - return Delegate.CreateDelegate (lambda.Type, this, runner); - } - - // all methods below are called through reflection - - Delegate GetDelegate<TResult> () - { - if (typeof (TResult) == VoidMarker) - return CreateDelegate (GetActionRunner (Type.EmptyTypes)); - - return CreateDelegate (GetFuncRunner (typeof (TResult))); - } - - public TResult FuncRunner<TResult> () - { - return (TResult) Run (new object [0]); - } - - public void ActionRunner () - { - Run (new object [0]); - } - - Delegate GetDelegate<T, TResult> () - { - if (typeof (TResult) == VoidMarker) - return CreateDelegate (GetActionRunner (typeof (T))); - - return CreateDelegate (GetFuncRunner (typeof (T), typeof (TResult))); - } - - public TResult FuncRunner<T, TResult> (T arg) - { - return (TResult) Run (new object [] { arg }); - } - - public void ActionRunner<T> (T arg) - { - Run (new object [] { arg }); - } - - public Delegate GetDelegate<T1, T2, TResult> () - { - if (typeof (TResult) == VoidMarker) - return CreateDelegate (GetActionRunner (typeof (T1), typeof (T2))); - - return CreateDelegate (GetFuncRunner (typeof (T1), typeof (T2), typeof (TResult))); - } - - public TResult FuncRunner<T1, T2, TResult> (T1 arg1, T2 arg2) - { - return (TResult) Run (new object [] { arg1, arg2 }); - } - - public void ActionRunner<T1, T2> (T1 arg1, T2 arg2) - { - Run (new object [] { arg1, arg2 }); - } - - Delegate GetDelegate<T1, T2, T3, TResult> () - { - if (typeof (TResult) == VoidMarker) - return CreateDelegate (GetActionRunner (typeof (T1), typeof (T2), typeof (T3))); - - return CreateDelegate (GetFuncRunner (typeof (T1), typeof (T2), typeof (T3), typeof (TResult))); - } - - public TResult FuncRunner<T1, T2, T3, TResult> (T1 arg1, T2 arg2, T3 arg3) - { - return (TResult) Run (new object [] { arg1, arg2, arg3 }); - } - - public void ActionRunner<T1, T2, T3> (T1 arg1, T2 arg2, T3 arg3) - { - Run (new object [] { arg1, arg2, arg3 }); - } - - Delegate GetDelegate<T1, T2, T3, T4, TResult> () - { - if (typeof (TResult) == VoidMarker) - return CreateDelegate (GetActionRunner (typeof (T1), typeof (T2), typeof (T3), typeof (T4))); - - return CreateDelegate (GetFuncRunner (typeof (T1), typeof (T2), typeof (T3), typeof (T4), typeof (TResult))); - } - - public TResult FuncRunner<T1, T2, T3, T4, TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4) - { - return (TResult) Run (new object [] { arg1, arg2, arg3, arg4 }); - } - - public void ActionRunner<T1, T2, T3, T4> (T1 arg1, T2 arg2, T3 arg3, T4 arg4) - { - Run (new object [] { arg1, arg2, arg3, arg4 }); - } - } -} diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index 71f392690a..23805636c6 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -744,6 +744,12 @@ namespace System.Linq if (list != null) return list [index]; +#if NET_4_5 + var readOnlyList = source as IReadOnlyList<TSource>; + if (readOnlyList != null) + return readOnlyList[index]; +#endif + return source.ElementAt (index, Fallback.Throw); } @@ -762,6 +768,12 @@ namespace System.Linq if (list != null) return index < list.Count ? list [index] : default (TSource); +#if NET_4_5 + var readOnlyList = source as IReadOnlyList<TSource>; + if (readOnlyList != null) + return index < readOnlyList.Count ? readOnlyList [index] : default (TSource); +#endif + return source.ElementAt (index, Fallback.Default); } @@ -1099,7 +1111,7 @@ namespace System.Linq foreach (TOuter element in outer) { TKey outerKey = outerKeySelector (element); - if (innerKeys.Contains (outerKey)) + if (outerKey != null && innerKeys.Contains (outerKey)) yield return resultSelector (element, innerKeys [outerKey]); else yield return resultSelector (element, Empty<TInner> ()); @@ -1166,7 +1178,7 @@ namespace System.Linq foreach (TOuter element in outer) { TKey outerKey = outerKeySelector (element); - if (innerKeys.Contains (outerKey)) { + if (outerKey != null && innerKeys.Contains (outerKey)) { foreach (TInner innerElement in innerKeys [outerKey]) yield return resultSelector (element, innerElement); } diff --git a/mcs/class/System.Core/System/TimeZoneInfo.Android.cs b/mcs/class/System.Core/System/TimeZoneInfo.Android.cs index a21edd6c93..aa2ae29974 100644 --- a/mcs/class/System.Core/System/TimeZoneInfo.Android.cs +++ b/mcs/class/System.Core/System/TimeZoneInfo.Android.cs @@ -346,7 +346,7 @@ namespace System { static void Fill (Stream stream, byte[] nbuf, int required) { - int read, offset = 0; + int read = 0, offset = 0; while (offset < required && (read = stream.Read (nbuf, offset, required - offset)) > 0) offset += read; if (read != required) diff --git a/mcs/class/System.Core/System/TimeZoneInfo.cs b/mcs/class/System.Core/System/TimeZoneInfo.cs index 1f580d76d8..5663e4b9bb 100644 --- a/mcs/class/System.Core/System/TimeZoneInfo.cs +++ b/mcs/class/System.Core/System/TimeZoneInfo.cs @@ -1,3 +1,4 @@ + /* * System.TimeZoneInfo * @@ -285,10 +286,17 @@ namespace System if (this == TimeZoneInfo.Utc) return DateTime.SpecifyKind (dateTime, DateTimeKind.Utc); - + //FIXME: do not rely on DateTime implementation ! - if (this == TimeZoneInfo.Local) + if (this == TimeZoneInfo.Local) + { +#if NET_4_0 + return dateTime.ToLocalTime (); +#else return DateTime.SpecifyKind (dateTime.ToLocalTime (), DateTimeKind.Unspecified); +#endif + } + AdjustmentRule rule = GetApplicableRule (dateTime); diff --git a/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Equal.cs b/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Equal.cs index 749d78e40f..be7e129d89 100644 --- a/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Equal.cs +++ b/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Equal.cs @@ -82,6 +82,18 @@ namespace MonoTests.System.Linq.Expressions } [Test] + public void PrimitiveNonNumeric () + { + BinaryExpression expr = Expression.Equal (Expression.Constant ('a'), Expression.Constant ('b')); + Assert.AreEqual (ExpressionType.Equal, expr.NodeType); + Assert.AreEqual (typeof (bool), expr.Type); + Assert.IsNull (expr.Method); + + var eq = Expression.Lambda<Func<bool>> (expr).Compile (); + Assert.IsFalse (eq ()); + } + + [Test] public void Nullable_LiftToNull_SetToFalse () { int? a = 1; diff --git a/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs b/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs index d98eea6446..1045c8521b 100644 --- a/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs +++ b/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Globalization; using System.Text; using System.Threading; @@ -540,6 +541,13 @@ namespace MonoTests.System.Linq } [Test] + public void ElementAt_ReadOnlyListOptimization_ReturnsValueAtGivenIndex() + { + var source = new NonEnumerableReadOnlyList<int> (new List<int> (new[] { 1, 2, 3, 4, 5, 6 })); + Assert.That(source.ElementAt (2), Is.EqualTo (3)); + } + + [Test] public void ElementAtOrDefault_IntegersWithOutOfRangeIndex_ReturnsDefault () { var source = Read (3, 6, 8); @@ -561,6 +569,13 @@ namespace MonoTests.System.Linq } [Test] + public void ElementAtOrDefault_ReadOnlyListOptimization_ReturnsValueAtGivenIndex() + { + var source = new NonEnumerableReadOnlyList<int>(new List<int> (new[] { 1, 2, 3, 4, 5, 6 })); + Assert.That(source.ElementAtOrDefault (2), Is.EqualTo (3)); + } + + [Test] public void ElementAtOrDefault_BooleansAndNegativeIndex_ReturnsDefault () { var source = Read (true, false, true, false); @@ -2188,6 +2203,27 @@ namespace MonoTests.System.Linq } } + [Serializable] + internal sealed class NonEnumerableReadOnlyList<T> : ReadOnlyCollection<T>, IEnumerable<T> { + public NonEnumerableReadOnlyList () : + this (new List<T>()) { } + + public NonEnumerableReadOnlyList (IList<T> collection) : + base (collection) { } + + // Re-implement GetEnumerator to be undefined. + + IEnumerator<T> IEnumerable<T>.GetEnumerator () + { + throw new NotImplementedException (); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable<T>) this).GetEnumerator(); + } + } + internal sealed class Reader<T> : IEnumerable<T>, IEnumerator<T> { public event EventHandler Disposed; diff --git a/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs b/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs index f5559ae00e..1cf514c7aa 100644 --- a/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs +++ b/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs @@ -1554,6 +1554,18 @@ namespace MonoTests.System.Linq { } [Test] + public void JoinTestNullKeys () + { + var l1 = new [] { + new { Name = "name1", Nullable = (int?) null }, + new { Name = "name2", Nullable = (int?) null } + }; + + var count = l1.Join (l1, i => i.Nullable, i => i.Nullable, (x, y) => x.Name).Count (); + Assert.AreEqual (0, count); + } + + [Test] public void GroupJoinArgumentNullTest () { string [] data = { "2", "1", "5", "3", "4" }; @@ -1596,6 +1608,16 @@ namespace MonoTests.System.Linq { } [Test] + public void GroupJoinWithNullKeys () + { + string[] l1 = { null }; + string[] l2 = { null, null }; + var res = l1.GroupJoin (l2, x => x, y => y, (a, b) => new { Key = a, Count = b.Count () }).ToArray (); + Assert.AreEqual (1, res.Length); + Assert.AreEqual (0, res [0].Count); + } + + [Test] public void OrderByArgumentNullTest () { string [] data = { "2", "1", "5", "3", "4" }; diff --git a/mcs/class/System.Core/Test/System/TimeZoneInfoTest.cs b/mcs/class/System.Core/Test/System/TimeZoneInfoTest.cs index 609c6d20cf..89b4ec11d2 100644 --- a/mcs/class/System.Core/Test/System/TimeZoneInfoTest.cs +++ b/mcs/class/System.Core/Test/System/TimeZoneInfoTest.cs @@ -387,6 +387,23 @@ namespace MonoTests.System } + + [Test] + public void ConvertFromToLocal () + { + DateTime utc = DateTime.UtcNow; + Assert.AreEqual(utc.Kind, DateTimeKind.Utc); + DateTime converted = TimeZoneInfo.ConvertTimeFromUtc(utc, TimeZoneInfo.Local); + #if NET_4_0 + Assert.AreEqual(DateTimeKind.Local, converted.Kind); + #else + Assert.AreEqual(DateTimeKind.Unspecified, converted.Kind); + #endif + DateTime back = TimeZoneInfo.ConvertTimeToUtc(converted, TimeZoneInfo.Local); + Assert.AreEqual(back.Kind, DateTimeKind.Utc); + Assert.AreEqual(utc, back); + } + [Test] public void ConvertToTimeZone () { diff --git a/mcs/class/System.Core/dynamic_System.Core.dll.sources b/mcs/class/System.Core/dynamic_System.Core.dll.sources index 83eaf84606..f5f5034c95 100644 --- a/mcs/class/System.Core/dynamic_System.Core.dll.sources +++ b/mcs/class/System.Core/dynamic_System.Core.dll.sources @@ -118,10 +118,3 @@ ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs - -System.Core/Dummy.cs - -System.Runtime.CompilerServices/ExecutionScope.cs -System.Runtime.CompilerServices/DynamicAttribute.cs -System.Linq.Expressions/ExpressionTransformer.cs -System.Linq.Expressions/Extensions.cs diff --git a/mcs/class/System.Core/interpreter_System.Core.dll.sources b/mcs/class/System.Core/interpreter_System.Core.dll.sources new file mode 100644 index 0000000000..5ca0d48849 --- /dev/null +++ b/mcs/class/System.Core/interpreter_System.Core.dll.sources @@ -0,0 +1,91 @@ +../dlr/Runtime/Microsoft.Scripting.Core/Actions/BinaryOperationBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/BindingRestrictions.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteHelpers.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/ConvertBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/CreateInstanceBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteIndexBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteMemberBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoClass.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/GetIndexBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/IDynamicMetaObjectProvider.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/InvokeBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/InvokeMemberBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/IInvokeOnGetBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/RuleCache.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/SetIndexBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/SetMemberBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/UnaryOperationBinder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs + +../dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugViewWriter.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.DebuggerProxy.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionType.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/IArgumentProvider.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelTarget.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ListArgumentProvider.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberBinding.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchCase.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/SymbolDocumentInfo.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs + +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Set.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs + +../dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/Helpers.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/IRuntimeVariables.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs + +System.Linq.Expressions.Interpret/LambdaCompiler.cs diff --git a/mcs/class/System.Core/mobile_System.Core.dll.sources b/mcs/class/System.Core/mobile_System.Core.dll.sources index 2f79e102f9..ba66db603d 100644 --- a/mcs/class/System.Core/mobile_System.Core.dll.sources +++ b/mcs/class/System.Core/mobile_System.Core.dll.sources @@ -6,6 +6,8 @@ System/TimeZoneInfo.AdjustmentRule.cs System/TimeZoneInfo.cs System/TimeZoneInfo.TransitionTime.cs System/TimeZoneNotFoundException.cs +System/Util.cs +System.Runtime.CompilerServices/DynamicAttribute.cs System.Runtime.CompilerServices/ExecutionScope.cs System.Runtime.CompilerServices/ExtensionAttribute.cs System.Runtime.CompilerServices/IStrongBox.cs @@ -97,3 +99,9 @@ Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs System.IO/HandleInheritability.cs System.Threading.Tasks/TaskExtensions.cs +System.Linq.Expressions/Extensions.cs +System.Linq.Expressions/ExpressionTransformer.cs +../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs +System.Linq.Expressions/DynamicExpressionVisitor.cs + diff --git a/mcs/class/System.Core/mobile_static_System.Core.dll.sources b/mcs/class/System.Core/mobile_static_System.Core.dll.sources deleted file mode 100644 index 55e204afd6..0000000000 --- a/mcs/class/System.Core/mobile_static_System.Core.dll.sources +++ /dev/null @@ -1,7 +0,0 @@ -#include mobile_System.Core.dll.sources -#include static_System.Core.dll.sources -System.Linq.jvm/Conversion.cs -System.Linq.jvm/ExpressionInterpreter.cs -System.Linq.jvm/Runner.cs -System.Linq.jvm/Math.cs -System/TimeZoneInfo.MonoTouch.cs diff --git a/mcs/class/System.Core/monotouch_System.Core.dll.sources b/mcs/class/System.Core/monotouch_System.Core.dll.sources index 55e204afd6..fad05a08f1 100644 --- a/mcs/class/System.Core/monotouch_System.Core.dll.sources +++ b/mcs/class/System.Core/monotouch_System.Core.dll.sources @@ -1,7 +1,3 @@ #include mobile_System.Core.dll.sources -#include static_System.Core.dll.sources -System.Linq.jvm/Conversion.cs -System.Linq.jvm/ExpressionInterpreter.cs -System.Linq.jvm/Runner.cs -System.Linq.jvm/Math.cs +#include interpreter_System.Core.dll.sources System/TimeZoneInfo.MonoTouch.cs diff --git a/mcs/class/System.Core/net_4_0_System.Core.dll.sources b/mcs/class/System.Core/net_4_0_System.Core.dll.sources index bb9240f7bf..65bcfd8801 100644 --- a/mcs/class/System.Core/net_4_0_System.Core.dll.sources +++ b/mcs/class/System.Core/net_4_0_System.Core.dll.sources @@ -1,3 +1,4 @@ +#include dynamic_System.Core.dll.sources Assembly/AssemblyInfo.cs System/Actions.cs System/Funcs.cs @@ -88,126 +89,6 @@ System.IO.Pipes/PipeUnix.cs System.IO.Pipes/PipeWin32.cs System.IO/HandleInheritability.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/BinaryOperationBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/BindingRestrictions.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteHelpers.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/ConvertBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/CreateInstanceBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteIndexBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteMemberBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoClass.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/GetIndexBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/IDynamicMetaObjectProvider.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/InvokeBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/InvokeMemberBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/IInvokeOnGetBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/RuleCache.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/SetIndexBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/SetMemberBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/UnaryOperationBinder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs - -../dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugViewWriter.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.DebuggerProxy.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionType.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/IArgumentProvider.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelTarget.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ListArgumentProvider.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberBinding.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchCase.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/SymbolDocumentInfo.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs -../dlr/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs - -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/AnalyzedTree.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/AssemblyGen.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/BoundConstants.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.Storage.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/ConstantCheck.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/ExpressionQuoter.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/HoistedLocals.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/ILGen.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/KeyedQueue.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LabelInfo.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Address.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.ControlFlow.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Generated.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Lambda.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Statements.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Unary.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/OffsetTrackingILGenerator.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/RuntimeVariableList.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Set.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Bindings.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs -../dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs - -../dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/Helpers.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/IRuntimeVariables.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs -../dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs System.Linq.Parallel/ParallelQueryEnumerator.cs System.Linq/OrderedParallelQuery.cs System.Linq/ParallelMergeOptions.cs diff --git a/mcs/class/System.Core/net_4_5_System.Core.dll.sources b/mcs/class/System.Core/net_4_5_System.Core.dll.sources index 4d4f48c853..cd2aed8b93 100644 --- a/mcs/class/System.Core/net_4_5_System.Core.dll.sources +++ b/mcs/class/System.Core/net_4_5_System.Core.dll.sources @@ -1,3 +1,4 @@ #include net_4_0_System.Core.dll.sources ../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs +System.Linq.Expressions/DynamicExpressionVisitor.cs diff --git a/mcs/class/System.Core/static_System.Core.dll.sources b/mcs/class/System.Core/static_System.Core.dll.sources deleted file mode 100644 index 7696cbef18..0000000000 --- a/mcs/class/System.Core/static_System.Core.dll.sources +++ /dev/null @@ -1,28 +0,0 @@ -System.Linq.Expressions/BinaryExpression.cs -System.Linq.Expressions/ConditionalExpression.cs -System.Linq.Expressions/ConstantExpression.cs -System.Linq.Expressions/ElementInit.cs -System.Linq.Expressions/EmitContext.cs -System.Linq.Expressions/Expression.cs -System.Linq.Expressions/Expression_T.cs -System.Linq.Expressions/ExpressionPrinter.cs -System.Linq.Expressions/ExpressionType.cs -System.Linq.Expressions/ExpressionVisitor.cs -System.Linq.Expressions/ExpressionTransformer.cs -System.Linq.Expressions/Extensions.cs -System.Linq.Expressions/InvocationExpression.cs -System.Linq.Expressions/LambdaExpression.cs -System.Linq.Expressions/ListInitExpression.cs -System.Linq.Expressions/MemberAssignment.cs -System.Linq.Expressions/MemberBinding.cs -System.Linq.Expressions/MemberBindingType.cs -System.Linq.Expressions/MemberExpression.cs -System.Linq.Expressions/MemberInitExpression.cs -System.Linq.Expressions/MemberListBinding.cs -System.Linq.Expressions/MemberMemberBinding.cs -System.Linq.Expressions/MethodCallExpression.cs -System.Linq.Expressions/NewArrayExpression.cs -System.Linq.Expressions/NewExpression.cs -System.Linq.Expressions/ParameterExpression.cs -System.Linq.Expressions/TypeBinaryExpression.cs -System.Linq.Expressions/UnaryExpression.cs diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs index 743a3c72ed..3e1ce93078 100644 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs +++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs @@ -226,6 +226,11 @@ namespace System.Data.OracleClient.Oci IntPtr usrmempp); [DllImport ("oci")] + internal static extern int OCICacheFree (IntPtr envhp, + IntPtr errhp, + IntPtr stmthp); + + [DllImport ("oci")] internal static extern int OCIAttrGet (IntPtr trgthndlp, [MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp, out IntPtr attributep, @@ -464,7 +469,7 @@ namespace System.Data.OracleClient.Oci [MarshalAs (UnmanagedType.SysUInt)] int dstlen, byte [] src, [MarshalAs (UnmanagedType.SysUInt)] int srclen, - [MarshalAs (UnmanagedType.SysUInt)] out int rsize); + out long rsize); [DllImport ("oci")] internal static extern int OCIUnicodeToCharSet ( @@ -473,7 +478,7 @@ namespace System.Data.OracleClient.Oci [MarshalAs (UnmanagedType.SysUInt)] int dstlen, [MarshalAs (UnmanagedType.LPWStr)] string src, [MarshalAs (UnmanagedType.SysUInt)] int srclen, - [MarshalAs (UnmanagedType.SysUInt)] out int rsize); + out long rsize); } #endregion @@ -774,6 +779,16 @@ namespace System.Data.OracleClient.Oci xtramem_sz, usrmempp); } + internal static int OCICacheFree (IntPtr envhp, + IntPtr svchp, + IntPtr stmthp) + { + #if TRACE + Trace.WriteLineIf(traceOci, "OCICacheFree", "OCI"); + #endif + return OciNativeCalls.OCICacheFree (envhp, svchp, stmthp); + } + internal static int OCIAttrGet (IntPtr trgthndlp, OciHandleType trghndltyp, out IntPtr attributep, @@ -1185,24 +1200,37 @@ namespace System.Data.OracleClient.Oci byte [] src, out int rsize) { + int rc; + long retSize; + #if TRACE Trace.WriteLineIf(traceOci, "OCICharSetToUnicode", "OCI"); #endif - - return OciNativeCalls.OCICharSetToUnicode (svchp, dst, dst!=null ? dst.Capacity : 0, src, src.Length, out rsize); + rc = OciNativeCalls.OCICharSetToUnicode (svchp, dst, + (dst != null ? dst.Capacity : 0), + src, src.Length, out retSize); + rsize = (int) retSize; + return(rc); } internal static int OCIUnicodeToCharSet ( IntPtr svchp, byte [] dst, - [MarshalAs (UnmanagedType.LPWStr)] string src, - [MarshalAs (UnmanagedType.SysUInt)] out int rsize) + string src, + out int rsize) { + int rc; + long retSize; + #if TRACE Trace.WriteLineIf(traceOci, "OCIUnicodeToCharSet", "OCI"); #endif - return OciNativeCalls.OCIUnicodeToCharSet (svchp, dst, dst!=null ? dst.Length : 0, src, src.Length, out rsize); + rc = OciNativeCalls.OCIUnicodeToCharSet (svchp, dst, + (dst != null ? dst.Length : 0), + src, src.Length, out retSize); + rsize = (int) retSize; + return(rc); } [DllImport ("oci")] diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciStatementHandle.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciStatementHandle.cs index 31afb5cb32..8bbd545fa4 100644 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciStatementHandle.cs +++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciStatementHandle.cs @@ -32,6 +32,7 @@ namespace System.Data.OracleClient.Oci { bool moreResults; OciServiceHandle serviceHandle; ArrayList values; + ArrayList parm; OracleCommand command; #endregion // Fields @@ -82,12 +83,11 @@ namespace System.Data.OracleClient.Oci { if (disposing) { if (values != null) { - foreach (OciDefineHandle h in values) + foreach (OciDefineHandle h in values) h.Dispose (); values = null; } } - base.Dispose (disposing); } } @@ -110,6 +110,9 @@ namespace System.Data.OracleClient.Oci { OciParameterDescriptor output = new OciParameterDescriptor (this, handle); output.ErrorHandle = ErrorHandle; + if (parm == null) + parm = new ArrayList(); + parm.Add(handle); return output; } @@ -228,6 +231,8 @@ namespace System.Data.OracleClient.Oci { switch (status) { case OciGlue.OCI_NO_DATA: moreResults = false; + foreach (IntPtr h in parm) + OciCalls.OCIDescriptorFree(h, OciHandleType.Parameter); break; case OciGlue.OCI_DEFAULT: moreResults = true; diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs index db39d3d551..eee81ab0c0 100644 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs +++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs @@ -27,6 +27,7 @@ using System.Data.Common; using System.Data.OracleClient.Oci; using System.Drawing.Design; using System.Text; +using System.Threading; namespace System.Data.OracleClient { @@ -705,7 +706,7 @@ namespace System.Data.OracleClient private void SafeDisposeHandle (OciStatementHandle h) { - if (h != null && h != preparedStatement) + if (h != null && h != preparedStatement) h.Dispose(); } @@ -757,6 +758,9 @@ namespace System.Data.OracleClient protected override void Dispose (bool disposing) { + if (preparedStatement != null) + OciCalls.OCIHandleFree(preparedStatement, + OciHandleType.Statement); if (disposing) if (Parameters.Count > 0) foreach (OracleParameter parm in Parameters) diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs index df17716097..6f11d970f0 100644 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs +++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs @@ -821,8 +821,11 @@ namespace System.Data.OracleClient if (direction == ParameterDirection.Output || direction == ParameterDirection.InputOutput || direction == ParameterDirection.ReturnValue) { - - cursor = IntPtr.Zero; + if (cursor != IntPtr.Zero) { + OciCalls.OCIHandleFree (cursor, + OciHandleType.Statement); + cursor = IntPtr.Zero; + } OciCalls.OCIHandleAlloc (connection.Environment, out cursor, OciHandleType.Statement, diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs index b096235987..bc10888037 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs @@ -846,7 +846,7 @@ namespace System.Data.SqlClient { if (keyInfo || schemaOnly) epilog = sql2.ToString (); try { - Connection.Tds.BeginExecuteProcedure (prolog, + ar = Connection.Tds.BeginExecuteProcedure (prolog, epilog, CommandText, !wantResults, diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs index 6bdec49106..05038a1136 100644 --- a/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs +++ b/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs @@ -635,8 +635,8 @@ namespace MonoTests.System.Drawing{ [Test] public void GetHashCode_UnitDiffers_HashesNotEqual() { - Font f1 = new Font("DejaVu Sans", 8.25F, GraphicsUnit.Point); - Font f2 = new Font("DejaVu Sans", 8.25F, GraphicsUnit.Pixel); + Font f1 = new Font("Arial", 8.25F, GraphicsUnit.Point); + Font f2 = new Font("Arial", 8.25F, GraphicsUnit.Pixel); Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(), "Hashcodes should differ if _unit member differs"); @@ -645,8 +645,8 @@ namespace MonoTests.System.Drawing{ [Test] public void GetHashCode_NameDiffers_HashesNotEqual() { - Font f1 = new Font("DejaVu Sans", 8.25F, GraphicsUnit.Point); - Font f2 = new Font("Liberation Sans", 8.25F, GraphicsUnit.Point); + Font f1 = new Font("Arial", 8.25F, GraphicsUnit.Point); + Font f2 = new Font("Courier New", 8.25F, GraphicsUnit.Point); Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(), "Hashcodes should differ if _name member differs"); @@ -655,8 +655,8 @@ namespace MonoTests.System.Drawing{ [Test] public void GetHashCode_StyleEqualsGdiCharSet_HashesNotEqual() { - Font f1 = new Font("DejaVu Sans", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); - Font f2 = new Font("DejaVu Sans", 8.25F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(1))); + Font f1 = new Font("Arial", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + Font f2 = new Font("Arial", 8.25F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(1))); Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(), "Hashcodes should differ if _style member differs"); diff --git a/mcs/class/System.Management/System.Management/ManagementQuery.cs b/mcs/class/System.Management/System.Management/ManagementQuery.cs index 30787704c7..5e181368cd 100644 --- a/mcs/class/System.Management/System.Management/ManagementQuery.cs +++ b/mcs/class/System.Management/System.Management/ManagementQuery.cs @@ -36,29 +36,43 @@ namespace System.Management //[TypeConverter ("")] public abstract class ManagementQuery : ICloneable { + string sQueryLanguage; + string sQueryString; + internal ManagementQuery () { } + internal ManagementQuery (string query) + { + QueryString = query; + } + + internal ManagementQuery (string language, string query) + { + QueryLanguage = language; + QueryString = query; + } + static ManagementQuery () { } public virtual string QueryLanguage { get { - throw new NotImplementedException (); + return sQueryLanguage; } set { - throw new NotImplementedException (); + sQueryLanguage = value; } } public virtual string QueryString { get { - throw new NotImplementedException (); + return sQueryString; } set { - throw new NotImplementedException (); + sQueryString = value; } } diff --git a/mcs/class/System.Management/System.Management/ObjectQuery.cs b/mcs/class/System.Management/System.Management/ObjectQuery.cs index 1dd280223e..da052f4dfa 100644 --- a/mcs/class/System.Management/System.Management/ObjectQuery.cs +++ b/mcs/class/System.Management/System.Management/ObjectQuery.cs @@ -29,27 +29,23 @@ namespace System.Management { - [MonoTODO ("System.Management is not implemented")] public class ObjectQuery : ManagementQuery { public ObjectQuery () { - throw new NotImplementedException (); } - public ObjectQuery (string query) + public ObjectQuery (string query) : base(query) { - throw new NotImplementedException (); } - public ObjectQuery (string language, string query) + public ObjectQuery (string language, string query) : base(language, query) { - throw new NotImplementedException (); } public override object Clone () { - throw new NotImplementedException (); + return new ObjectQuery(this.QueryLanguage, this.QueryString); } } } diff --git a/mcs/class/System.Net.Http/Makefile b/mcs/class/System.Net.Http/Makefile index 715fa63120..ce2e097fee 100644 --- a/mcs/class/System.Net.Http/Makefile +++ b/mcs/class/System.Net.Http/Makefile @@ -4,7 +4,7 @@ include ../../build/rules.make LIBRARY = System.Net.Http.dll -LIB_MCS_FLAGS = -r:System.Core.dll -r:System.dll +LIB_MCS_FLAGS = -r:System.Core.dll -r:System.dll $(EXTRA_LIB_MCS_FLAGS) TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/AuthenticationHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/AuthenticationHeaderValue.cs index 33f87db8f0..7bb2496a94 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/AuthenticationHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/AuthenticationHeaderValue.cs @@ -26,6 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Collections.Generic; + namespace System.Net.Http.Headers { public class AuthenticationHeaderValue : ICloneable @@ -85,8 +87,23 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out AuthenticationHeaderValue parsedValue) { var lexer = new Lexer (input); - var t = lexer.Scan (); - if (t != Token.Type.Token || !(lexer.PeekChar () == ' ' || lexer.PeekChar () == -1)) { + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + + parsedValue = null; + return false; + } + + internal static bool TryParse (string input, int minimalCount, out List<AuthenticationHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out AuthenticationHeaderValue parsedValue, out Token t) + { + t = lexer.Scan (); + if (t != Token.Type.Token) { parsedValue = null; return false; } @@ -95,8 +112,11 @@ namespace System.Net.Http.Headers parsedValue.Scheme = lexer.GetStringValue (t); t = lexer.Scan (); - if (t != Token.Type.End) + if (t == Token.Type.Token) { + // TODO: Wrong with multi value parsing parsedValue.Parameter = lexer.GetRemainingStringValue (t.StartPosition); + t = new Token (Token.Type.End, 0, 0); + } return true; } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/CollectionParser.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/CollectionParser.cs new file mode 100644 index 0000000000..cbaafe0f80 --- /dev/null +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/CollectionParser.cs @@ -0,0 +1,117 @@ +// +// CollectionParser.cs +// +// Authors: +// Marek Safar <marek.safar@gmail.com> +// +// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.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. +// + +using System.Collections.Generic; + +namespace System.Net.Http.Headers +{ + delegate bool ElementTryParser<T> (Lexer lexer, out T parsedValue, out Token token); + + static class CollectionParser + { + public static bool TryParse<T> (string input, int minimalCount, ElementTryParser<T> parser, out List<T> result) where T : class + { + var lexer = new Lexer (input); + result = new List<T> (); + + while (true) { + Token token; + T parsedValue; + if (!parser (lexer, out parsedValue, out token)) + return false; + + if (parsedValue != null) + result.Add (parsedValue); + + if (token == Token.Type.SeparatorComma) + continue; + + if (token == Token.Type.End) { + if (minimalCount > result.Count) { + result = null; + return false; + } + + return true; + } + + result = null; + return false; + } + } + + public static bool TryParse (string input, int minimalCount, out List<string> result) + { + return TryParse (input, minimalCount, TryParseStringElement, out result); + } + + public static bool TryParseRepetition (string input, int minimalCount, out List<string> result) + { + return TryParseRepetition (input, minimalCount, TryParseStringElement, out result); + } + + static bool TryParseStringElement (Lexer lexer, out string parsedValue, out Token t) + { + t = lexer.Scan (); + if (t == Token.Type.Token) { + parsedValue = lexer.GetStringValue (t); + if (parsedValue.Length == 0) + parsedValue = null; + + t = lexer.Scan (); + } else { + parsedValue = null; + } + + return true; + } + + public static bool TryParseRepetition<T> (string input, int minimalCount, ElementTryParser<T> parser, out List<T> result) where T : class + { + var lexer = new Lexer (input); + result = new List<T> (); + + while (true) { + Token token; + T parsedValue; + if (!parser (lexer, out parsedValue, out token)) + return false; + + if (parsedValue != null) + result.Add (parsedValue); + + if (token == Token.Type.End) { + if (minimalCount > result.Count) + return false; + + return true; + } + } + } + } +}
\ No newline at end of file diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs index a4d1ae275b..9dd41b3d33 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs @@ -394,7 +394,7 @@ namespace System.Net.Http.Headers switch (t.Kind) { case Token.Type.SeparatorSemicolon: - if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters)) + if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters, out t) || t != Token.Type.End) return false; break; case Token.Type.End: diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/EntityTagHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/EntityTagHeaderValue.cs index 9b10983bbf..8c255cfaed 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/EntityTagHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/EntityTagHeaderValue.cs @@ -26,6 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Collections.Generic; + namespace System.Net.Http.Headers { public class EntityTagHeaderValue : ICloneable @@ -85,14 +87,32 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out EntityTagHeaderValue parsedValue) { + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + parsedValue = null; + return false; + } - var lexer = new Lexer (input); - var t = lexer.Scan (); + static bool TryParseElement (Lexer lexer, out EntityTagHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + t = lexer.Scan (); bool is_weak = false; if (t == Token.Type.Token) { - if (lexer.GetStringValue (t) != "W" || lexer.PeekChar () != '/') + var s = lexer.GetStringValue (t); + if (s == "*") { + parsedValue = any; + + t = lexer.Scan (); + return true; + } + + if (s != "W" || lexer.PeekChar () != '/') return false; is_weak = true; @@ -103,15 +123,20 @@ namespace System.Net.Http.Headers if (t != Token.Type.QuotedString) return false; - if (lexer.Scan () != Token.Type.End) - return false; - parsedValue = new EntityTagHeaderValue (); parsedValue.Tag = lexer.GetStringValue (t); parsedValue.IsWeak = is_weak; + + t = lexer.Scan (); + return true; } + internal static bool TryParse (string input, int minimalCount, out List<EntityTagHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + public override string ToString () { return IsWeak ? diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/HeaderInfo.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/HeaderInfo.cs index 3772180e52..6337319ea1 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/HeaderInfo.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/HeaderInfo.cs @@ -4,7 +4,7 @@ // Authors: // Marek Safar <marek.safar@gmail.com> // -// Copyright (C) 2011 Xamarin Inc (http://www.xamarin.com) +// Copyright (C) 2011, 2014 Xamarin Inc (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -32,6 +32,7 @@ using System.Collections.Generic; namespace System.Net.Http.Headers { delegate bool TryParseDelegate<T> (string value, out T result); + delegate bool TryParseListDelegate<T> (string value, int minimalCount, out List<T> result); abstract class HeaderInfo { @@ -89,6 +90,32 @@ namespace System.Net.Http.Headers } } + class CollectionHeaderTypeInfo<T, U> : HeaderTypeInfo<T, U> where U : class + { + readonly int minimalCount; + TryParseListDelegate<T> parser; + + public CollectionHeaderTypeInfo (string name, TryParseListDelegate<T> parser, HttpHeaderKind headerKind, int minimalCount) + : base (name, null, headerKind) + { + this.parser = parser; + this.minimalCount = minimalCount; + AllowsMany = true; + } + + public override bool TryParse (string value, out object result) + { + List<T> tresult; + if (!parser (value, minimalCount, out tresult)) { + result = null; + return false; + } + + result = tresult; + return true; + } + } + public bool AllowsMany; public readonly HttpHeaderKind HeaderKind; public readonly string Name; @@ -104,18 +131,12 @@ namespace System.Net.Http.Headers return new HeaderTypeInfo<T, object> (name, parser, headerKind); } - public static HeaderInfo CreateMulti<T> (string name, TryParseDelegate<T> parser, HttpHeaderKind headerKind) where T : class - { - return new HeaderTypeInfo<T, T> (name, parser, headerKind) { - AllowsMany = true, - }; - } - - public static HeaderInfo CreateMultiList<T> (string name, TryParseDelegate<List<T>> parser, HttpHeaderKind headerKind) where T : class + // + // Headers with #rule for defining lists of elements or *rule for defining occurences of elements + // + public static HeaderInfo CreateMulti<T> (string name, TryParseListDelegate<T> elementParser, HttpHeaderKind headerKind, int minimalCount = 1) where T : class { - return new HeaderTypeInfo<List<T>, T> (name, parser, headerKind) { - AllowsMany = true, - }; + return new CollectionHeaderTypeInfo<T, T> (name, elementParser, headerKind, minimalCount); } public object CreateCollection (HttpHeaders headers) diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs index 1dc3affa32..ffef647b5e 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs @@ -90,14 +90,14 @@ namespace System.Net.Http.Headers HeaderInfo.CreateMulti<StringWithQualityHeaderValue> ("Accept-Charset", StringWithQualityHeaderValue.TryParse, HttpHeaderKind.Request), HeaderInfo.CreateMulti<StringWithQualityHeaderValue> ("Accept-Encoding", StringWithQualityHeaderValue.TryParse, HttpHeaderKind.Request), HeaderInfo.CreateMulti<StringWithQualityHeaderValue> ("Accept-Language", StringWithQualityHeaderValue.TryParse, HttpHeaderKind.Request), - HeaderInfo.CreateMulti<string> ("Accept-Ranges", Parser.Token.TryParse, HttpHeaderKind.Response), + HeaderInfo.CreateMulti<string> ("Accept-Ranges", CollectionParser.TryParse, HttpHeaderKind.Response), HeaderInfo.CreateSingle<TimeSpan> ("Age", Parser.TimeSpanSeconds.TryParse, HttpHeaderKind.Response), - HeaderInfo.CreateMulti<string> ("Allow", Parser.Token.TryParse, HttpHeaderKind.Content), + HeaderInfo.CreateMulti<string> ("Allow", CollectionParser.TryParse, HttpHeaderKind.Content, 0), HeaderInfo.CreateSingle<AuthenticationHeaderValue> ("Authorization", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Request), HeaderInfo.CreateSingle<CacheControlHeaderValue> ("Cache-Control", CacheControlHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), - HeaderInfo.CreateMulti<string> ("Connection", Parser.Token.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), - HeaderInfo.CreateMulti<string> ("Content-Encoding", Parser.Token.TryParse, HttpHeaderKind.Content), - HeaderInfo.CreateMulti<string> ("Content-Language", Parser.Token.TryParse, HttpHeaderKind.Content), + HeaderInfo.CreateMulti<string> ("Connection", CollectionParser.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), + HeaderInfo.CreateMulti<string> ("Content-Encoding", CollectionParser.TryParse, HttpHeaderKind.Content), + HeaderInfo.CreateMulti<string> ("Content-Language", CollectionParser.TryParse, HttpHeaderKind.Content), HeaderInfo.CreateSingle<long> ("Content-Length", Parser.Long.TryParse, HttpHeaderKind.Content), HeaderInfo.CreateSingle<Uri> ("Content-Location", Parser.Uri.TryParse, HttpHeaderKind.Content), HeaderInfo.CreateSingle<byte[]> ("Content-MD5", Parser.MD5.TryParse, HttpHeaderKind.Content), @@ -117,19 +117,19 @@ namespace System.Net.Http.Headers HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content), HeaderInfo.CreateSingle<Uri> ("Location", Parser.Uri.TryParse, HttpHeaderKind.Response), HeaderInfo.CreateSingle<int> ("Max-Forwards", Parser.Int.TryParse, HttpHeaderKind.Request), - HeaderInfo.CreateMultiList<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParsePragma, HttpHeaderKind.Request | HttpHeaderKind.Response), + HeaderInfo.CreateMulti<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParsePragma, HttpHeaderKind.Request | HttpHeaderKind.Response), HeaderInfo.CreateMulti<AuthenticationHeaderValue> ("Proxy-Authenticate", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Response), HeaderInfo.CreateSingle<AuthenticationHeaderValue> ("Proxy-Authorization", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Request), HeaderInfo.CreateSingle<RangeHeaderValue> ("Range", RangeHeaderValue.TryParse, HttpHeaderKind.Request), HeaderInfo.CreateSingle<Uri> ("Referer", Parser.Uri.TryParse, HttpHeaderKind.Request), HeaderInfo.CreateSingle<RetryConditionHeaderValue> ("Retry-After", RetryConditionHeaderValue.TryParse, HttpHeaderKind.Response), HeaderInfo.CreateMulti<ProductInfoHeaderValue> ("Server", ProductInfoHeaderValue.TryParse, HttpHeaderKind.Response), - HeaderInfo.CreateMulti<TransferCodingWithQualityHeaderValue> ("TE", TransferCodingWithQualityHeaderValue.TryParse, HttpHeaderKind.Request), - HeaderInfo.CreateMulti<string> ("Trailer", Parser.Token.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), + HeaderInfo.CreateMulti<TransferCodingWithQualityHeaderValue> ("TE", TransferCodingWithQualityHeaderValue.TryParse, HttpHeaderKind.Request, 0), + HeaderInfo.CreateMulti<string> ("Trailer", CollectionParser.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), HeaderInfo.CreateMulti<TransferCodingHeaderValue> ("Transfer-Encoding", TransferCodingHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), HeaderInfo.CreateMulti<ProductHeaderValue> ("Upgrade", ProductHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), - HeaderInfo.CreateMultiList<ProductInfoHeaderValue> ("User-Agent", ProductInfoHeaderValue.TryParse, HttpHeaderKind.Request), - HeaderInfo.CreateMulti<string> ("Vary", Parser.Token.TryParse, HttpHeaderKind.Response), + HeaderInfo.CreateMulti<ProductInfoHeaderValue> ("User-Agent", ProductInfoHeaderValue.TryParse, HttpHeaderKind.Request), + HeaderInfo.CreateMulti<string> ("Vary", CollectionParser.TryParse, HttpHeaderKind.Response), HeaderInfo.CreateMulti<ViaHeaderValue> ("Via", ViaHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), HeaderInfo.CreateMulti<WarningHeaderValue> ("Warning", WarningHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response), HeaderInfo.CreateMulti<AuthenticationHeaderValue> ("WWW-Authenticate", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Response) @@ -231,16 +231,9 @@ namespace System.Net.Http.Headers if (values == null) throw new ArgumentNullException ("values"); - if (string.IsNullOrEmpty (name)) - return false; - - Parser.Token.Check (name); - HeaderInfo headerInfo; - if (known_headers.TryGetValue (name, out headerInfo) && (headerInfo.HeaderKind & HeaderKind) == 0) { - if (HeaderKind != HttpHeaderKind.None && ((HeaderKind | headerInfo.HeaderKind) & HttpHeaderKind.Content) != 0) - return false; - } + if (!TryCheckName (name, out headerInfo)) + return false; AddInternal (name, values, null, true); return true; @@ -264,6 +257,21 @@ namespace System.Net.Http.Headers return headerInfo; } + bool TryCheckName (string name, out HeaderInfo headerInfo) + { + if (!Parser.Token.TryCheck (name)) { + headerInfo = null; + return false; + } + + if (known_headers.TryGetValue (name, out headerInfo) && (headerInfo.HeaderKind & HeaderKind) == 0) { + if (HeaderKind != HttpHeaderKind.None && ((HeaderKind | headerInfo.HeaderKind) & HttpHeaderKind.Content) != 0) + return false; + } + + return true; + } + public void Clear () { connectionclose = null; @@ -301,6 +309,8 @@ namespace System.Net.Http.Headers public IEnumerable<string> GetValues (string name) { + CheckName (name); + IEnumerable<string> values; if (!TryGetValues (name, out values)) throw new InvalidOperationException (); @@ -316,7 +326,11 @@ namespace System.Net.Http.Headers public bool TryGetValues (string name, out IEnumerable<string> values) { - var header_info = CheckName (name); + HeaderInfo headerInfo; + if (!TryCheckName (name, out headerInfo)) { + values = null; + return false; + } HeaderBucket bucket; if (!headers.TryGetValue (name, out bucket)) { @@ -324,7 +338,7 @@ namespace System.Net.Http.Headers return false; } - values = GetAllHeaderValues (bucket, header_info); + values = GetAllHeaderValues (bucket, headerInfo); return true; } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs index 0f98be658d..f87d4f741b 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs @@ -46,6 +46,8 @@ namespace System.Net.Http.Headers OpenParens, } + public static readonly Token Empty = new Token (Type.Token, 0, 0); + readonly Type type; public Token (Type type, int startPosition, int endPosition) diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeHeaderValue.cs index 5379a6099f..296010aa2a 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeHeaderValue.cs @@ -33,7 +33,7 @@ namespace System.Net.Http.Headers public class MediaTypeHeaderValue : ICloneable { internal List<NameValueHeaderValue> parameters; - string media_type; + internal string media_type; public MediaTypeHeaderValue (string mediaType) { @@ -150,7 +150,8 @@ namespace System.Net.Http.Headers switch (token.Value.Kind) { case Token.Type.SeparatorSemicolon: - if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters)) + Token t; + if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters, out t) || t != Token.Type.End) return false; break; case Token.Type.End: @@ -167,37 +168,7 @@ namespace System.Net.Http.Headers return true; } - internal static bool TryParse<T> (string input, out T parsedValue, Func<T> factory) where T : MediaTypeHeaderValue - { - parsedValue = null; - - var lexer = new Lexer (input); - - string media; - List<NameValueHeaderValue> parameters = null; - var token = TryParseMediaType (lexer, out media); - if (token == null) - return false; - - switch (token.Value.Kind) { - case Token.Type.SeparatorSemicolon: - if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters)) - return false; - break; - case Token.Type.End: - break; - default: - return false; - } - - parsedValue = factory (); - parsedValue.media_type = media; - parsedValue.parameters = parameters; - - return true; - } - - static Token? TryParseMediaType (Lexer lexer, out string media) + internal static Token? TryParseMediaType (Lexer lexer, out string media) { media = null; diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs index a3415fc1e1..1cf406dbfd 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs @@ -26,6 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Collections.Generic; + namespace System.Net.Http.Headers { public sealed class MediaTypeWithQualityHeaderValue : MediaTypeHeaderValue @@ -65,7 +67,40 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out MediaTypeWithQualityHeaderValue parsedValue) { - return TryParse (input, out parsedValue, () => new MediaTypeWithQualityHeaderValue ()); + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + + parsedValue = null; + return false; + } + + static bool TryParseElement (Lexer lexer, out MediaTypeWithQualityHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + string media; + List<NameValueHeaderValue> parameters = null; + var token = TryParseMediaType (lexer, out media); + if (token == null) { + t = Token.Empty; + return false; + } + + t = token.Value; + if (t == Token.Type.SeparatorSemicolon && (!NameValueHeaderValue.TryParseParameters (lexer, out parameters, out t) || t != Token.Type.End)) + return false; + + parsedValue = new MediaTypeWithQualityHeaderValue (); + parsedValue.media_type = media; + parsedValue.parameters = parameters; + return true; + } + + internal static bool TryParse (string input, int minimalCount, out List<MediaTypeWithQualityHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); } } } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueHeaderValue.cs index 906ab3aa65..e3766a4eb1 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueHeaderValue.cs @@ -32,7 +32,7 @@ namespace System.Net.Http.Headers { public class NameValueHeaderValue : ICloneable { - string value; + internal string value; public NameValueHeaderValue (string name) : this (name, null) @@ -53,11 +53,11 @@ namespace System.Net.Http.Headers this.value = source.value; } - private NameValueHeaderValue () + internal NameValueHeaderValue () { } - public string Name { get; private set; } + public string Name { get; internal set; } public string Value { get { @@ -121,27 +121,22 @@ namespace System.Net.Http.Headers throw new FormatException (input); } - internal static bool TryParseParameters (Lexer lexer, out List<NameValueHeaderValue> result) + internal static bool TryParsePragma (string input, int minimalCount, out List<NameValueHeaderValue> result) { - return TryParseCollection (lexer, out result, Token.Type.SeparatorSemicolon); + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); } - internal static bool TryParsePragma (string input, out List<NameValueHeaderValue> result) - { - return TryParseCollection (new Lexer (input), out result, Token.Type.SeparatorComma); - } - - static bool TryParseCollection (Lexer lexer, out List<NameValueHeaderValue> result, Token.Type separator) + internal static bool TryParseParameters (Lexer lexer, out List<NameValueHeaderValue> result, out Token t) { var list = new List<NameValueHeaderValue> (); result = null; - Token t; - - do { + while (true) { var attr = lexer.Scan (); - if (attr != Token.Type.Token) + if (attr != Token.Type.Token) { + t = Token.Empty; return false; + } string value = null; @@ -156,19 +151,17 @@ namespace System.Net.Http.Headers t = lexer.Scan (); } - if (t == separator|| t == Token.Type.End) { - list.Add (new NameValueHeaderValue () { - Name = lexer.GetStringValue (attr), - value = value - }); - } else { - return false; - } + list.Add (new NameValueHeaderValue () { + Name = lexer.GetStringValue (attr), + value = value + }); - } while (t == separator); + if (t == Token.Type.SeparatorSemicolon) + continue; - result = list; - return true; + result = list; + return true; + } } public override string ToString () @@ -181,35 +174,39 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out NameValueHeaderValue parsedValue) { - parsedValue = null; - var lexer = new Lexer (input); - var t = lexer.Scan (); - if (t != Token.Type.Token && t != Token.Type.QuotedString) - return false; + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; - string v = null; - var token2 = lexer.Scan (); - if (token2 != Token.Type.End) { - if (token2 != Token.Type.SeparatorEqual) - return false; - - token2 = lexer.Scan (); + parsedValue = null; + return false; + } - if (token2 == Token.Type.Token || token2 == Token.Type.QuotedString) { - v = lexer.GetStringValue (token2); - token2 = lexer.Scan (); - } + static bool TryParseElement (Lexer lexer, out NameValueHeaderValue parsedValue, out Token t) + { + parsedValue = null; - if (token2 != Token.Type.End) - return false; - } + t = lexer.Scan (); + if (t != Token.Type.Token) + return false; parsedValue = new NameValueHeaderValue () { Name = lexer.GetStringValue (t), - value = v }; + t = lexer.Scan (); + if (t == Token.Type.SeparatorEqual) { + t = lexer.Scan (); + + if (t == Token.Type.Token || t == Token.Type.QuotedString) { + parsedValue.value = lexer.GetStringValue (t); + t = lexer.Scan (); + } else { + return false; + } + } + return true; } } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs index 81d7bb089c..3d32834184 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs @@ -53,8 +53,8 @@ namespace System.Net.Http.Headers } } - private NameValueWithParametersHeaderValue (NameValueHeaderValue source) - : base (source) + private NameValueWithParametersHeaderValue () + : base () { } @@ -102,15 +102,52 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out NameValueWithParametersHeaderValue parsedValue) { - List<NameValueHeaderValue> values; - if (!TryParseParameters (new Lexer (input), out values)) { - parsedValue = null; + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + + parsedValue = null; + return false; + } + + internal static bool TryParse (string input, int minimalCount, out List<NameValueWithParametersHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out NameValueWithParametersHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + t = lexer.Scan (); + if (t != Token.Type.Token) return false; + + parsedValue = new NameValueWithParametersHeaderValue () { + Name = lexer.GetStringValue (t), + }; + + t = lexer.Scan (); + if (t == Token.Type.SeparatorEqual) { + t = lexer.Scan (); + + if (t == Token.Type.Token || t == Token.Type.QuotedString) { + parsedValue.value = lexer.GetStringValue (t); + t = lexer.Scan (); + } else { + return false; + } + } + + if (t == Token.Type.SeparatorSemicolon) { + List<NameValueHeaderValue> result; + if (!TryParseParameters (lexer, out result, out t)) + return false; + + parsedValue.parameters = result; } - parsedValue = new NameValueWithParametersHeaderValue (values[0]); - values.RemoveAt (0); - parsedValue.parameters = values; return true; } } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs index cdf73d3a78..79a3ca380c 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs @@ -28,6 +28,7 @@ using System.Net.Mail; using System.Globalization; +using System.Collections.Generic; namespace System.Net.Http.Headers { @@ -64,14 +65,7 @@ namespace System.Net.Http.Headers if (s == null) return false; - if (!Lexer.IsValidToken (s)) { - if (s.Length == 0) - return false; - - return false; - } - - return true; + return Lexer.IsValidToken (s); } public static void CheckQuotedString (string s) diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductHeaderValue.cs index 306c9f228c..9614df1293 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductHeaderValue.cs @@ -26,6 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Collections.Generic; + namespace System.Net.Http.Headers { public class ProductHeaderValue : ICloneable @@ -87,15 +89,30 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out ProductHeaderValue parsedValue) { + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + parsedValue = null; + return false; + } - var lexer = new Lexer (input); - var t = lexer.Scan (); + internal static bool TryParse (string input, int minimalCount, out List<ProductHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out ProductHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + t = lexer.Scan (); if (t != Token.Type.Token) return false; - var value = new ProductHeaderValue (); - value.Name = lexer.GetStringValue (t); + parsedValue = new ProductHeaderValue (); + parsedValue.Name = lexer.GetStringValue (t); t = lexer.Scan (); if (t == Token.Type.SeparatorSlash) { @@ -103,14 +120,10 @@ namespace System.Net.Http.Headers if (t != Token.Type.Token) return false; - value.Version = lexer.GetStringValue (t); + parsedValue.Version = lexer.GetStringValue (t); t = lexer.Scan (); } - if (t != Token.Type.End) - return false; - - parsedValue = value; return true; } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductInfoHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductInfoHeaderValue.cs index daf47ac31e..baace53ed8 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductInfoHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/ProductInfoHeaderValue.cs @@ -106,7 +106,7 @@ namespace System.Net.Http.Headers return true; } - internal static bool TryParse (string input, out List<ProductInfoHeaderValue> result) + internal static bool TryParse (string input, int minimalCount, out List<ProductInfoHeaderValue> result) { var list = new List<ProductInfoHeaderValue> (); var lexer = new Lexer (input); @@ -118,8 +118,12 @@ namespace System.Net.Http.Headers return false; if (element == null) { - result = list; - return true; + if (list != null && minimalCount <= list.Count) { + result = list; + return true; + } + + return false; } list.Add (element); diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/StringWithQualityHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/StringWithQualityHeaderValue.cs index 635ed00223..648d4222e3 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/StringWithQualityHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/StringWithQualityHeaderValue.cs @@ -27,6 +27,8 @@ // using System.Globalization; +using System.Collections.Generic; + namespace System.Net.Http.Headers { public class StringWithQualityHeaderValue : ICloneable @@ -82,10 +84,24 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out StringWithQualityHeaderValue parsedValue) { + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + parsedValue = null; + return false; + } - var lexer = new Lexer (input); - var t = lexer.Scan (); + internal static bool TryParse (string input, int minimalCount, out List<StringWithQualityHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out StringWithQualityHeaderValue parsedValue, out Token t) + { + parsedValue = null; + t = lexer.Scan (); if (t != Token.Type.Token) return false; @@ -120,9 +136,6 @@ namespace System.Net.Http.Headers t = lexer.Scan (); } - if (t != Token.Type.End) - return false; - parsedValue = value; return true; } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingHeaderValue.cs index 8f0db59283..6e9825ea4c 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingHeaderValue.cs @@ -32,7 +32,7 @@ namespace System.Net.Http.Headers { public class TransferCodingHeaderValue : ICloneable { - string value; + internal string value; internal List<NameValueHeaderValue> parameters; public TransferCodingHeaderValue (string value) @@ -106,30 +106,36 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out TransferCodingHeaderValue parsedValue) { - return TryParse (input, out parsedValue, () => new TransferCodingHeaderValue ()); + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + + parsedValue = null; + return false; } - internal static bool TryParse<T> (string input, out T parsedValue, Func<T> factory) where T : TransferCodingHeaderValue + internal static bool TryParse (string input, int minimalCount, out List<TransferCodingHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out TransferCodingHeaderValue parsedValue, out Token t) { parsedValue = null; - var lexer = new Lexer (input); - var t = lexer.Scan (); + t = lexer.Scan (); if (t != Token.Type.Token) return false; - var result = factory (); + var result = new TransferCodingHeaderValue (); result.value = lexer.GetStringValue (t); t = lexer.Scan (); // Parameters parsing - if (t == Token.Type.SeparatorSemicolon) { - if (!NameValueHeaderValue.TryParseParameters (lexer, out result.parameters)) - return false; - } else if (t != Token.Type.End) { + if (t == Token.Type.SeparatorSemicolon && (!NameValueHeaderValue.TryParseParameters (lexer, out result.parameters, out t) || t != Token.Type.End)) return false; - } parsedValue = result; return true; diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs index 0a6e08373c..845b95ef5c 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs @@ -26,6 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Collections.Generic; + namespace System.Net.Http.Headers { public sealed class TransferCodingWithQualityHeaderValue : TransferCodingHeaderValue @@ -65,7 +67,39 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out TransferCodingWithQualityHeaderValue parsedValue) { - return TryParse (input, out parsedValue, () => new TransferCodingWithQualityHeaderValue ()); + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + + parsedValue = null; + return false; + } + + internal static bool TryParse (string input, int minimalCount, out List<TransferCodingWithQualityHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out TransferCodingWithQualityHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + t = lexer.Scan (); + if (t != Token.Type.Token) + return false; + + var result = new TransferCodingWithQualityHeaderValue (); + result.value = lexer.GetStringValue (t); + + t = lexer.Scan (); + + // Parameters parsing + if (t == Token.Type.SeparatorSemicolon && (!NameValueHeaderValue.TryParseParameters (lexer, out result.parameters, out t) || t != Token.Type.End)) + return false; + + parsedValue = result; + return true; } } } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ViaHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ViaHeaderValue.cs index 4da14004e1..9381977ee1 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/ViaHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/ViaHeaderValue.cs @@ -26,6 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Collections.Generic; + namespace System.Net.Http.Headers { public class ViaHeaderValue : ICloneable @@ -110,11 +112,25 @@ namespace System.Net.Http.Headers public static bool TryParse (string input, out ViaHeaderValue parsedValue) { + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + parsedValue = null; + return false; + } - var lexer = new Lexer (input); + internal static bool TryParse (string input, int minimalCount, out List<ViaHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } - var t = lexer.Scan (); + static bool TryParseElement (Lexer lexer, out ViaHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + t = lexer.Scan (); if (t != Token.Type.Token) return false; @@ -150,8 +166,9 @@ namespace System.Net.Http.Headers value.ReceivedBy = lexer.GetStringValue (next, t); string comment; - if (!lexer.ScanCommentOptional (out comment)) - return false; + if (lexer.ScanCommentOptional (out comment, out t)) { + t = lexer.Scan (); + } value.Comment = comment; parsedValue = value; diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/WarningHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/WarningHeaderValue.cs index fc58299cf0..5c65339ef7 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/WarningHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/WarningHeaderValue.cs @@ -27,6 +27,7 @@ // using System.Globalization; +using System.Collections.Generic; namespace System.Net.Http.Headers { @@ -100,13 +101,28 @@ namespace System.Net.Http.Headers throw new FormatException (input); } - + public static bool TryParse (string input, out WarningHeaderValue parsedValue) { + var lexer = new Lexer (input); + Token token; + if (TryParseElement (lexer, out parsedValue, out token) && token == Token.Type.End) + return true; + parsedValue = null; + return false; + } - var lexer = new Lexer (input); - var t = lexer.Scan (); + internal static bool TryParse (string input, int minimalCount, out List<WarningHeaderValue> result) + { + return CollectionParser.TryParse (input, minimalCount, TryParseElement, out result); + } + + static bool TryParseElement (Lexer lexer, out WarningHeaderValue parsedValue, out Token t) + { + parsedValue = null; + + t = lexer.Scan (); if (t != Token.Type.Token) return false; @@ -148,9 +164,6 @@ namespace System.Net.Http.Headers t = lexer.Scan (); } - if (t != Token.Type.End) - return false; - parsedValue = value; return true; } diff --git a/mcs/class/System.Net.Http/System.Net.Http.dll.sources b/mcs/class/System.Net.Http/System.Net.Http.dll.sources index ccca104fd9..b40b2a170c 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/System.Net.Http.dll.sources @@ -22,6 +22,7 @@ System.Net.Http/StringContent.cs System.Net.Http.Headers/AuthenticationHeaderValue.cs System.Net.Http.Headers/CacheControlHeaderValue.cs System.Net.Http.Headers/CollectionExtensions.cs +System.Net.Http.Headers/CollectionParser.cs System.Net.Http.Headers/ContentDispositionHeaderValue.cs System.Net.Http.Headers/ContentRangeHeaderValue.cs System.Net.Http.Headers/EntityTagHeaderValue.cs diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs index 656911ee0e..354dba96bf 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs @@ -247,7 +247,8 @@ namespace System.Net.Http wr.PreAuthenticate = preAuthenticate; if (useCookies) { - wr.CookieContainer = cookieContainer; + // It cannot be null or allowAutoRedirect won't work + wr.CookieContainer = CookieContainer; } if (useDefaultCredentials) { @@ -271,12 +272,12 @@ namespace System.Net.Http return wr; } - HttpResponseMessage CreateResponseMessage (HttpWebResponse wr, HttpRequestMessage requestMessage) + HttpResponseMessage CreateResponseMessage (HttpWebResponse wr, HttpRequestMessage requestMessage, CancellationToken cancellationToken) { var response = new HttpResponseMessage (wr.StatusCode); response.RequestMessage = requestMessage; response.ReasonPhrase = wr.StatusDescription; - response.Content = new StreamContent (wr.GetResponseStream ()); + response.Content = new StreamContent (wr.GetResponseStream (), cancellationToken); var headers = wr.Headers; for (int i = 0; i < headers.Count; ++i) { @@ -328,7 +329,7 @@ namespace System.Net.Http } } - return CreateResponseMessage (wresponse, request); + return CreateResponseMessage (wresponse, request, cancellationToken); } } } diff --git a/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs b/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs index 9dabf983b6..a249aad6f5 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs @@ -27,6 +27,7 @@ // using System.IO; +using System.Threading; using System.Threading.Tasks; namespace System.Net.Http @@ -35,6 +36,7 @@ namespace System.Net.Http { readonly Stream content; readonly int bufferSize; + readonly CancellationToken cancellationToken; public StreamContent (Stream content) : this (content, 16 * 1024) @@ -53,6 +55,18 @@ namespace System.Net.Http this.bufferSize = bufferSize; } + // + // Workarounds for poor .NET API + // Instead of having SerializeToStreamAsync with CancellationToken as public API. Only LoadIntoBufferAsync + // called internally from the send worker can be cancelled and user cannot see/do it + // + internal StreamContent (Stream content, CancellationToken cancellationToken) + : this (content) + { + // We don't own the token so don't worry about disposing it + this.cancellationToken = cancellationToken; + } + protected override Task<Stream> CreateContentReadStreamAsync () { return Task.FromResult (content); @@ -69,7 +83,7 @@ namespace System.Net.Http protected internal override Task SerializeToStreamAsync (Stream stream, TransportContext context) { - return content.CopyToAsync (stream, bufferSize); + return content.CopyToAsync (stream, bufferSize, cancellationToken); } protected internal override bool TryComputeLength (out long length) diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs index a4b2555160..cae4a65c82 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs @@ -131,6 +131,14 @@ namespace MonoTests.System.Net.Http.Headers } [Test] + public void TryGetValuesTest () + { + IEnumerable<string> headerValues; + Assert.IsFalse (headers.TryGetValues (null, out headerValues), "#1"); + Assert.IsFalse (headers.TryGetValues ("some-name", out headerValues), "#2"); + } + + [Test] public void ToStringTest () { headers.Add ("aa", "v"); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs index 7d08832868..32cf785a0e 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs @@ -157,6 +157,9 @@ namespace MonoTests.System.Net.Http.Headers NameValueHeaderValue res; Assert.IsFalse (NameValueHeaderValue.TryParse ("", out res), "#1"); Assert.IsNull (res, "#2"); + + Assert.IsFalse (NameValueHeaderValue.TryParse ("\"a\"=b", out res), "#3"); + Assert.IsNull (res, "#4"); } } } diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs index b852fdc05f..79ae114f65 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs @@ -35,6 +35,7 @@ using System.Net.Http; using System.Net; using System.Net.Http.Headers; using System.Linq; +using System.IO; namespace MonoTests.System.Net.Http { @@ -361,15 +362,55 @@ namespace MonoTests.System.Net.Http } [Test] - public void Headers_Complex () + public void Headers_MultiValues () { HttpRequestMessage message = new HttpRequestMessage (); HttpRequestHeaders headers = message.Headers; + headers.Add ("Accept", "application/vnd.citrix.requesttokenresponse+xml, application/vnd.citrix.requesttokenchoices+xml"); + headers.Add ("Accept-Charset", "aa ;Q=0,bb;Q=1"); + headers.Add ("Expect", "x=1; v, y=5"); + headers.Add ("If-Match", "\"a\",*, \"b\",*"); headers.Add ("user-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36"); + Assert.AreEqual (2, headers.Accept.Count, "#1a"); + Assert.IsTrue (headers.Accept.SequenceEqual ( + new[] { + new MediaTypeWithQualityHeaderValue ("application/vnd.citrix.requesttokenresponse+xml"), + new MediaTypeWithQualityHeaderValue ("application/vnd.citrix.requesttokenchoices+xml"), + } + ), "#1b"); - Assert.AreEqual (6, headers.UserAgent.Count); + Assert.AreEqual (2, headers.AcceptCharset.Count, "#2a"); + Assert.IsTrue (headers.AcceptCharset.SequenceEqual ( + new[] { + new StringWithQualityHeaderValue ("aa", 0), + new StringWithQualityHeaderValue ("bb", 1), + } + ), "#2b"); + + Assert.AreEqual (2, headers.Expect.Count, "#3a"); + var expect_expected = new[] { + new NameValueWithParametersHeaderValue ("x", "1") { + }, + new NameValueWithParametersHeaderValue ("y", "5"), + }; + expect_expected [0].Parameters.Add (new NameValueHeaderValue ("v")); + Assert.IsTrue (headers.Expect.SequenceEqual ( + expect_expected + ), "#3b"); + + Assert.AreEqual (4, headers.IfMatch.Count, "#4a"); + Assert.IsTrue (headers.IfMatch.SequenceEqual ( + new[] { + new EntityTagHeaderValue ("\"a\""), + EntityTagHeaderValue.Any, + new EntityTagHeaderValue ("\"b\""), + EntityTagHeaderValue.Any + } + ), "#4b"); + + Assert.AreEqual (6, headers.UserAgent.Count, "#10a"); Assert.IsTrue (headers.UserAgent.SequenceEqual ( new[] { @@ -380,7 +421,7 @@ namespace MonoTests.System.Net.Http new ProductInfoHeaderValue ("Chrome", "29.0.1547.62"), new ProductInfoHeaderValue ("Safari", "537.36") } - )); + ), "#10b"); } [Test] diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs index b92b3e644d..b13e8cae41 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs @@ -295,6 +295,56 @@ namespace MonoTests.System.Net.Http } [Test] + public void Headers_MultiValues () + { + var message = new HttpResponseMessage (); + var headers = message.Headers; + + headers.Add ("Proxy-Authenticate", "x, y, z,i"); + headers.Add ("Upgrade", "HTTP/2.0, SHTTP/1.3, IRC, RTA/x11"); + headers.Add ("Via", "1.0 fred, 1.1 nowhere.com (Apache/1.1)"); + headers.Add ("Warning", "199 Miscellaneous \"w\", 200 a \"b\""); + + Assert.AreEqual (4, headers.ProxyAuthenticate.Count, "#1a"); + Assert.IsTrue (headers.ProxyAuthenticate.SequenceEqual ( + new[] { + new AuthenticationHeaderValue ("x"), + + new AuthenticationHeaderValue ("y"), + new AuthenticationHeaderValue ("z"), + new AuthenticationHeaderValue ("i") + } + ), "#1b"); + + + Assert.AreEqual (4, headers.Upgrade.Count, "#2a"); + Assert.IsTrue (headers.Upgrade.SequenceEqual ( + new[] { + new ProductHeaderValue ("HTTP", "2.0"), + new ProductHeaderValue ("SHTTP", "1.3"), + new ProductHeaderValue ("IRC"), + new ProductHeaderValue ("RTA", "x11") + } + ), "#2b"); + + Assert.AreEqual (2, headers.Via.Count, "#3a"); + Assert.IsTrue (headers.Via.SequenceEqual ( + new[] { + new ViaHeaderValue ("1.0", "fred"), + new ViaHeaderValue ("1.1", "nowhere.com", null, "(Apache/1.1)") + } + ), "#2b"); + + Assert.AreEqual (2, headers.Warning.Count, "#4a"); + Assert.IsTrue (headers.Warning.SequenceEqual ( + new[] { + new WarningHeaderValue (199, "Miscellaneous", "\"w\""), + new WarningHeaderValue (200, "a", "\"b\"") + } + ), "#4b"); + } + + [Test] public void Header_BaseImplementation () { HttpResponseMessage message = new HttpResponseMessage (); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs index edd4b839c1..413e459526 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs @@ -309,6 +309,21 @@ namespace MonoTests.System.Net.Http } [Test] + public void Headers_Multi () + { + var sc = new StreamContent (MemoryStream.Null); + var headers = sc.Headers; + + headers.Add ("Allow", ""); + headers.Add ("Allow", "a , b, c"); + + Assert.AreEqual (3, headers.Allow.Count, "#1a"); + Assert.IsTrue (headers.Allow.SequenceEqual ( + new[] { "a", "b", "c" } + ), "#1b"); + } + + [Test] public void LoadIntoBuffer () { var ms = new MemoryStream (); diff --git a/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources new file mode 100644 index 0000000000..ccca104fd9 --- /dev/null +++ b/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources @@ -0,0 +1,53 @@ +../../build/common/Consts.cs +Assembly/AssemblyInfo.cs +System.Net.Http/ByteArrayContent.cs +System.Net.Http/ClientCertificateOption.cs +System.Net.Http/DelegatingHandler.cs +System.Net.Http/FormUrlEncodedContent.cs +System.Net.Http/HttpClient.cs +System.Net.Http/HttpClientHandler.cs +System.Net.Http/HttpCompletionOption.cs +System.Net.Http/HttpContent.cs +System.Net.Http/HttpMessageHandler.cs +System.Net.Http/HttpMessageInvoker.cs +System.Net.Http/HttpMethod.cs +System.Net.Http/HttpRequestException.cs +System.Net.Http/HttpRequestMessage.cs +System.Net.Http/HttpResponseMessage.cs +System.Net.Http/MessageProcessingHandler.cs +System.Net.Http/MultipartContent.cs +System.Net.Http/MultipartFormDataContent.cs +System.Net.Http/StreamContent.cs +System.Net.Http/StringContent.cs +System.Net.Http.Headers/AuthenticationHeaderValue.cs +System.Net.Http.Headers/CacheControlHeaderValue.cs +System.Net.Http.Headers/CollectionExtensions.cs +System.Net.Http.Headers/ContentDispositionHeaderValue.cs +System.Net.Http.Headers/ContentRangeHeaderValue.cs +System.Net.Http.Headers/EntityTagHeaderValue.cs +System.Net.Http.Headers/HashCodeCalculator.cs +System.Net.Http.Headers/HeaderInfo.cs +System.Net.Http.Headers/HttpContentHeaders.cs +System.Net.Http.Headers/HttpHeaderKind.cs +System.Net.Http.Headers/HttpHeaders.cs +System.Net.Http.Headers/HttpHeaderValueCollection.cs +System.Net.Http.Headers/HttpRequestHeaders.cs +System.Net.Http.Headers/HttpResponseHeaders.cs +System.Net.Http.Headers/Lexer.cs +System.Net.Http.Headers/MediaTypeHeaderValue.cs +System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs +System.Net.Http.Headers/NameValueHeaderValue.cs +System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs +System.Net.Http.Headers/Parser.cs +System.Net.Http.Headers/ProductHeaderValue.cs +System.Net.Http.Headers/ProductInfoHeaderValue.cs +System.Net.Http.Headers/QualityValue.cs +System.Net.Http.Headers/RangeConditionHeaderValue.cs +System.Net.Http.Headers/RangeHeaderValue.cs +System.Net.Http.Headers/RangeItemHeaderValue.cs +System.Net.Http.Headers/RetryConditionHeaderValue.cs +System.Net.Http.Headers/StringWithQualityHeaderValue.cs +System.Net.Http.Headers/TransferCodingHeaderValue.cs +System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs +System.Net.Http.Headers/ViaHeaderValue.cs +System.Net.Http.Headers/WarningHeaderValue.cs
\ No newline at end of file diff --git a/mcs/class/System.Numerics/System.Numerics/BigInteger.cs b/mcs/class/System.Numerics/System.Numerics/BigInteger.cs index 816ca2ffce..a05d403988 100644 --- a/mcs/class/System.Numerics/System.Numerics/BigInteger.cs +++ b/mcs/class/System.Numerics/System.Numerics/BigInteger.cs @@ -473,10 +473,20 @@ namespace System.Numerics { return (((long)high) << 32) | low; } - if (high > 0x80000000u) + /* + We cannot represent negative numbers smaller than long.MinValue. + Those values are encoded into what look negative numbers, so negating + them produces a positive value, that's why it's safe to check for that + condition. + + long.MinValue works fine since it's bigint encoding looks like a negative + number, but since long.MinValue == -long.MinValue, we're good. + */ + + long result = - ((((long)high) << 32) | (long)low); + if (result > 0) throw new OverflowException (); - - return - ((((long)high) << 32) | (long)low); + return result; } [CLSCompliantAttribute (false)] diff --git a/mcs/class/System.Numerics/System.Numerics/Complex.cs b/mcs/class/System.Numerics/System.Numerics/Complex.cs index 6c172751b3..89b6bd463a 100644 --- a/mcs/class/System.Numerics/System.Numerics/Complex.cs +++ b/mcs/class/System.Numerics/System.Numerics/Complex.cs @@ -231,7 +231,7 @@ namespace System.Numerics { public static Complex Cosh (Complex value) { return new Complex (Math.Cosh (value.real) * Math.Cos (value.imaginary), - -Math.Sinh (value.real) * Math.Sin (value.imaginary)); + Math.Sinh (value.real) * Math.Sin (value.imaginary)); } public static Complex Negate (Complex value) diff --git a/mcs/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs b/mcs/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs index 098c50854b..a5ec016bb3 100644 --- a/mcs/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs +++ b/mcs/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs @@ -1145,5 +1145,19 @@ namespace MonoTests.System.Numerics a = new BigInteger (); Assert.AreEqual (BigInteger.Zero.GetHashCode (), a.GetHashCode (), "#15"); } + + [Test] + public void Bug16526 () + { + var x = BigInteger.Pow(2, 63); + x *= -1; + x -= 1; + Assert.AreEqual ("-9223372036854775809", x.ToString (), "#1"); + try { + x = (long)x; + Assert.Fail ("#2 Must OVF"); + } catch (OverflowException) { + } + } } } diff --git a/mcs/class/System.Reactive.Core/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Core/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Core/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Core/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Debugger/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Debugger/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Debugger/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Debugger/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Experimental/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Experimental/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Experimental/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Experimental/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Interfaces/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Interfaces/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Interfaces/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Interfaces/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Linq/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Linq/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Linq/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Linq/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Observable.Aliases/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Observable.Aliases/Assembly/AssemblyInfo.cs new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/mcs/class/System.Reactive.Observable.Aliases/Assembly/AssemblyInfo.cs diff --git a/mcs/class/System.Reactive.Observable.Aliases/Makefile b/mcs/class/System.Reactive.Observable.Aliases/Makefile new file mode 100644 index 0000000000..23a462f80a --- /dev/null +++ b/mcs/class/System.Reactive.Observable.Aliases/Makefile @@ -0,0 +1,62 @@ +thisdir = class/System.Reactive.Observable.Aliases +SUBDIRS = +include ../../build/rules.make + +LIBRARY = System.Reactive.Observable.Aliases.dll +LIB_MCS_FLAGS = \ + @more_build_args \ + -r:System.dll \ + -r:System.Core.dll \ + -r:System.Reactive.Interfaces.dll \ + -r:System.Reactive.Core.dll \ + -r:System.Reactive.Linq.dll \ + -r:System.Reactive.Providers.dll + +ifeq (true, $(GENERATE_RESOURCES)) +LIB_MCS_FLAGS += /define:GENERATING_RESOURCES +endif + +CLEAN_FILES += $(RESX_RESOURCES) + +RESOURCES = $(RESX_RESOURCES) + +PREBUILT = $(RESX_RESOURCES:=.prebuilt) + +ifeq (2.1, $(FRAMEWORK_VERSION)) +LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT +endif + +NET_4_5 := $(filter 4.5, $(FRAMEWORK_VERSION)) +ifdef NET_4_5 +LIB_MCS_FLAGS += -d:HAS_EDI -d:PREFERASYNC -d:PREFER_ASYNC -d:HAS_AWAIT +endif + +TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) + +EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT) + +VALID_PROFILE := $(filter monodroid net_4_0 net_4_5, $(PROFILE)) +ifndef VALID_PROFILE +LIBRARY_NAME = dummy-System.System.Reactive.Observable.Aliases.dll +NO_SIGN_ASSEMBLY = yes +endif + +INSTALL_PROFILE := $(filter net_4_5, $(PROFILE)) +ifndef INSTALL_PROFILE +NO_INSTALL = yes +endif + +NO_TEST = yes + +include ../../build/library.make + +$(the_lib): $(RESOURCES) + +$(RESX_RESOURCES): %.resources: %.resx + $(RESGEN) $< || cp $@.prebuilt $@ + +$(PREBUILT): %.prebuilt: % + cp $* $@ + +dist-default: $(PREBUILT) + diff --git a/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.dll.sources b/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.dll.sources new file mode 100644 index 0000000000..b157222f94 --- /dev/null +++ b/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.dll.sources @@ -0,0 +1,3 @@ +Assembly/AssemblyInfo.cs +../../../external/rx/Rx/NET/Source/System.Reactive.Observable.Aliases/Observable.Aliases.cs +../../../external/rx/Rx/NET/Source/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs diff --git a/mcs/class/System.Reactive.Observable.Aliases/more_build_args b/mcs/class/System.Reactive.Observable.Aliases/more_build_args new file mode 100644 index 0000000000..a53ee7b7f9 --- /dev/null +++ b/mcs/class/System.Reactive.Observable.Aliases/more_build_args @@ -0,0 +1,3 @@ +-d:SIGNED +-delaysign +-keyfile:../reactive.pub diff --git a/mcs/class/System.Reactive.PlatformServices/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.PlatformServices/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.PlatformServices/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.PlatformServices/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Providers/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Providers/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Providers/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Providers/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Runtime.Remoting/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Runtime.Remoting/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Runtime.Remoting/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Runtime.Remoting/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Windows.Forms/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Windows.Forms/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Windows.Forms/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Windows.Forms/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.Reactive.Windows.Threading/Assembly/AssemblyInfo.cs b/mcs/class/System.Reactive.Windows.Threading/Assembly/AssemblyInfo.cs index 9db583dd8c..e69de29bb2 100644 --- a/mcs/class/System.Reactive.Windows.Threading/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Reactive.Windows.Threading/Assembly/AssemblyInfo.cs @@ -1,2 +0,0 @@ -[assembly:System.Reflection.AssemblyVersion ("2.1.30214.0")] -[assembly:System.Reflection.AssemblyFileVersion ("2.1.30214.0")] diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs index d15a4733fc..45ec6fbd41 100644 --- a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs +++ b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs @@ -162,7 +162,7 @@ namespace System.Runtime.Serialization.Json return null; } else - return new Uri (reader.ReadElementContentAsString ()); + return new Uri (reader.ReadElementContentAsString (), UriKind.RelativeOrAbsolute); } else if (type == typeof (XmlQualifiedName)) { s = reader.ReadElementContentAsString (); int idx = s.IndexOf (':'); diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/OutgoingWebRequestContext.cs b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/OutgoingWebRequestContext.cs index b3154c34b7..f26113c51b 100644 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/OutgoingWebRequestContext.cs +++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/OutgoingWebRequestContext.cs @@ -36,6 +36,7 @@ namespace System.ServiceModel.Web { internal OutgoingWebRequestContext () { + Headers = new WebHeaderCollection (); } public string Accept { get; set; } diff --git a/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs index cba0fb87bc..fbe9250e57 100644 --- a/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs +++ b/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs @@ -1467,6 +1467,25 @@ namespace MonoTests.System.Runtime.Serialization.Json result = entity.GetValue; Assert.AreEqual ("ValueA", result, "#1"); } + + [DataContract(Name = "UriTest")] + public class UriTest + { + [DataMember(Name = "members")] + public Uri MembersRelativeLink { get; set; } + } + + [Test] + public void Bug15169 () + { + const string json = "{\"members\":\"foo/bar/members\"}"; + var serializer = new DataContractJsonSerializer (typeof (UriTest)); + UriTest entity; + using (var stream = new MemoryStream (Encoding.UTF8.GetBytes (json))) + entity = (UriTest) serializer.ReadObject (stream); + + Assert.AreEqual ("foo/bar/members", entity.MembersRelativeLink.ToString ()); + } } public class CharTest diff --git a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs index d1e8ea5ff5..392a9cf54e 100644 --- a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs +++ b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs @@ -61,6 +61,9 @@ namespace MonoTests.System.ServiceModel.Web Assert.IsNotNull (WebOperationContext.Current.IncomingRequest, "#4"); Assert.IsNotNull (WebOperationContext.Current.IncomingResponse, "#5"); Assert.IsNotNull (WebOperationContext.Current.OutgoingResponse, "#6"); // pointless though. + + Assert.IsNotNull (WebOperationContext.Current.OutgoingRequest.Headers, "#7"); + Assert.AreEqual (0, WebOperationContext.Current.OutgoingRequest.Headers.Count, "#8"); #endif } ch.Close (); diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs index e209ec8062..6ebafbd99d 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs @@ -85,7 +85,7 @@ namespace System.ServiceModel.Channels destination = Via ?? RemoteAddress.Uri; } - var web_request = HttpWebRequest.Create (destination); + var web_request = (HttpWebRequest) HttpWebRequest.Create (destination); web_requests.Add (web_request); result.WebRequest = web_request; web_request.Method = "POST"; @@ -145,9 +145,50 @@ namespace System.ServiceModel.Channels string pname = HttpRequestMessageProperty.Name; if (message.Properties.ContainsKey (pname)) { HttpRequestMessageProperty hp = (HttpRequestMessageProperty) message.Properties [pname]; - foreach (var key in hp.Headers.AllKeys) - if (!WebHeaderCollection.IsRestricted (key)) + foreach (var key in hp.Headers.AllKeys) { + if (WebHeaderCollection.IsRestricted (key)) { // do not ignore this. WebHeaderCollection rejects restricted ones. + // FIXME: huh, there should be any better way to do such stupid conversion. + switch (key) { + case "Accept": + web_request.Accept = hp.Headers [key]; + break; + case "Connection": + web_request.Connection = hp.Headers [key]; + break; + //case "ContentLength": + // web_request.ContentLength = hp.Headers [key]; + // break; + case "ContentType": + web_request.ContentType = hp.Headers [key]; + break; + //case "Date": + // web_request.Date = hp.Headers [key]; + // break; + case "Expect": + web_request.Expect = hp.Headers [key]; + break; +#if NET_4_0 + case "Host": + web_request.Host = hp.Headers [key]; + break; +#endif + //case "If-Modified-Since": + // web_request.IfModifiedSince = hp.Headers [key]; + // break; + case "Referer": + web_request.Referer = hp.Headers [key]; + break; + case "Transfer-Encoding": + web_request.TransferEncoding = hp.Headers [key]; + break; + case "User-Agent": + web_request.UserAgent = hp.Headers [key]; + break; + } + } + else web_request.Headers [key] = hp.Headers [key]; + } web_request.Method = hp.Method; // FIXME: do we have to handle hp.QueryString ? if (hp.SuppressEntityBody) diff --git a/mcs/class/System.Transactions/System.Transactions/Enlistment.cs b/mcs/class/System.Transactions/System.Transactions/Enlistment.cs index 3cf7228b32..28342175e8 100644 --- a/mcs/class/System.Transactions/System.Transactions/Enlistment.cs +++ b/mcs/class/System.Transactions/System.Transactions/Enlistment.cs @@ -25,6 +25,12 @@ namespace System.Transactions public void Done () { done = true; + + InternalOnDone(); + } + + internal virtual void InternalOnDone () + { } } } diff --git a/mcs/class/System.Transactions/System.Transactions/PreparingEnlistment.cs b/mcs/class/System.Transactions/System.Transactions/PreparingEnlistment.cs index 8995fcb851..eaaa277c42 100644 --- a/mcs/class/System.Transactions/System.Transactions/PreparingEnlistment.cs +++ b/mcs/class/System.Transactions/System.Transactions/PreparingEnlistment.cs @@ -35,6 +35,11 @@ namespace System.Transactions ForceRollback (null); } + internal override void InternalOnDone () + { + this.Prepared(); + } + [MonoTODO] public void ForceRollback (Exception ex) { diff --git a/mcs/class/System.Web.Services/System.Web.Services.Description/MessageCollection.cs b/mcs/class/System.Web.Services/System.Web.Services.Description/MessageCollection.cs index 355da20160..1b4e9e8356 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Description/MessageCollection.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Description/MessageCollection.cs @@ -53,7 +53,12 @@ namespace System.Web.Services.Description { } public Message this [string name] { - get { return this [IndexOf ((Message) Table [name])]; } + get { + int index = IndexOf ((Message) Table [name]); + if (index >= 0) + return this [index]; + return null; + } } #endregion // Properties diff --git a/mcs/class/System.Web/Assembly/AssemblyInfo.cs b/mcs/class/System.Web/Assembly/AssemblyInfo.cs index 432ee8ec5c..7baf1314ac 100644 --- a/mcs/class/System.Web/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Web/Assembly/AssemblyInfo.cs @@ -49,9 +49,9 @@ using System.Web.UI; #if !NET_4_0 [assembly: AssemblyConfiguration("Development version")] #endif -[assembly: AssemblyCompany("MONO development team")] -[assembly: AssemblyProduct("MONO CLI")] -[assembly: AssemblyCopyright("(c) 2003 Various Authors")] +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] #if !NET_4_0 [assembly: AssemblyTrademark("")] #endif @@ -72,12 +72,9 @@ using System.Web.UI; [assembly: AssemblyKeyFile("../msfinal.pub")] #if NET_4_0 -[assembly: Debuggable (true, false)] [assembly: AssemblyFileVersion (Consts.FxVersion)] -[assembly: AssemblyTargetedPatchBand ("1.0.21-0")] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Dependency ("System", LoadHint.Always)] -[assembly: TypeLibVersion (4, 2)] [assembly: SecurityRules (SecurityRuleSet.Level2, SkipVerificationInFullTrust=true)] [assembly: TypeForwardedTo (typeof (System.Web.Security.MembershipPasswordException))] diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs index 99486acfd2..d37fa87d92 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs @@ -247,9 +247,17 @@ namespace System.Web.Configuration } } - public IDictionary Capabilities { + public IDictionary Capabilities + { get { return capabilities; } - set { capabilities = new Hashtable(value, StringComparer.OrdinalIgnoreCase); } + set { + //value comes with duplicated keys, so we filter them out + capabilities = new Hashtable (value.Keys.Count, StringComparer.OrdinalIgnoreCase); + foreach (object key in value.Keys) { + if (!capabilities.Contains (key)) + capabilities.Add (key, value [key]); + } + } } int defaultSubmitButtonLimit; diff --git a/mcs/class/System.Web/System.Web/HttpHeaderCollection.cs b/mcs/class/System.Web/System.Web/HttpHeaderCollection.cs index 6bc6917339..b015d16ef6 100644 --- a/mcs/class/System.Web/System.Web/HttpHeaderCollection.cs +++ b/mcs/class/System.Web/System.Web/HttpHeaderCollection.cs @@ -34,6 +34,10 @@ namespace System.Web { bool? headerCheckingEnabled; + public HttpHeaderCollection () : base (StringComparer.OrdinalIgnoreCase) + { + } + bool HeaderCheckingEnabled { get { if (headerCheckingEnabled == null) diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs index ac432ab3da..053d20c9c5 100644 --- a/mcs/class/System.Web/System.Web/HttpResponse.cs +++ b/mcs/class/System.Web/System.Web/HttpResponse.cs @@ -510,27 +510,27 @@ namespace System.Web if (headers_sent) throw new HttpException ("Headers have been already sent"); #if !TARGET_J2EE - if (String.Compare (name, "content-length", true, Helpers.InvariantCulture) == 0){ + if (String.Compare (name, "content-length", StringComparison.OrdinalIgnoreCase) == 0){ content_length = (long) UInt64.Parse (value); use_chunked = false; return; } #endif - if (String.Compare (name, "content-type", true, Helpers.InvariantCulture) == 0){ + if (String.Compare (name, "content-type", StringComparison.OrdinalIgnoreCase) == 0){ ContentType = value; return; } #if !TARGET_J2EE - if (String.Compare (name, "transfer-encoding", true, Helpers.InvariantCulture) == 0){ + if (String.Compare (name, "transfer-encoding", StringComparison.OrdinalIgnoreCase) == 0){ transfer_encoding = value; use_chunked = false; return; } #endif - if (String.Compare (name, "cache-control", true, Helpers.InvariantCulture) == 0){ + if (String.Compare (name, "cache-control", StringComparison.OrdinalIgnoreCase) == 0){ user_cache_control = value; return; } diff --git a/mcs/class/System.Web/Test/System.Web/AppBrowsersTest.cs b/mcs/class/System.Web/Test/System.Web/AppBrowsersTest.cs index 3561780ff1..6d02c725aa 100644 --- a/mcs/class/System.Web/Test/System.Web/AppBrowsersTest.cs +++ b/mcs/class/System.Web/Test/System.Web/AppBrowsersTest.cs @@ -40,7 +40,9 @@ using System.Threading; namespace MonoTests.System.Web { [TestFixture] - [Ignore ("Pending fix for bug 351878")] +#if NET_3_0 + [Ignore ("adapters.browser depends on System.Web_test_net_2_0.dll")] +#endif public class AppBrowsersTest { [TestFixtureSetUp] diff --git a/mcs/class/System.Windows.Forms.DataVisualization/Assembly/AssemblyInfo.cs b/mcs/class/System.Windows.Forms.DataVisualization/Assembly/AssemblyInfo.cs index 4df5319b93..da73c9fd9c 100644 --- a/mcs/class/System.Windows.Forms.DataVisualization/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Windows.Forms.DataVisualization/Assembly/AssemblyInfo.cs @@ -50,7 +50,7 @@ using System.Runtime.InteropServices; [assembly: NeutralResourcesLanguage ("en-US")] [assembly: CLSCompliant (true)] [assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile ("../ecma.pub")] +[assembly: AssemblyKeyFile ("../winfx.pub")] [assembly: SecurityRules (SecurityRuleSet.Level1)] diff --git a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization.Charting/Chart.cs b/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization.Charting/Chart.cs index af2c3471f7..95c8d6c28a 100644 --- a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization.Charting/Chart.cs +++ b/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization.Charting/Chart.cs @@ -63,7 +63,7 @@ namespace System.Windows.Forms.DataVisualization.Charting public ChartAreaCollection ChartAreas { get; private set; } public DataManipulator DataManipulator { get; private set;} public Object DataSource { get; set; } - protected override Size DefaultSize { get { return DefaultSize; } }//FIXME + protected override Size DefaultSize { get { return base.DefaultSize; } }//FIXME public Font Font { get; set; } public override Color ForeColor { get; set; } public NamedImagesCollection Images { get; private set;} diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs b/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs index 43f0a75d09..c6a85fbea4 100644..100755 --- a/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs +++ b/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs @@ -125,7 +125,7 @@ namespace Mono.Xml.Schema schemas, nsResolver, options); - if (reader.BaseURI != String.Empty) + if (reader.BaseURI != String.Empty && Uri.IsWellFormedUriString(reader.BaseURI, UriKind.Absolute)) v.SourceUri = new Uri (reader.BaseURI); readerLineInfo = reader as IXmlLineInfo; diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs index 6f7ec34a5d..081f2c76d4 100644..100755 --- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs @@ -441,6 +441,16 @@ namespace MonoTests.System.Xml } } } + + [Test] + public void IgnoresInvalidBaseUri () + { + var source = new StringReader (@"<?xml version='1.0' encoding='utf-8'?><Test></Test>"); + var readerSettings = new XmlReaderSettings { ValidationType = ValidationType.Schema }; + var reader = XmlReader.Create (source, readerSettings, "invalidBaseUri"); + + Assert.IsNotNull (reader); + } } } diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs index e27b8db60f..4be97a8140 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs @@ -13,7 +13,6 @@ // using System; -using System.ComponentModel; using System.Globalization; using System.IO; using System.Xml; @@ -1546,7 +1545,6 @@ namespace MonoTests.System.XmlSerialization } -#if NET_2_0 [Test] public void TestFromEnum_Null_TypeName () { @@ -1566,7 +1564,6 @@ namespace MonoTests.System.XmlSerialization Assert.IsTrue (ex.Message.IndexOf ("AnInvalidValue") != -1, "#4"); Assert.IsTrue (ex.Message.IndexOf ("SomeType") != -1, "#5"); } -#endif [Test] public void WriteCharacter () @@ -1581,7 +1578,7 @@ namespace MonoTests.System.XmlSerialization [Serializable] public class ToBeSerialized { - [DefaultValue ('a')] + [global::System.ComponentModel.DefaultValue ('a')] public char character = '\''; } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XContainer.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XContainer.cs index f38458ca3b..af5fd97640 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XContainer.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XContainer.cs @@ -181,16 +181,20 @@ namespace System.Xml.Linq public IEnumerable <XElement> Elements (XName name) { - foreach (XElement el in Elements ()) - if (el.Name == name) + foreach (XNode n in Nodes ()) { + XElement el = n as XElement; + if (el != null && el.Name == name) yield return el; + } } public XElement Element (XName name) { - foreach (XElement el in Elements ()) - if (el.Name == name) + foreach (XNode n in Nodes ()) { + XElement el = n as XElement; + if (el != null && el.Name == name) return el; + } return null; } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs index 70b6430929..81dea5e4a4 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs @@ -382,7 +382,8 @@ namespace System.Xml.Linq public XAttribute Attribute (XName name) { - foreach (XAttribute a in Attributes ()) + XAttribute next; + for (XAttribute a = attr_first; a != null; a = a.NextAttribute) if (a.Name == name) return a; return null; diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs index 80d0e7b09c..59bbceb4f9 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs @@ -153,7 +153,7 @@ namespace System.Xml.Linq public override string ToString () { - if (ns == XNamespace.None) + if (Object.ReferenceEquals (ns, XNamespace.None)) return local; return String.Concat ("{", ns.NamespaceName, "}", local); } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XObject.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XObject.cs index 8353b25d2b..c620e4f599 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XObject.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XObject.cs @@ -165,42 +165,42 @@ namespace System.Xml.Linq internal void OnAddingObject (object addedObject) { - OnChanging (addedObject, new XObjectChangeEventArgs (XObjectChange.Add)); + OnChanging (addedObject, XObjectChangeEventArgs.Add); } internal void OnAddedObject (object addedObject) { - OnChanged (addedObject, new XObjectChangeEventArgs (XObjectChange.Add)); + OnChanged (addedObject, XObjectChangeEventArgs.Add); } internal void OnNameChanging (object renamedObject) { - OnChanging (renamedObject, new XObjectChangeEventArgs (System.Xml.Linq.XObjectChange.Name)); + OnChanging (renamedObject, XObjectChangeEventArgs.Name); } internal void OnNameChanged (object renamedObject) { - OnChanged (renamedObject, new XObjectChangeEventArgs (System.Xml.Linq.XObjectChange.Name)); + OnChanged (renamedObject, XObjectChangeEventArgs.Name); } internal void OnRemovingObject (object removedObject) { - OnChanging (removedObject, new XObjectChangeEventArgs (XObjectChange.Remove)); + OnChanging (removedObject, XObjectChangeEventArgs.Remove); } internal void OnRemovedObject (object removedObject) { - OnChanged (removedObject, new XObjectChangeEventArgs (XObjectChange.Remove)); + OnChanged (removedObject, XObjectChangeEventArgs.Remove); } internal void OnValueChanging (object changedObject) { - OnChanging (changedObject, new XObjectChangeEventArgs (XObjectChange.Value)); + OnChanging (changedObject, XObjectChangeEventArgs.Value); } internal void OnValueChanged (object changedObject) { - OnChanged (changedObject, new XObjectChangeEventArgs (XObjectChange.Value)); + OnChanged (changedObject, XObjectChangeEventArgs.Value); } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs b/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs index 83bee5fe7e..7aa0bb9f00 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs @@ -24,8 +24,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if !NET_2_1 - using System; using System.Xml; using System.Xml.Linq; @@ -109,5 +107,3 @@ namespace System.Xml.Schema } } } - -#endif diff --git a/mcs/class/System/Documentation/en/System.Net/IPAddress.xml b/mcs/class/System/Documentation/en/System.Net/IPAddress.xml index f2caec0386..e428def11c 100755 --- a/mcs/class/System/Documentation/en/System.Net/IPAddress.xml +++ b/mcs/class/System/Documentation/en/System.Net/IPAddress.xml @@ -541,6 +541,21 @@ in network-byte-order.</para> <remarks>To be added.</remarks> </Docs> </Member> + <Member MemberName="IsIPv6Teredo"> + <MemberSignature Language="C#" Value="public bool IsIPv6Teredo { get; }" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> <Member MemberName="IsLoopback"> <MemberSignature Language="ILASM" Value=".method public hidebysig static bool IsLoopback(class System.Net.IPAddress address)" /> <MemberSignature Language="C#" Value="public static bool IsLoopback (System.Net.IPAddress addr);" /> diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs index 26039bdd79..62b41de358 100644 --- a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs +++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs @@ -395,6 +395,20 @@ namespace Mono.CSharp args.AppendFormat("\"{0}\" ",source); return args.ToString(); } + + // Keep in sync with mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs + const string ErrorRegexPattern = @" + ^ + (\s*(?<file>[^\(]+) # filename (optional) + (\((?<line>\d*)(,(?<column>\d*[\+]*))?\))? # line+column (optional) + :\s+)? + (?<level>\w+) # error|warning + \s+ + (?<number>[^:]*\d) # CS1234 + : + \s* + (?<message>.*)$"; + private static CompilerError CreateErrorFromString(string error_string) { if (error_string.StartsWith ("BETA")) @@ -404,8 +418,7 @@ namespace Mono.CSharp return null; CompilerError error=new CompilerError(); - Regex reg = new Regex (@"^(\s*(?<file>.*)\((?<line>\d*)(,(?<column>\d*))?\)(:)?\s+)*(?<level>\w+)\s*(?<number>.*):\s(?<message>.*)", - RegexOptions.Compiled | RegexOptions.ExplicitCapture); + Regex reg = new Regex (ErrorRegexPattern, RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace); Match match=reg.Match(error_string); if (!match.Success) { // We had some sort of runtime crash diff --git a/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs b/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs index da056d1533..80c30eece7 100644 --- a/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs +++ b/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs @@ -73,33 +73,36 @@ namespace System.CodeDom.Compiler { // note: this property *cannot* change TempDir property string temp = tempdir; - if (temp.Length == 0) - temp = GetOwnTempDir (); + if (temp.Length == 0) { + if (ownTempDir != null) { + temp = ownTempDir; + Directory.CreateDirectory (temp); + } else { + temp = CreateOwnTempDir (); + } + } // Create a temporary file at the target directory. This ensures // that the generated file name is unique. - FileStream f = null; - do { + int test_counter = 1000; + while (true) { int num = rnd.Next (); num++; basepath = Path.Combine (temp, num.ToString("x")); string path = basepath + ".tmp"; try { - f = new FileStream (path, FileMode.CreateNew); - } - catch (System.IO.IOException) { - f = null; - continue; - } - catch { - // avoid endless loop + using (var f = new FileStream (path, FileMode.CreateNew)) { + break; + } + } catch (IOException) { + if (test_counter-- > 0) + continue; + throw; } - } while (f == null); - - f.Close (); - + } + // and you must have discovery access to the combined path // note: the cache behaviour is tested in the CAS tests if (SecurityManager.SecurityEnabled) { @@ -110,12 +113,9 @@ namespace System.CodeDom.Compiler { return(basepath); } } - - string GetOwnTempDir () - { - if (ownTempDir != null) - return ownTempDir; + string CreateOwnTempDir () + { // this call ensure the Environment permissions check string basedir = Path.GetTempPath (); @@ -245,9 +245,8 @@ namespace System.CodeDom.Compiler { File.Delete (tmpFile); basepath = null; } - if (allDeleted && ownTempDir != null) { + if (allDeleted && ownTempDir != null && filenames.Length > 0) { Directory.Delete (ownTempDir, true); - ownTempDir = null; } } diff --git a/mcs/class/System/System.Collections.Concurrent/BlockingCollection.cs b/mcs/class/System/System.Collections.Concurrent/BlockingCollection.cs index 26dc84a078..cc7e04ecdd 100644 --- a/mcs/class/System/System.Collections.Concurrent/BlockingCollection.cs +++ b/mcs/class/System/System.Collections.Concurrent/BlockingCollection.cs @@ -370,13 +370,19 @@ namespace System.Collections.Concurrent { item = default (T); CheckArray (collections); - int index = 0; - foreach (var coll in collections) { - try { - item = coll.Take (); - return index; - } catch {} - index++; + WaitHandle[] wait_table = null; + while (true) { + int index = 0; + for (int i = 0; i < collections.Length; ++i) { + if (collections [i].TryTake (out item)) + return i; + } + if (wait_table == null) { + wait_table = new WaitHandle [collections.Length]; + for (int i = 0; i < collections.Length; ++i) + wait_table [i] = collections [i].mreRemove.WaitHandle; + } + WaitHandle.WaitAny (wait_table); } return -1; } @@ -385,14 +391,24 @@ namespace System.Collections.Concurrent { item = default (T); CheckArray (collections); - int index = 0; - foreach (var coll in collections) { - try { - item = coll.Take (cancellationToken); - return index; - } catch {} - index++; + WaitHandle[] wait_table = null; + while (true) { + int index = 0; + for (int i = 0; i < collections.Length; ++i) { + if (collections [i].TryTake (out item)) + return i; + } + cancellationToken.ThrowIfCancellationRequested (); + if (wait_table == null) { + wait_table = new WaitHandle [collections.Length + 1]; + for (int i = 0; i < collections.Length; ++i) + wait_table [i] = collections [i].mreRemove.WaitHandle; + wait_table [collections.Length] = cancellationToken.WaitHandle; + } + WaitHandle.WaitAny (wait_table); + cancellationToken.ThrowIfCancellationRequested (); } + return -1; } diff --git a/mcs/class/System/System.Collections.Concurrent/ConcurrentBag.cs b/mcs/class/System/System.Collections.Concurrent/ConcurrentBag.cs index 5b4cbfcf1a..cd063347c6 100644 --- a/mcs/class/System/System.Collections.Concurrent/ConcurrentBag.cs +++ b/mcs/class/System/System.Collections.Concurrent/ConcurrentBag.cs @@ -65,6 +65,7 @@ namespace System.Collections.Concurrent int index; CyclicDeque<T> bag = GetBag (out index); bag.PushBottom (item); + staging.TryAdd (index, bag); AddHint (index); Interlocked.Increment (ref count); } @@ -88,6 +89,7 @@ namespace System.Collections.Concurrent if (bag == null || bag.PopBottom (out result) != PopResult.Succeed) { var self = bag; + ret = false; foreach (var other in staging) { // Try to retrieve something based on a hint ret = TryGetHint (out hintIndex) && (bag = container[hintIndex]).PopTop (out result) == PopResult.Succeed; @@ -129,6 +131,7 @@ namespace System.Collections.Concurrent if (bag == null || !bag.PeekBottom (out result)) { var self = bag; + ret = false; foreach (var other in staging) { // Try to retrieve something based on a hint ret = TryGetHint (out hintIndex) && container[hintIndex].PeekTop (out result); @@ -264,10 +267,7 @@ namespace System.Collections.Concurrent if (container.TryGetValue (index, out value)) return value; - var bag = createBag ? container.GetOrAdd (index, new CyclicDeque<T> ()) : null; - if (bag != null) - staging.TryAdd (index, bag); - return bag; + return createBag ? container.GetOrAdd (index, new CyclicDeque<T> ()) : null; } void TidyBag (int index, CyclicDeque<T> bag) @@ -279,4 +279,4 @@ namespace System.Collections.Concurrent } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/System/System.ComponentModel/BindingList.cs b/mcs/class/System/System.ComponentModel/BindingList.cs index b64d655efe..b4c0ce8b69 100644 --- a/mcs/class/System/System.ComponentModel/BindingList.cs +++ b/mcs/class/System/System.ComponentModel/BindingList.cs @@ -242,7 +242,7 @@ namespace System.ComponentModel { if (raise_list_changed_events) OnListChanged (new ListChangedEventArgs (ListChangedType.ItemAdded, index)); - if (type_raises_item_changed_events) + if (item != null && type_raises_item_changed_events) (item as INotifyPropertyChanged).PropertyChanged += Item_PropertyChanged; } diff --git a/mcs/class/System/System.ComponentModel/Component.cs b/mcs/class/System/System.ComponentModel/Component.cs index 5c61d72eef..1095161648 100644 --- a/mcs/class/System/System.ComponentModel/Component.cs +++ b/mcs/class/System/System.ComponentModel/Component.cs @@ -44,7 +44,7 @@ namespace System.ComponentModel { private EventHandlerList event_handlers; private ISite mySite; - private object disposedEvent = new object (); + static readonly object disposedEvent = new object (); public Component () { diff --git a/mcs/class/System/System.Configuration/SettingValueElement.cs b/mcs/class/System/System.Configuration/SettingValueElement.cs index bf618659ce..4c336dd005 100644 --- a/mcs/class/System/System.Configuration/SettingValueElement.cs +++ b/mcs/class/System/System.Configuration/SettingValueElement.cs @@ -27,6 +27,7 @@ // using System; +using System.Reflection; #if (XML_DEP) using System.Xml; #endif @@ -112,7 +113,79 @@ namespace System.Configuration #if (CONFIGURATION_DEP) protected override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode) { - throw new NotImplementedException (); + if (parentElement != null && sourceElement.GetType() != parentElement.GetType()) + throw new ConfigurationErrorsException ("Can't unmerge two elements of different type"); + + bool isMinimalOrModified = saveMode == ConfigurationSaveMode.Minimal || + saveMode == ConfigurationSaveMode.Modified; + + foreach (PropertyInformation prop in sourceElement.ElementInformation.Properties) + { + if (prop.ValueOrigin == PropertyValueOrigin.Default) + continue; + + PropertyInformation unmergedProp = ElementInformation.Properties [prop.Name]; + + object sourceValue = prop.Value; + if (parentElement == null || !HasValue (parentElement, prop.Name)) { + unmergedProp.Value = sourceValue; + continue; + } + + if (sourceValue == null) + continue; + + object parentValue = GetItem (parentElement, prop.Name); + if (!PropertyIsElement (prop)) { + if (!object.Equals (sourceValue, parentValue) || + (saveMode == ConfigurationSaveMode.Full) || + (saveMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere)) + unmergedProp.Value = sourceValue; + continue; + } + + var sourceElem = (ConfigurationElement) sourceValue; + if (isMinimalOrModified && !ElementIsModified (sourceElem)) + continue; + if (parentValue == null) { + unmergedProp.Value = sourceValue; + continue; + } + + var parentElem = (ConfigurationElement) parentValue; + ConfigurationElement copy = (ConfigurationElement) unmergedProp.Value; + ElementUnmerge (copy, sourceElem, parentElem, saveMode); + } + } + + bool HasValue (ConfigurationElement element, string propName) + { + PropertyInformation info = element.ElementInformation.Properties [propName]; + return info != null && info.ValueOrigin != PropertyValueOrigin.Default; + } + + object GetItem (ConfigurationElement element, string property) + { + PropertyInformation pi = ElementInformation.Properties [property]; + if (pi == null) + throw new InvalidOperationException ("Property '" + property + "' not found in configuration element"); + + return pi.Value; + } + + bool PropertyIsElement (PropertyInformation prop) + { + return (typeof(ConfigurationElement).IsAssignableFrom (prop.Type)); + } + + bool ElementIsModified (ConfigurationElement element) + { + return (bool) element.GetType ().GetMethod ("IsModified", BindingFlags.NonPublic | BindingFlags.Instance).Invoke (element, new object [0]); + } + + void ElementUnmerge (ConfigurationElement target, ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode) + { + target.GetType ().GetMethod ("Unmerge", BindingFlags.NonPublic | BindingFlags.Instance).Invoke (target, new object [] {sourceElement, parentElement, saveMode}); } #endif } diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index e08d79e0f1..7a63ce0377 100644 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -918,8 +918,7 @@ namespace System.Diagnostics { IntPtr stderr, ref ProcInfo proc_info); - private static bool Start_shell (ProcessStartInfo startInfo, - Process process) + private static bool Start_shell (ProcessStartInfo startInfo, Process process) { ProcInfo proc_info=new ProcInfo(); bool ret; @@ -948,9 +947,7 @@ namespace System.Diagnostics { process.process_handle = proc_info.process_handle; process.pid = proc_info.pid; - process.StartExitCallbackIfNeeded (); - return(ret); } @@ -1182,9 +1179,9 @@ namespace System.Diagnostics { if (startInfo == null) throw new ArgumentNullException ("startInfo"); - Process process=new Process(); + Process process = new Process(); process.StartInfo = startInfo; - if (Start_common(startInfo, process)) + if (Start_common(startInfo, process) && process.process_handle != IntPtr.Zero) return process; return null; } @@ -1566,6 +1563,21 @@ namespace System.Diagnostics { async_output.Close (); if (async_error != null) async_error.Close (); + + if (input_stream != null) { + input_stream.Close(); + input_stream = null; + } + + if (output_stream != null) { + output_stream.Close(); + output_stream = null; + } + + if (error_stream != null) { + error_stream.Close(); + error_stream = null; + } } } @@ -1576,21 +1588,6 @@ namespace System.Diagnostics { Process_free_internal(process_handle); process_handle=IntPtr.Zero; } - - if (input_stream != null) { - input_stream.Close(); - input_stream = null; - } - - if (output_stream != null) { - output_stream.Close(); - output_stream = null; - } - - if (error_stream != null) { - error_stream.Close(); - error_stream = null; - } } } base.Dispose (disposing); diff --git a/mcs/class/System/System.IO.Compression/CompressionLevel.cs b/mcs/class/System/System.IO.Compression/CompressionLevel.cs index 7ea3a7a49f..2242c19cf5 100644 --- a/mcs/class/System/System.IO.Compression/CompressionLevel.cs +++ b/mcs/class/System/System.IO.Compression/CompressionLevel.cs @@ -27,7 +27,7 @@ #if NET_4_5 namespace System.IO.Compression { public enum CompressionLevel { - Optional, + Optimal, Fastest, NoCompression } diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkChange.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkChange.cs index c60954c949..de9754e951 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkChange.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkChange.cs @@ -2,8 +2,8 @@ // System.Net.NetworkInformation.NetworkChange // // Authors: -// Gonzalo Paniagua Javier (gonzalo@novell.com) -// Aaron Bockover (abock@xamarin.com) +// Gonzalo Paniagua Javier (LinuxNetworkChange) (gonzalo@novell.com) +// Aaron Bockover (MacNetworkChange) (abock@xamarin.com) // // Copyright (c) 2006,2011 Novell, Inc. (http://www.novell.com) // Copyright (c) 2013 Xamarin, Inc. (http://www.xamarin.com) @@ -15,10 +15,10 @@ // 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 @@ -28,137 +28,298 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading; +#if NETWORK_CHANGE_STANDALONE +namespace NetworkInformation { + + public class NetworkAvailabilityEventArgs : EventArgs + { + public bool IsAvailable { get; set; } + + public NetworkAvailabilityEventArgs (bool available) + { + IsAvailable = available; + } + } + + public delegate void NetworkAddressChangedEventHandler (object sender, EventArgs args); + public delegate void NetworkAvailabilityChangedEventHandler (object sender, NetworkAvailabilityEventArgs args); +#else namespace System.Net.NetworkInformation { - internal interface INetworkChange { +#endif + + internal interface INetworkChange : IDisposable { event NetworkAddressChangedEventHandler NetworkAddressChanged; event NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged; + bool HasRegisteredEvents { get; } } public sealed class NetworkChange { static INetworkChange networkChange; - static NetworkChange () + public static event NetworkAddressChangedEventHandler NetworkAddressChanged { + add { + lock (typeof (INetworkChange)) { + MaybeCreate (); + if (networkChange != null) + networkChange.NetworkAddressChanged += value; + } + } + + remove { + lock (typeof (INetworkChange)) { + if (networkChange != null) { + networkChange.NetworkAddressChanged -= value; + MaybeDispose (); + } + } + } + } + + public static event NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged { + add { + lock (typeof (INetworkChange)) { + MaybeCreate (); + if (networkChange != null) + networkChange.NetworkAvailabilityChanged += value; + } + } + + remove { + lock (typeof (INetworkChange)) { + if (networkChange != null) { + networkChange.NetworkAvailabilityChanged -= value; + MaybeDispose (); + } + } + } + } + + static void MaybeCreate () { - if (MacNetworkChange.IsEnabled) { + if (networkChange != null) + return; + + try { networkChange = new MacNetworkChange (); - } else { + } catch { +#if !NETWORK_CHANGE_STANDALONE networkChange = new LinuxNetworkChange (); +#endif } } - public static event NetworkAddressChangedEventHandler NetworkAddressChanged { - add { networkChange.NetworkAddressChanged += value; } - remove { networkChange.NetworkAddressChanged -= value; } + static void MaybeDispose () + { + if (networkChange != null && networkChange.HasRegisteredEvents) { + networkChange.Dispose (); + networkChange = null; + } } + } - public static event NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged { - add { networkChange.NetworkAvailabilityChanged += value; } - remove { networkChange.NetworkAvailabilityChanged -= value; } + internal sealed class MacNetworkChange : INetworkChange + { + const string DL_LIB = "/usr/lib/libSystem.dylib"; + const string CORE_SERVICES_LIB = "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration"; + const string CORE_FOUNDATION_LIB = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"; + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + delegate void SCNetworkReachabilityCallback (IntPtr target, NetworkReachabilityFlags flags, IntPtr info); + + [DllImport (DL_LIB)] + static extern IntPtr dlopen (string path, int mode); + + [DllImport (DL_LIB)] + static extern IntPtr dlsym (IntPtr handle, string symbol); + + [DllImport (DL_LIB)] + static extern int dlclose (IntPtr handle); + + [DllImport (CORE_FOUNDATION_LIB)] + static extern void CFRelease (IntPtr handle); + + [DllImport (CORE_FOUNDATION_LIB)] + static extern IntPtr CFRunLoopGetMain (); + + [DllImport (CORE_SERVICES_LIB)] + static extern IntPtr SCNetworkReachabilityCreateWithAddress (IntPtr allocator, ref sockaddr_in sockaddr); + + [DllImport (CORE_SERVICES_LIB)] + static extern bool SCNetworkReachabilityGetFlags (IntPtr reachability, out NetworkReachabilityFlags flags); + + [DllImport (CORE_SERVICES_LIB)] + static extern bool SCNetworkReachabilitySetCallback (IntPtr reachability, SCNetworkReachabilityCallback callback, ref SCNetworkReachabilityContext context); + + [DllImport (CORE_SERVICES_LIB)] + static extern bool SCNetworkReachabilityScheduleWithRunLoop (IntPtr reachability, IntPtr runLoop, IntPtr runLoopMode); + + [DllImport (CORE_SERVICES_LIB)] + static extern bool SCNetworkReachabilityUnscheduleFromRunLoop (IntPtr reachability, IntPtr runLoop, IntPtr runLoopMode); + + [StructLayout (LayoutKind.Explicit, Size = 28)] + struct sockaddr_in { + [FieldOffset (0)] public byte sin_len; + [FieldOffset (1)] public byte sin_family; + + public static sockaddr_in Create () + { + return new sockaddr_in { + sin_len = 28, + sin_family = 2 // AF_INET + }; + } } - } - internal sealed class MacNetworkChange : INetworkChange { - public static bool IsEnabled { - get { return mono_sc_reachability_enabled () != 0; } + [StructLayout (LayoutKind.Sequential)] + struct SCNetworkReachabilityContext { + public IntPtr version; + public IntPtr info; + public IntPtr retain; + public IntPtr release; + public IntPtr copyDescription; + } + + [Flags] + enum NetworkReachabilityFlags { + None = 0, + TransientConnection = 1 << 0, + Reachable = 1 << 1, + ConnectionRequired = 1 << 2, + ConnectionOnTraffic = 1 << 3, + InterventionRequired = 1 << 4, + ConnectionOnDemand = 1 << 5, + IsLocalAddress = 1 << 16, + IsDirect = 1 << 17, + IsWWAN = 1 << 18, + ConnectionAutomatic = ConnectionOnTraffic } + IntPtr handle; + IntPtr runLoopMode; + SCNetworkReachabilityCallback callback; + bool scheduledWithRunLoop; + NetworkReachabilityFlags flags; + event NetworkAddressChangedEventHandler networkAddressChanged; event NetworkAvailabilityChangedEventHandler networkAvailabilityChanged; public event NetworkAddressChangedEventHandler NetworkAddressChanged { add { - if (value != null) { - MaybeInitialize (); - networkAddressChanged += value; - value (null, EventArgs.Empty); - } + value (null, EventArgs.Empty); + networkAddressChanged += value; } - remove { - networkAddressChanged -= value; - MaybeDispose (); - } + remove { networkAddressChanged -= value; } } public event NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged { add { - if (value != null) { - MaybeInitialize (); - networkAvailabilityChanged += value; - var available = handle != IntPtr.Zero && mono_sc_reachability_is_available (handle) != 0; - value (null, new NetworkAvailabilityEventArgs (available)); - } + value (null, new NetworkAvailabilityEventArgs (IsAvailable)); + networkAvailabilityChanged += value; } - remove { - networkAvailabilityChanged -= value; - MaybeDispose (); + remove { networkAvailabilityChanged -= value; } + } + + bool IsAvailable { + get { + return (flags & NetworkReachabilityFlags.Reachable) != 0 && + (flags & NetworkReachabilityFlags.ConnectionRequired) == 0; } } - IntPtr handle; - MonoSCReachabilityCallback callback; + public bool HasRegisteredEvents { + get { return networkAddressChanged != null || networkAvailabilityChanged != null; } + } - void Callback (int available) + public MacNetworkChange () { - var addressChanged = networkAddressChanged; - if (addressChanged != null) { - addressChanged (null, EventArgs.Empty); - } + var sockaddr = sockaddr_in.Create (); + handle = SCNetworkReachabilityCreateWithAddress (IntPtr.Zero, ref sockaddr); + if (handle == IntPtr.Zero) + throw new Exception ("SCNetworkReachabilityCreateWithAddress returned NULL"); - var availabilityChanged = networkAvailabilityChanged; - if (availabilityChanged != null) { - availabilityChanged (null, new NetworkAvailabilityEventArgs (available != 0)); - } + callback = new SCNetworkReachabilityCallback (HandleCallback); + var info = new SCNetworkReachabilityContext { + info = GCHandle.ToIntPtr (GCHandle.Alloc (this)) + }; + + SCNetworkReachabilitySetCallback (handle, callback, ref info); + + scheduledWithRunLoop = + LoadRunLoopMode () && + SCNetworkReachabilityScheduleWithRunLoop (handle, CFRunLoopGetMain (), runLoopMode); + + SCNetworkReachabilityGetFlags (handle, out flags); } - void MaybeInitialize () + bool LoadRunLoopMode () { - lock (this) { - if (handle == IntPtr.Zero) { - callback = new MonoSCReachabilityCallback (Callback); - handle = mono_sc_reachability_new (callback); + var cfLibHandle = dlopen (CORE_FOUNDATION_LIB, 0); + if (cfLibHandle == IntPtr.Zero) + return false; + + try { + runLoopMode = dlsym (cfLibHandle, "kCFRunLoopDefaultMode"); + if (runLoopMode != IntPtr.Zero) { + runLoopMode = Marshal.ReadIntPtr (runLoopMode); + return runLoopMode != IntPtr.Zero; } + } finally { + dlclose (cfLibHandle); } + + return false; } - void MaybeDispose () + public void Dispose () { lock (this) { - var addressChanged = networkAddressChanged; - var availabilityChanged = networkAvailabilityChanged; - if (handle != IntPtr.Zero && addressChanged == null && availabilityChanged == null) { - mono_sc_reachability_free (handle); - handle = IntPtr.Zero; - } + if (handle == IntPtr.Zero) + return; + + if (scheduledWithRunLoop) + SCNetworkReachabilityUnscheduleFromRunLoop (handle, CFRunLoopGetMain (), runLoopMode); + + CFRelease (handle); + handle = IntPtr.Zero; + callback = null; + flags = NetworkReachabilityFlags.None; + scheduledWithRunLoop = false; } } -#if MONOTOUCH || MONODROID - const string LIBNAME = "__Internal"; -#else - const string LIBNAME = "MonoPosixHelper"; +#if MONOTOUCH + [MonoTouch.MonoPInvokeCallback (typeof (SCNetworkReachabilityCallback))] #endif + static void HandleCallback (IntPtr reachability, NetworkReachabilityFlags flags, IntPtr info) + { + if (info == IntPtr.Zero) + return; - delegate void MonoSCReachabilityCallback (int available); - - [DllImport (LIBNAME)] - static extern int mono_sc_reachability_enabled (); + var instance = GCHandle.FromIntPtr (info).Target as MacNetworkChange; + if (instance == null || instance.flags == flags) + return; - [DllImport (LIBNAME)] - static extern IntPtr mono_sc_reachability_new (MonoSCReachabilityCallback callback); + instance.flags = flags; - [DllImport (LIBNAME)] - static extern void mono_sc_reachability_free (IntPtr handle); + var addressChanged = instance.networkAddressChanged; + if (addressChanged != null) + addressChanged (null, EventArgs.Empty); - [DllImport (LIBNAME)] - static extern int mono_sc_reachability_is_available (IntPtr handle); + var availabilityChanged = instance.networkAvailabilityChanged; + if (availabilityChanged != null) + availabilityChanged (null, new NetworkAvailabilityEventArgs (instance.IsAvailable)); + } } +#if !NETWORK_CHANGE_STANDALONE + internal sealed class LinuxNetworkChange : INetworkChange { [Flags] enum EventType { @@ -185,6 +346,14 @@ namespace System.Net.NetworkInformation { remove { Unregister (value); } } + public bool HasRegisteredEvents { + get { return AddressChanged != null || AvailabilityChanged != null; } + } + + public void Dispose () + { + } + //internal Socket (AddressFamily family, SocketType type, ProtocolType proto, IntPtr sock) bool EnsureSocket () @@ -321,5 +490,7 @@ namespace System.Net.NetworkInformation { [DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr CloseNLSocket (IntPtr sock); } -} +#endif + +} diff --git a/mcs/class/System/System.Net.Sockets/NetworkStream.cs b/mcs/class/System/System.Net.Sockets/NetworkStream.cs index 65126ca24f..f358c4dbbc 100644 --- a/mcs/class/System/System.Net.Sockets/NetworkStream.cs +++ b/mcs/class/System/System.Net.Sockets/NetworkStream.cs @@ -51,8 +51,8 @@ namespace System.Net.Sockets { } - public NetworkStream (Socket socket, bool owns_socket) - : this (socket, FileAccess.ReadWrite, owns_socket) + public NetworkStream (Socket socket, bool ownsSocket) + : this (socket, FileAccess.ReadWrite, ownsSocket) { } @@ -61,7 +61,7 @@ namespace System.Net.Sockets { } - public NetworkStream (Socket socket, FileAccess access, bool owns_socket) + public NetworkStream (Socket socket, FileAccess access, bool ownsSocket) { if (socket == null) throw new ArgumentNullException ("socket is null"); @@ -73,7 +73,7 @@ namespace System.Net.Sockets throw new IOException ("Operation not allowed on a non-blocking socket."); this.socket = socket; - this.owns_socket = owns_socket; + this.owns_socket = ownsSocket; this.access = access; readable = CanRead; diff --git a/mcs/class/System/System.Net.WebSockets/ClientWebSocket.cs b/mcs/class/System/System.Net.WebSockets/ClientWebSocket.cs index f04cb3c054..3778c74053 100644 --- a/mcs/class/System/System.Net.WebSockets/ClientWebSocket.cs +++ b/mcs/class/System/System.Net.WebSockets/ClientWebSocket.cs @@ -1,10 +1,12 @@ // // ClientWebSocket.cs // -// Author: -// Martin Baulig <martin.baulig@xamarin.com> +// Authors: +// Jérémie Laval <jeremie dot laval at xamarin dot com> // -// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com) +// Copyright 2013 Xamarin Inc (http://www.xamarin.com). +// +// Lightly inspired from WebSocket4Net distributed under the Apache License 2.0 // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -27,71 +29,327 @@ #if NET_4_5 using System; +using System.Net; +using System.Net.Sockets; +using System.Security.Principal; +using System.Security.Cryptography.X509Certificates; +using System.Runtime.CompilerServices; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using System.Globalization; +using System.Text; +using System.Security.Cryptography; namespace System.Net.WebSockets { - [MonoTODO] - public class ClientWebSocket : WebSocket + public class ClientWebSocket : WebSocket, IDisposable { - public ClientWebSocketOptions Options { - get { throw new NotImplementedException (); } + const string Magic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + const string VersionTag = "13"; + + ClientWebSocketOptions options; + WebSocketState state; + string subProtocol; + + HttpWebRequest req; + WebConnection connection; + Socket underlyingSocket; + + Random random = new Random (); + + const int HeaderMaxLength = 14; + byte[] headerBuffer; + byte[] sendBuffer; + + public ClientWebSocket () + { + options = new ClientWebSocketOptions (); + state = WebSocketState.None; + headerBuffer = new byte[HeaderMaxLength]; } - public Task ConnectAsync (Uri uri, CancellationToken cancellationToken) + public override void Dispose () { - throw new NotImplementedException (); + if (connection != null) + connection.Close (false); } - #region implemented abstract members of WebSocket + [MonoTODO] public override void Abort () { throw new NotImplementedException (); } - public override Task CloseAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + + public ClientWebSocketOptions Options { + get { + return options; + } + } + + public override WebSocketState State { + get { + return state; + } + } + + public override WebSocketCloseStatus? CloseStatus { + get { + if (state != WebSocketState.Closed) + return (WebSocketCloseStatus?)null; + return WebSocketCloseStatus.Empty; + } + } + + public override string CloseStatusDescription { + get { + return null; + } + } + + public override string SubProtocol { + get { + return subProtocol; + } + } + + public async Task ConnectAsync (Uri uri, CancellationToken cancellationToken) { - throw new NotImplementedException (); + state = WebSocketState.Connecting; + var httpUri = new UriBuilder (uri); + if (uri.Scheme == "wss") + httpUri.Scheme = "https"; + else + httpUri.Scheme = "http"; + req = (HttpWebRequest)WebRequest.Create (httpUri.Uri); + req.ReuseConnection = true; + if (options.Cookies != null) + req.CookieContainer = options.Cookies; + + if (options.CustomRequestHeaders.Count > 0) { + foreach (var header in options.CustomRequestHeaders) + req.Headers[header.Key] = header.Value; + } + + var secKey = Convert.ToBase64String (Encoding.ASCII.GetBytes (Guid.NewGuid ().ToString ().Substring (0, 16))); + string expectedAccept = Convert.ToBase64String (SHA1.Create ().ComputeHash (Encoding.ASCII.GetBytes (secKey + Magic))); + + req.Headers["Upgrade"] = "WebSocket"; + req.Headers["Sec-WebSocket-Version"] = VersionTag; + req.Headers["Sec-WebSocket-Key"] = secKey; + req.Headers["Sec-WebSocket-Origin"] = uri.Host; + if (options.SubProtocols.Count > 0) + req.Headers["Sec-WebSocket-Protocol"] = string.Join (",", options.SubProtocols); + + if (options.Credentials != null) + req.Credentials = options.Credentials; + if (options.ClientCertificates != null) + req.ClientCertificates = options.ClientCertificates; + if (options.Proxy != null) + req.Proxy = options.Proxy; + req.UseDefaultCredentials = options.UseDefaultCredentials; + req.Connection = "Upgrade"; + + HttpWebResponse resp = null; + try { + resp = (HttpWebResponse)(await req.GetResponseAsync ().ConfigureAwait (false)); + } catch (Exception e) { + throw new WebSocketException (WebSocketError.Success, e); + } + + connection = req.StoredConnection; + underlyingSocket = connection.socket; + + if (resp.StatusCode != HttpStatusCode.SwitchingProtocols) + throw new WebSocketException ("The server returned status code '" + (int)resp.StatusCode + "' when status code '101' was expected"); + if (!string.Equals (resp.Headers["Upgrade"], "WebSocket", StringComparison.OrdinalIgnoreCase) + || !string.Equals (resp.Headers["Connection"], "Upgrade", StringComparison.OrdinalIgnoreCase) + || !string.Equals (resp.Headers["Sec-WebSocket-Accept"], expectedAccept)) + throw new WebSocketException ("HTTP header error during handshake"); + if (resp.Headers["Sec-WebSocket-Protocol"] != null) { + if (!options.SubProtocols.Contains (resp.Headers["Sec-WebSocket-Protocol"])) + throw new WebSocketException (WebSocketError.UnsupportedProtocol); + subProtocol = resp.Headers["Sec-WebSocket-Protocol"]; + } + + state = WebSocketState.Open; } - public override Task CloseOutputAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + + public override Task SendAsync (ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) { - throw new NotImplementedException (); + EnsureWebSocketConnected (); + ValidateArraySegment (buffer); + if (connection == null) + throw new WebSocketException (WebSocketError.Faulted); + var count = Math.Max (options.SendBufferSize, buffer.Count) + HeaderMaxLength; + if (sendBuffer == null || sendBuffer.Length != count) + sendBuffer = new byte[count]; + return Task.Run (() => { + EnsureWebSocketState (WebSocketState.Open, WebSocketState.CloseReceived); + var maskOffset = WriteHeader (messageType, buffer, endOfMessage); + + if (buffer.Count > 0) + MaskData (buffer, maskOffset); + //underlyingSocket.Send (headerBuffer, 0, maskOffset + 4, SocketFlags.None); + var headerLength = maskOffset + 4; + Array.Copy (headerBuffer, sendBuffer, headerLength); + underlyingSocket.Send (sendBuffer, 0, buffer.Count + headerLength, SocketFlags.None); + }); } + public override Task<WebSocketReceiveResult> ReceiveAsync (ArraySegment<byte> buffer, CancellationToken cancellationToken) { - throw new NotImplementedException (); + EnsureWebSocketConnected (); + ValidateArraySegment (buffer); + return Task.Run (() => { + EnsureWebSocketState (WebSocketState.Open, WebSocketState.CloseSent); + // First read the two first bytes to know what we are doing next + connection.Read (req, headerBuffer, 0, 2); + var isLast = (headerBuffer[0] >> 7) > 0; + var isMasked = (headerBuffer[1] >> 7) > 0; + int mask = 0; + var type = (WebSocketMessageType)(headerBuffer[0] & 0xF); + long length = headerBuffer[1] & 0x7F; + int offset = 0; + if (length == 126) { + offset = 2; + connection.Read (req, headerBuffer, 2, offset); + length = (headerBuffer[2] << 8) | headerBuffer[3]; + } else if (length == 127) { + offset = 8; + connection.Read (req, headerBuffer, 2, offset); + length = 0; + for (int i = 2; i <= 9; i++) + length = (length << 8) | headerBuffer[i]; + } + + if (isMasked) { + connection.Read (req, headerBuffer, 2 + offset, 4); + for (int i = 0; i < 4; i++) { + var pos = i + offset + 2; + mask = (mask << 8) | headerBuffer[pos]; + } + } + + if (type == WebSocketMessageType.Close) { + state = WebSocketState.Closed; + var tmpBuffer = new byte[length]; + connection.Read (req, tmpBuffer, 0, tmpBuffer.Length); + var closeStatus = (WebSocketCloseStatus)(tmpBuffer[0] << 8 | tmpBuffer[1]); + var closeDesc = tmpBuffer.Length > 2 ? Encoding.UTF8.GetString (tmpBuffer, 2, tmpBuffer.Length - 2) : string.Empty; + return new WebSocketReceiveResult ((int)length, type, isLast, closeStatus, closeDesc); + } else { + var readLength = (int)(buffer.Count < length ? buffer.Count : length); + connection.Read (req, buffer.Array, buffer.Offset, readLength); + + return new WebSocketReceiveResult ((int)length, type, isLast); + } + }); } - public override Task SendAsync (ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) + + // The damn difference between those two methods is that CloseAsync will wait for server acknowledgement before completing + // while CloseOutputAsync will send the close packet and simply complete. + + public async override Task CloseAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) { - throw new NotImplementedException (); + EnsureWebSocketConnected (); + await SendCloseFrame (closeStatus, statusDescription, cancellationToken).ConfigureAwait (false); + state = WebSocketState.CloseSent; + // TODO: figure what's exceptions are thrown if the server returns something faulty here + await ReceiveAsync (new ArraySegment<byte> (new byte[0]), cancellationToken).ConfigureAwait (false); + state = WebSocketState.Closed; } - public override void Dispose () + + public async override Task CloseOutputAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) { - throw new NotImplementedException (); + EnsureWebSocketConnected (); + await SendCloseFrame (closeStatus, statusDescription, cancellationToken).ConfigureAwait (false); + state = WebSocketState.CloseSent; } - public override WebSocketCloseStatus? CloseStatus { - get { - throw new NotImplementedException (); - } + + async Task SendCloseFrame (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + { + var statusDescBuffer = string.IsNullOrEmpty (statusDescription) ? new byte[2] : new byte[2 + Encoding.UTF8.GetByteCount (statusDescription)]; + statusDescBuffer[0] = (byte)(((ushort)closeStatus) >> 8); + statusDescBuffer[1] = (byte)(((ushort)closeStatus) & 0xFF); + if (!string.IsNullOrEmpty (statusDescription)) + Encoding.UTF8.GetBytes (statusDescription, 0, statusDescription.Length, statusDescBuffer, 2); + await SendAsync (new ArraySegment<byte> (statusDescBuffer), WebSocketMessageType.Close, true, cancellationToken).ConfigureAwait (false); } - public override string CloseStatusDescription { - get { - throw new NotImplementedException (); + + int WriteHeader (WebSocketMessageType type, ArraySegment<byte> buffer, bool endOfMessage) + { + var opCode = (byte)type; + var length = buffer.Count; + + headerBuffer[0] = (byte)(opCode | (endOfMessage ? 0 : 0x80)); + if (length < 126) { + headerBuffer[1] = (byte)length; + } else if (length <= ushort.MaxValue) { + headerBuffer[1] = (byte)126; + headerBuffer[2] = (byte)(length / 256); + headerBuffer[3] = (byte)(length % 256); + } else { + headerBuffer[1] = (byte)127; + + int left = length; + int unit = 256; + + for (int i = 9; i > 1; i--) { + headerBuffer[i] = (byte)(left % unit); + left = left / unit; + } } + + var l = Math.Max (0, headerBuffer[1] - 125); + var maskOffset = 2 + l * l * 2; + GenerateMask (headerBuffer, maskOffset); + + // Since we are client only, we always mask the payload + headerBuffer[1] |= 0x80; + + return maskOffset; } - public override WebSocketState State { - get { - throw new NotImplementedException (); - } + + void GenerateMask (byte[] mask, int offset) + { + mask[offset + 0] = (byte)random.Next (0, 255); + mask[offset + 1] = (byte)random.Next (0, 255); + mask[offset + 2] = (byte)random.Next (0, 255); + mask[offset + 3] = (byte)random.Next (0, 255); } - public override string SubProtocol { - get { - throw new NotImplementedException (); - } + + void MaskData (ArraySegment<byte> buffer, int maskOffset) + { + var sendBufferOffset = maskOffset + 4; + for (var i = 0; i < buffer.Count; i++) + sendBuffer[i + sendBufferOffset] = (byte)(buffer.Array[buffer.Offset + i] ^ headerBuffer[maskOffset + (i % 4)]); + } + + void EnsureWebSocketConnected () + { + if (state < WebSocketState.Open) + throw new InvalidOperationException ("The WebSocket is not connected"); + } + + void EnsureWebSocketState (params WebSocketState[] validStates) + { + foreach (var validState in validStates) + if (state == validState) + return; + throw new WebSocketException ("The WebSocket is in an invalid state ('" + state + "') for this operation. Valid states are: " + string.Join (", ", validStates)); + } + + void ValidateArraySegment (ArraySegment<byte> segment) + { + if (segment.Array == null) + throw new ArgumentNullException ("buffer.Array"); + if (segment.Offset < 0) + throw new ArgumentOutOfRangeException ("buffer.Offset"); + if (segment.Offset + segment.Count > segment.Array.Length) + throw new ArgumentOutOfRangeException ("buffer.Count"); } - #endregion } } #endif - diff --git a/mcs/class/System/System.Net.WebSockets/ClientWebSocketOptions.cs b/mcs/class/System/System.Net.WebSockets/ClientWebSocketOptions.cs index a1d617cbad..586752d7f6 100644 --- a/mcs/class/System/System.Net.WebSockets/ClientWebSocketOptions.cs +++ b/mcs/class/System/System.Net.WebSockets/ClientWebSocketOptions.cs @@ -33,11 +33,15 @@ using System.Net; using System.Security.Principal; using System.Security.Cryptography.X509Certificates; using System.Runtime.CompilerServices; +using System.Collections.Generic; namespace System.Net.WebSockets { public sealed class ClientWebSocketOptions { + List<string> subprotocols = new List<string> (); + Dictionary<string, string> customRequestHeaders = new Dictionary<string, string> (); + public X509CertificateCollection ClientCertificates { get; set; } public CookieContainer Cookies { get; set; } @@ -50,28 +54,53 @@ namespace System.Net.WebSockets public bool UseDefaultCredentials { get; set; } - [MonoTODO] + internal IList<string> SubProtocols { + get { + return subprotocols.AsReadOnly (); + } + } + + internal Dictionary<string, string> CustomRequestHeaders { + get { + return customRequestHeaders; + } + } + + internal int ReceiveBufferSize { + get; + private set; + } + + internal ArraySegment<byte> CustomReceiveBuffer { + get; + private set; + } + + internal int SendBufferSize { + get; + private set; + } + public void AddSubProtocol (string subProtocol) { - throw new NotImplementedException (); + subprotocols.Add (subProtocol); } - [MonoTODO] public void SetBuffer (int receiveBufferSize, int sendBufferSize) { - throw new NotImplementedException (); + SetBuffer (receiveBufferSize, sendBufferSize, new ArraySegment<byte> ()); } - [MonoTODO] public void SetBuffer (int receiveBufferSize, int sendBufferSize, ArraySegment<byte> buffer) { - throw new NotImplementedException (); + ReceiveBufferSize = receiveBufferSize; + SendBufferSize = sendBufferSize; + CustomReceiveBuffer = buffer; } - [MonoTODO] public void SetRequestHeader (string headerName, string headerValue) { - throw new NotImplementedException (); + customRequestHeaders[headerName] = headerValue; } } } diff --git a/mcs/class/System/System.Net.WebSockets/WebSocketException.cs b/mcs/class/System/System.Net.WebSockets/WebSocketException.cs index b4980174f6..e617ab38b0 100644 --- a/mcs/class/System/System.Net.WebSockets/WebSocketException.cs +++ b/mcs/class/System/System.Net.WebSockets/WebSocketException.cs @@ -36,72 +36,68 @@ namespace System.Net.WebSockets { public sealed class WebSocketException : Win32Exception { - public WebSocketException () + const string DefaultMessage = "Generic WebSocket exception"; + + public WebSocketException () : this (WebSocketError.Success, -1, DefaultMessage, null) { } - public WebSocketException (int nativeError) : base (nativeError) + public WebSocketException (int nativeError) : this (WebSocketError.Success, nativeError, DefaultMessage, null) { } - public WebSocketException (string message) : base (message) + public WebSocketException (string message) : this (WebSocketError.Success, -1, message, null) { } - public WebSocketException (WebSocketError error) + public WebSocketException (WebSocketError error) : this (error, -1, DefaultMessage, null) { - WebSocketErrorCode = error; } - public WebSocketException (int nativeError, Exception innerException) + public WebSocketException (int nativeError, Exception innerException) : this (WebSocketError.Success, nativeError, DefaultMessage, innerException) { } - public WebSocketException (int nativeError, string message) : base (nativeError, message) + public WebSocketException (int nativeError, string message) : this (WebSocketError.Success, nativeError, message, null) { } - public WebSocketException (string message, Exception innerException) : base (message, innerException) + public WebSocketException (string message, Exception innerException) : this (WebSocketError.Success, -1, message, innerException) { } - public WebSocketException (WebSocketError error, Exception innerException) + public WebSocketException (WebSocketError error, Exception innerException) : this (error, -1, DefaultMessage, innerException) { - WebSocketErrorCode = error; + } - public WebSocketException (WebSocketError error, int nativeError) : base (nativeError) + public WebSocketException (WebSocketError error, int nativeError) : this (error, nativeError, DefaultMessage, null) { - WebSocketErrorCode = error; } - public WebSocketException (WebSocketError error, string message) : base (message) + public WebSocketException (WebSocketError error, string message) : this (error, -1, message, null) { - WebSocketErrorCode = error; } - public WebSocketException (WebSocketError error, int nativeError, Exception innerException) : base (nativeError) + public WebSocketException (WebSocketError error, int nativeError, Exception innerException) : this (error, nativeError, DefaultMessage, innerException) { - WebSocketErrorCode = error; } - public WebSocketException (WebSocketError error, int nativeError, string message) : base (nativeError, message) + public WebSocketException (WebSocketError error, int nativeError, string message) : this (error, nativeError, message, null) { - WebSocketErrorCode = error; } - public WebSocketException (WebSocketError error, string message, Exception innerException) + public WebSocketException (WebSocketError error, string message, Exception innerException) : this (error, -1, message, innerException) { - WebSocketErrorCode = error; } - public WebSocketException (WebSocketError error, int nativeError, string message, Exception innerException) : base (nativeError, message) + public WebSocketException (WebSocketError error, int nativeError, string message, Exception innerException) : base (message, innerException) { WebSocketErrorCode = error; } diff --git a/mcs/class/System/System.Net.WebSockets/WebSocketMessageType.cs b/mcs/class/System/System.Net.WebSockets/WebSocketMessageType.cs index 18e2d9ecbe..50cbc003c0 100644 --- a/mcs/class/System/System.Net.WebSockets/WebSocketMessageType.cs +++ b/mcs/class/System/System.Net.WebSockets/WebSocketMessageType.cs @@ -35,9 +35,9 @@ namespace System.Net.WebSockets { public enum WebSocketMessageType { - Text, - Binary, - Close + Text = 1, + Binary = 2, + Close = 8 } } diff --git a/mcs/class/System/System.Net.WebSockets/WebSocketReceiveResult.cs b/mcs/class/System/System.Net.WebSockets/WebSocketReceiveResult.cs index e237344e46..af97ebcdca 100644 --- a/mcs/class/System/System.Net.WebSockets/WebSocketReceiveResult.cs +++ b/mcs/class/System/System.Net.WebSockets/WebSocketReceiveResult.cs @@ -36,20 +36,22 @@ namespace System.Net.WebSockets { public class WebSocketReceiveResult { - [MonoTODO] public WebSocketReceiveResult (int count, WebSocketMessageType messageType, bool endOfMessage) + : this (count, messageType, endOfMessage, null, null) { - throw new NotImplementedException (); } - [MonoTODO] public WebSocketReceiveResult (int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string closeStatusDescription) { - throw new NotImplementedException (); + MessageType = messageType; + CloseStatus = closeStatus; + CloseStatusDescription = closeStatusDescription; + Count = count; + EndOfMessage = endOfMessage; } public WebSocketCloseStatus? CloseStatus { diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 84d59f6802..1cdffff533 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -36,6 +36,7 @@ using System.Collections; using System.Configuration; using System.Globalization; using System.IO; +using System.Net; using System.Net.Cache; using System.Net.Sockets; using System.Runtime.Remoting.Messaging; @@ -950,6 +951,14 @@ namespace System.Net return result.Response; } + +#if NET_3_5 + public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext) + { + transportContext = null; + return EndGetRequestStream (asyncResult); + } +#endif public override WebResponse GetResponse() { @@ -1071,29 +1080,19 @@ namespace System.Net redirects++; Exception e = null; string uriString = null; - switch (code) { case HttpStatusCode.Ambiguous: // 300 e = new WebException ("Ambiguous redirect."); break; case HttpStatusCode.MovedPermanently: // 301 case HttpStatusCode.Redirect: // 302 - case HttpStatusCode.TemporaryRedirect: // 307 - /* MS follows the redirect for POST too - if (method != "GET" && method != "HEAD") // 10.3 - return false; - */ - - contentLength = -1; - bodyBufferLength = 0; - bodyBuffer = null; - if (code != HttpStatusCode.TemporaryRedirect) + if (method == "POST") method = "GET"; - uriString = webResponse.Headers ["Location"]; + break; + case HttpStatusCode.TemporaryRedirect: // 307 break; case HttpStatusCode.SeeOther: //303 method = "GET"; - uriString = webResponse.Headers ["Location"]; break; case HttpStatusCode.NotModified: // 304 return false; @@ -1109,6 +1108,11 @@ namespace System.Net if (e != null) throw e; + //contentLength = -1; + //bodyBufferLength = 0; + //bodyBuffer = null; + uriString = webResponse.Headers ["Location"]; + if (uriString == null) throw new WebException ("No Location header found for " + (int) code, WebExceptionStatus.ProtocolError); @@ -1163,7 +1167,9 @@ namespace System.Net bool spoint10 = (proto_version == null || proto_version == HttpVersion.Version10); if (keepAlive && (version == HttpVersion.Version10 || spoint10)) { - webHeaders.RemoveAndAdd (connectionHeader, "keep-alive"); + if (webHeaders[connectionHeader] == null + || webHeaders[connectionHeader].IndexOf ("keep-alive", StringComparison.OrdinalIgnoreCase) == -1) + webHeaders.RemoveAndAdd (connectionHeader, "keep-alive"); } else if (!keepAlive && version == HttpVersion.Version11) { webHeaders.RemoveAndAdd (connectionHeader, "close"); } @@ -1605,6 +1611,13 @@ namespace System.Net throw throwMe; } + + internal bool ReuseConnection { + get; + set; + } + + internal WebConnection StoredConnection; } } diff --git a/mcs/class/System/System.Net/HttpWebResponse.cs b/mcs/class/System/System.Net/HttpWebResponse.cs index 0cb3cd8c85..2b756a97bd 100644 --- a/mcs/class/System/System.Net/HttpWebResponse.cs +++ b/mcs/class/System/System.Net/HttpWebResponse.cs @@ -277,7 +277,7 @@ namespace System.Net CheckDisposed (); if (stream == null) return Stream.Null; - if (0 == String.Compare (method, "HEAD", true)) // see par 4.3 & 9.4 + if (string.Equals (method, "HEAD", StringComparison.OrdinalIgnoreCase)) // see par 4.3 & 9.4 return Stream.Null; return stream; @@ -319,7 +319,6 @@ namespace System.Net void IDisposable.Dispose () { Dispose (true); - GC.SuppressFinalize (this); } #if NET_4_0 diff --git a/mcs/class/System/System.Net/IPAddress.cs b/mcs/class/System/System.Net/IPAddress.cs index 2dd7d1ab31..92c0f8e6e0 100644 --- a/mcs/class/System/System.Net/IPAddress.cs +++ b/mcs/class/System/System.Net/IPAddress.cs @@ -333,6 +333,16 @@ namespace System.Net { } } +#if NET_4_0 + public bool IsIPv6Teredo { + get { + return m_Family != AddressFamily.InterNetwork && + NetworkToHostOrder ((short) m_Numbers [0]) == 0x2001 && + m_Numbers[1] == 0; + } + } +#endif + public long ScopeId { get { if (m_Family != AddressFamily.InterNetworkV6) diff --git a/mcs/class/System/System.Net/MacProxy.cs b/mcs/class/System/System.Net/MacProxy.cs index a21cf97c65..1a5e89ec0a 100644 --- a/mcs/class/System/System.Net/MacProxy.cs +++ b/mcs/class/System/System.Net/MacProxy.cs @@ -25,7 +25,9 @@ // using System; +using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; namespace System.Net { @@ -606,13 +608,87 @@ namespace System.Net public const string CFNetworkLibrary = "/System/Library/Frameworks/CFNetwork.framework/CFNetwork"; #endif - [DllImport (CFNetworkLibrary)] - // CFArrayRef CFNetworkCopyProxiesForAutoConfigurationScript (CFStringRef proxyAutoConfigurationScript, CFURLRef targetURL); - extern static IntPtr CFNetworkCopyProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, IntPtr targetURL); - + [DllImport (CFNetworkLibrary, EntryPoint = "CFNetworkCopyProxiesForAutoConfigurationScript")] + // CFArrayRef CFNetworkCopyProxiesForAutoConfigurationScript (CFStringRef proxyAutoConfigurationScript, CFURLRef targetURL, CFErrorRef* error); + extern static IntPtr CFNetworkCopyProxiesForAutoConfigurationScriptSequential (IntPtr proxyAutoConfigurationScript, IntPtr targetURL, out IntPtr error); + + class GetProxyData : IDisposable { + public IntPtr script; + public IntPtr targetUri; + public IntPtr error; + public IntPtr result; + public ManualResetEvent evt = new ManualResetEvent (false); + + public void Dispose () + { + evt.Close (); + } + } + + static object lock_obj = new object (); + static Queue<GetProxyData> get_proxy_queue; + static AutoResetEvent proxy_event; + + static void CFNetworkCopyProxiesForAutoConfigurationScriptThread () + { + GetProxyData data; + var data_left = true; + + while (true) { + proxy_event.WaitOne (); + + do { + lock (lock_obj) { + if (get_proxy_queue.Count == 0) + break; + data = get_proxy_queue.Dequeue (); + data_left = get_proxy_queue.Count > 0; + } + + data.result = CFNetworkCopyProxiesForAutoConfigurationScriptSequential (data.script, data.targetUri, out data.error); + data.evt.Set (); + } while (data_left); + } + } + + static IntPtr CFNetworkCopyProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, IntPtr targetURL, out IntPtr error) + { + // This method must only be called on only one thread during an application's life time. + // Note that it's not enough to use a lock to make calls sequential across different threads, + // it has to be one thread. Also note that that thread can't be the main thread, because the + // main thread might be blocking waiting for this network request to finish. + // Another possibility would be to use JavaScriptCore to execute this piece of + // javascript ourselves, but unfortunately it's not available before iOS7. + // See bug #7923 comment #21+. + + using (var data = new GetProxyData ()) { + data.script = proxyAutoConfigurationScript; + data.targetUri = targetURL; + + lock (lock_obj) { + if (get_proxy_queue == null) { + get_proxy_queue = new Queue<GetProxyData> (); + proxy_event = new AutoResetEvent (false); + new Thread (CFNetworkCopyProxiesForAutoConfigurationScriptThread) { + IsBackground = true, + }.Start (); + } + get_proxy_queue.Enqueue (data); + proxy_event.Set (); + } + + data.evt.WaitOne (); + + error = data.error; + + return data.result; + } + } + static CFArray CopyProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, CFUrl targetURL) { - IntPtr native = CFNetworkCopyProxiesForAutoConfigurationScript (proxyAutoConfigurationScript, targetURL.Handle); + IntPtr err = IntPtr.Zero; + IntPtr native = CFNetworkCopyProxiesForAutoConfigurationScript (proxyAutoConfigurationScript, targetURL.Handle, out err); if (native == IntPtr.Zero) return null; diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs index a6d456293e..27e9893a80 100644 --- a/mcs/class/System/System.Net/ServicePointManager.cs +++ b/mcs/class/System/System.Net/ServicePointManager.cs @@ -326,7 +326,8 @@ namespace System.Net if (address == null) throw new ArgumentNullException ("address"); - RecycleServicePoints (); + if ((servicePoints.Count % 4) == 0) + RecycleServicePoints (); var origAddress = new Uri (address.Scheme + "://" + address.Authority); @@ -346,8 +347,8 @@ namespace System.Net address = new Uri (address.Scheme + "://" + address.Authority); ServicePoint sp = null; + SPKey key = new SPKey (origAddress, usesProxy ? address : null, useConnect); lock (servicePoints) { - SPKey key = new SPKey (origAddress, usesProxy ? address : null, useConnect); sp = servicePoints [key] as ServicePoint; if (sp != null) return sp; diff --git a/mcs/class/System/System.Net/TransportContext.cs b/mcs/class/System/System.Net/TransportContext.cs index 04d534fa13..e0366bb0db 100644 --- a/mcs/class/System/System.Net/TransportContext.cs +++ b/mcs/class/System/System.Net/TransportContext.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 +#if NET_3_5 using System.Security.Authentication.ExtendedProtection; diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs index 7f09859cb5..7f65751c67 100644 --- a/mcs/class/System/System.Net/WebConnection.cs +++ b/mcs/class/System/System.Net/WebConnection.cs @@ -62,7 +62,7 @@ namespace System.Net { ServicePoint sPoint; Stream nstream; - Socket socket; + internal Socket socket; object socketLock = new object (); WebExceptionStatus status; WaitCallback initConn; @@ -613,16 +613,16 @@ namespace System.Net return (statusCode >= 200 && statusCode != 204 && statusCode != 304); } - internal void GetCertificates () + internal void GetCertificates (Stream stream) { // here the SSL negotiation have been done #if SECURITY_DEP && MONOTOUCH - HttpsClientStream s = (nstream as HttpsClientStream); + HttpsClientStream s = (stream as HttpsClientStream); X509Certificate client = s.SelectedClientCertificate; X509Certificate server = s.ServerCertificate; #else - X509Certificate client = (X509Certificate) piClient.GetValue (nstream, null); - X509Certificate server = (X509Certificate) piServer.GetValue (nstream, null); + X509Certificate client = (X509Certificate) piClient.GetValue (stream, null); + X509Certificate server = (X509Certificate) piServer.GetValue (stream, null); #endif sPoint.SetCertificates (client, server); certsAvailable = (server != null); @@ -750,6 +750,8 @@ namespace System.Net { HttpWebRequest request = (HttpWebRequest) state; request.WebConnection = this; + if (request.ReuseConnection) + request.StoredConnection = this; if (request.Aborted) return; @@ -1142,16 +1144,16 @@ namespace System.Net lock (this) { if (Data.request != request) throw new ObjectDisposedException (typeof (NetworkStream).FullName); - if (nstream == null) - return false; s = nstream; + if (s == null) + return false; } try { s.Write (buffer, offset, size); // here SSL handshake should have been done if (ssl && !certsAvailable) - GetCertificates (); + GetCertificates (s); } catch (Exception e) { err_msg = e.Message; WebExceptionStatus wes = WebExceptionStatus.SendFailure; @@ -1164,10 +1166,10 @@ namespace System.Net // if SSL is in use then check for TrustFailure if (ssl) { #if SECURITY_DEP && MONOTOUCH - HttpsClientStream https = (nstream as HttpsClientStream); + HttpsClientStream https = (s as HttpsClientStream); if (https.TrustFailure) { #else - if ((bool) piTrustFailure.GetValue (nstream, null)) { + if ((bool) piTrustFailure.GetValue (s , null)) { #endif wes = WebExceptionStatus.TrustFailure; msg = "Trust failure"; @@ -1183,6 +1185,11 @@ namespace System.Net internal void Close (bool sendNext) { lock (this) { + if (Data != null && Data.request != null && Data.request.ReuseConnection) { + Data.request.ReuseConnection = false; + return; + } + if (nstream != null) { try { nstream.Close (); diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs index 300e1140e1..4559687a7f 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs @@ -426,17 +426,34 @@ namespace System.Security.Cryptography.X509Certificates { } } - private void ImportPkcs12 (byte[] rawData, string password) + private MX.X509Certificate ImportPkcs12 (byte[] rawData, string password) { MX.PKCS12 pfx = (password == null) ? new MX.PKCS12 (rawData) : new MX.PKCS12 (rawData, password); - if (pfx.Certificates.Count > 0) { - _cert = pfx.Certificates [0]; + if (pfx.Certificates.Count == 0) { + // no certificate was found + return null; + } else if (pfx.Keys.Count == 0) { + // no key were found - pick the first certificate + return pfx.Certificates [0]; } else { - _cert = null; - } - if (pfx.Keys.Count > 0) { - _cert.RSA = (pfx.Keys [0] as RSA); - _cert.DSA = (pfx.Keys [0] as DSA); + // find the certificate that match the first key + MX.X509Certificate cert = null; + var keypair = (pfx.Keys [0] as AsymmetricAlgorithm); + string pubkey = keypair.ToXmlString (false); + foreach (var c in pfx.Certificates) { + if (((c.RSA != null) && (pubkey == c.RSA.ToXmlString (false))) || + ((c.DSA != null) && (pubkey == c.DSA.ToXmlString (false)))) { + cert = c; + break; + } + } + if (cert == null) { + cert = pfx.Certificates [0]; // no match, pick first certificate without keys + } else { + cert.RSA = (keypair as RSA); + cert.DSA = (keypair as DSA); + } + return cert; } } @@ -448,14 +465,14 @@ namespace System.Security.Cryptography.X509Certificates { [MonoTODO ("missing KeyStorageFlags support")] public override void Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags) { - base.Import (rawData, password, keyStorageFlags); + MX.X509Certificate cert = null; if (password == null) { try { - _cert = new MX.X509Certificate (rawData); + cert = new MX.X509Certificate (rawData); } catch (Exception e) { try { - ImportPkcs12 (rawData, null); + cert = ImportPkcs12 (rawData, null); } catch { string msg = Locale.GetText ("Unable to decode certificate."); @@ -466,14 +483,19 @@ namespace System.Security.Cryptography.X509Certificates { } else { // try PKCS#12 try { - ImportPkcs12 (rawData, password); + cert = ImportPkcs12 (rawData, password); } catch { // it's possible to supply a (unrequired/unusued) password // fix bug #79028 - _cert = new MX.X509Certificate (rawData); + cert = new MX.X509Certificate (rawData); } } + // we do not have to fully re-decode the certificate since X509Certificate does not deal with keys + if (cert != null) { + base.Import (cert.RawData, (string) null, keyStorageFlags); + _cert = cert; // becuase base call will call Reset! + } } [MonoTODO ("SecureString is incomplete")] @@ -484,35 +506,24 @@ namespace System.Security.Cryptography.X509Certificates { public override void Import (string fileName) { - byte[] rawData = Load (fileName); + byte[] rawData = File.ReadAllBytes (fileName); Import (rawData, (string)null, X509KeyStorageFlags.DefaultKeySet); } [MonoTODO ("missing KeyStorageFlags support")] public override void Import (string fileName, string password, X509KeyStorageFlags keyStorageFlags) { - byte[] rawData = Load (fileName); + byte[] rawData = File.ReadAllBytes (fileName); Import (rawData, password, keyStorageFlags); } [MonoTODO ("SecureString is incomplete")] public override void Import (string fileName, SecureString password, X509KeyStorageFlags keyStorageFlags) { - byte[] rawData = Load (fileName); + byte[] rawData = File.ReadAllBytes (fileName); Import (rawData, (string)null, keyStorageFlags); } - private static byte[] Load (string fileName) - { - byte[] data = null; - using (FileStream fs = File.OpenRead (fileName)) { - data = new byte [fs.Length]; - fs.Read (data, 0, data.Length); - fs.Close (); - } - return data; - } - public override void Reset () { _cert = null; @@ -654,7 +665,7 @@ namespace System.Security.Cryptography.X509Certificates { if (fileName.Length == 0) throw new ArgumentException ("fileName"); - byte[] data = Load (fileName); + byte[] data = File.ReadAllBytes (fileName); return GetCertContentType (data); } diff --git a/mcs/class/System/System.Timers/Timer.cs b/mcs/class/System/System.Timers/Timer.cs index d35ee4e0eb..28a7011bb5 100644 --- a/mcs/class/System/System.Timers/Timer.cs +++ b/mcs/class/System/System.Timers/Timer.cs @@ -159,7 +159,13 @@ namespace System.Timers protected override void Dispose (bool disposing) { - Close (); + // If we're disposing explicitly, clear all + // fields. If not, all fields will have been + // nulled by the GC during finalization, so + // trying to lock on _lock will blow up. + if (disposing) + Close (); + base.Dispose (disposing); } diff --git a/mcs/class/System/System.Windows.Input/ICommand.cs b/mcs/class/System/System.Windows.Input/ICommand.cs index c15af7e2d9..7cb430fef6 100644 --- a/mcs/class/System/System.Windows.Input/ICommand.cs +++ b/mcs/class/System/System.Windows.Input/ICommand.cs @@ -27,11 +27,15 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 +#if NET_4_5 + +using System.Runtime.CompilerServices; namespace System.Windows.Input { - public interface ICommand { + [TypeForwardedFrom (Consts.AssemblyPresentationCore_4_0)] + public interface ICommand + { bool CanExecute (object parameter); void Execute (object parameter); event EventHandler CanExecuteChanged; diff --git a/mcs/class/System/System_test.dll.sources b/mcs/class/System/System_test.dll.sources index a306d52be4..33f8326b2d 100644 --- a/mcs/class/System/System_test.dll.sources +++ b/mcs/class/System/System_test.dll.sources @@ -499,3 +499,4 @@ System.Collections.Concurrent/BlockingCollectionTests.cs System.Collections.Concurrent/ConcurrentBagTests.cs System.Collections.Concurrent/CollectionStressTestHelper.cs System.Collections.Concurrent/ParallelTestHelper.cs +System.Net.WebSockets/ClientWebSocketTest.cs diff --git a/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs b/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs index f34bcca6d6..fe60d4e5a8 100644 --- a/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs +++ b/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs @@ -360,6 +360,49 @@ namespace MonoTests.Microsoft.CSharp } [Test] + public void CompileFromSource_InMemory_Twice () + { + CompilerParameters options = new CompilerParameters (); + options.GenerateExecutable = false; + options.GenerateInMemory = true; + + ICodeCompiler compiler = _codeProvider.CreateCompiler (); + + var src_1 = "class X { "; + + CompilerResults results_1 = compiler.CompileAssemblyFromSource (options, src_1); + var output_1 = options.OutputAssembly; + + var src_2 = "class X { }"; + + CompilerResults results_2 = compiler.CompileAssemblyFromSource (options, src_2); + var output_2 = options.OutputAssembly; + + // verify compilation was successful + AssertCompileResults (results_2, true); + + Assert.AreEqual (output_1, output_2, "#1"); + } + + + [Test] + public void CompileFromSource_InMemory_With_Extra_Delete () + { + CompilerParameters options = new CompilerParameters (); + options.GenerateExecutable = false; + options.GenerateInMemory = true; + + ICodeCompiler compiler = _codeProvider.CreateCompiler (); + + var src_1 = "class X { "; + + compiler.CompileAssemblyFromSource (options, src_1); + + options.TempFiles.Delete (); + options.TempFiles.Delete (); + } + + [Test] public void CompileFromSourceBatch_InMemory () { // create a file in temp directory to ensure that compiler is not removing diff --git a/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs b/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs index 0098e2de92..9f0e9b0190 100644 --- a/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs +++ b/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs @@ -27,6 +27,7 @@ using System; using System.Threading; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Threading.Tasks; using NUnit.Framework; @@ -192,6 +193,60 @@ namespace MonoTests.System.Collections.Concurrent Assert.IsNull (o); Assert.IsFalse (success); } + + [Test] + public void TakeAnyFromSecondCollection () + { + var a = new BlockingCollection<string> (); + var b = new BlockingCollection<string> (); + var arr = new [] { a, b }; + string res = null; + + Task<int> t = Task.Factory.StartNew (() => BlockingCollection<string>.TakeFromAny (arr, out res)); + a.Add ("foo"); + Assert.AreEqual (0, t.Result, "#1"); + Assert.AreEqual ("foo", res, "#2"); + + t = Task.Factory.StartNew (() => BlockingCollection<string>.TakeFromAny (arr, out res)); + b.Add ("bar"); + Assert.AreEqual (1, t.Result, "#3"); + Assert.AreEqual ("bar", res, "#4"); + } + + [Test] + public void TakeAnyCancellable () + { + var a = new BlockingCollection<string> (); + var b = new BlockingCollection<string> (); + var arr = new [] { a, b }; + var cts = new CancellationTokenSource (); + string res = null; + + Task<int> t = Task.Factory.StartNew (() => BlockingCollection<string>.TakeFromAny (arr, out res, cts.Token)); + Thread.Sleep (100); + a.Add ("foo"); + Assert.AreEqual (0, t.Result, "#1"); + Assert.AreEqual ("foo", res, "#2"); + + t = Task.Factory.StartNew (() => BlockingCollection<string>.TakeFromAny (arr, out res, cts.Token)); + Thread.Sleep (100); + b.Add ("bar"); + Assert.AreEqual (1, t.Result, "#3"); + Assert.AreEqual ("bar", res, "#4"); + + t = Task.Factory.StartNew (() => { + try { + return BlockingCollection<string>.TakeFromAny (arr, out res, cts.Token); + } catch (OperationCanceledException WE_GOT_CANCELED) { + res = "canceled"; + return -10; + } + }); + + cts.Cancel (); + Assert.AreEqual (-10, t.Result, "#5"); + Assert.AreEqual ("canceled", res, "#6"); + } } } #endif diff --git a/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs b/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs index 1262cc3947..b7bc6b5b7e 100644 --- a/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs +++ b/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs @@ -191,6 +191,50 @@ namespace MonoTests.System.Collections.Concurrent Assert.IsTrue (valid, "Aggregate test"); } + + [Test] + public void BasicRemoveEmptyTest () + { + int result; + Assert.IsTrue(bag.IsEmpty); + Assert.IsFalse(bag.TryTake(out result)); + } + + [Test] + public void BasicRemoveTwiceTest() + { + bag.Add (1); + Assert.IsFalse (bag.IsEmpty); + Assert.AreEqual (1, bag.Count); + + int result; + Assert.IsTrue (bag.TryTake (out result)); + Assert.AreEqual (1, result); + Assert.IsTrue (bag.IsEmpty); + Assert.IsFalse (bag.TryTake (out result)); + Assert.IsFalse (bag.TryTake (out result)); + } + + [Test] + public void AddRemoveAddTest() + { + bag.Add (1); + Assert.IsFalse (bag.IsEmpty); + Assert.AreEqual (1, bag.Count); + + int result; + Assert.IsTrue (bag.TryTake (out result)); + Assert.AreEqual (1, result); + Assert.IsTrue (bag.IsEmpty); + + bag.Add (1); + Assert.IsFalse (bag.IsEmpty); + Assert.AreEqual (1, bag.Count); + + Assert.IsTrue (bag.TryTake (out result)); + Assert.AreEqual (1, result); + Assert.IsTrue (bag.IsEmpty); + } [Test] public void AddStressTest () diff --git a/mcs/class/System/Test/System.ComponentModel/BindingListTest.cs b/mcs/class/System/Test/System.ComponentModel/BindingListTest.cs index 88be568f42..92a6253db9 100644 --- a/mcs/class/System/Test/System.ComponentModel/BindingListTest.cs +++ b/mcs/class/System/Test/System.ComponentModel/BindingListTest.cs @@ -629,6 +629,16 @@ namespace MonoTests.System.ComponentModel Assert.IsTrue (added, "ItemAdded"); Assert.IsTrue (changed, "ItemChanged"); } + + [Test] // https://bugzilla.xamarin.com/show_bug.cgi?id=16902 + public void Bug16902 () + { + var list = new BindingList<Item> (); + list.Insert (0, null); + var count = list.Count; + + Assert.AreEqual (1, count, "1"); + } } } diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs index 6f0e4cf3ee..4bd26f9fae 100644..100755 --- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs @@ -4144,6 +4144,54 @@ namespace MonoTests.System.Net.Sockets } [Test] + public void SetSocketOption_MulticastInterfaceIndex_Any () + { + IPAddress ip = IPAddress.Parse ("239.255.255.250"); + int index = 0; + using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) + { + s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(index)); + s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip, index)); + } + } + + [Test] + public void SetSocketOption_MulticastInterfaceIndex_Loopback () + { + IPAddress ip = IPAddress.Parse ("239.255.255.250"); + int index = 1; + using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) + { + s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(index)); + s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip, index)); + } + } + + [Test] + public void SetSocketOption_MulticastInterfaceIndex_Invalid () + { + IPAddress ip = IPAddress.Parse ("239.255.255.250"); + int index = 31415; + using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) + { + try + { + s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(index)); + Assert.Fail ("#1"); + } + catch + {} + try + { + s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip, index)); + Assert.Fail ("#2"); + } + catch + {} + } + } + + [Test] public void Shutdown_NoConnect () { Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); diff --git a/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs b/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs index 6fa403c607..710b4982c1 100644 --- a/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs @@ -1051,16 +1051,21 @@ namespace MonoTests.System.Net.Sockets { [Test] public void Available () { - UdpClient client = new UdpClient (1238); - IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 1238); - byte[] bytes = new byte[] {10, 11, 12, 13}; - - client.Send (bytes, bytes.Length, ep); - int avail = client.Available; - - Assert.AreEqual (bytes.Length, avail, "Available #1"); + using (UdpClient client = new UdpClient (1238)) { + IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 1238); + byte[] bytes = new byte[] {10, 11, 12, 13}; + + int res = client.Send (bytes, bytes.Length, ep); + Assert.AreEqual (bytes.Length, res, "Send"); + + // that might happen too quickly, data sent and not yet received/available + Thread.Sleep (100); + int avail = client.Available; + + Assert.AreEqual (bytes.Length, avail, "Available #1"); - client.Close (); + client.Close (); + } } [Test] diff --git a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs new file mode 100644 index 0000000000..3666003a3f --- /dev/null +++ b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs @@ -0,0 +1,242 @@ +#if NET_4_5 && !MOBILE +using System; +using System.Net; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using System.Net.WebSockets; +using System.Reflection; +using System.Text; + +using NUnit.Framework; + + +namespace MonoTests.System.Net.WebSockets +{ + [TestFixture] + public class ClientWebSocketTest + { + const string EchoServerUrl = "ws://echo.websocket.org"; + const int Port = 42123; + HttpListener listener; + ClientWebSocket socket; + MethodInfo headerSetMethod; + + [SetUp] + public void Setup () + { + listener = new HttpListener (); + listener.Prefixes.Add ("http://localhost:" + Port + "/"); + listener.Start (); + socket = new ClientWebSocket (); + } + + [TearDown] + public void Teardown () + { + if (listener != null) { + listener.Stop (); + listener = null; + } + if (socket != null) { + if (socket.State == WebSocketState.Open) + socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + socket.Dispose (); + socket = null; + } + } + + [Test] + public void ServerHandshakeReturnCrapStatusCodeTest () + { + HandleHttpRequestAsync ((req, resp) => resp.StatusCode = 418); + try { + socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (); + } catch (AggregateException e) { + AssertWebSocketException (e, WebSocketError.Success, typeof (WebException)); + return; + } + Assert.Fail ("Should have thrown"); + } + + [Test] + public void ServerHandshakeReturnWrongUpgradeHeader () + { + HandleHttpRequestAsync ((req, resp) => { + resp.StatusCode = 101; + resp.Headers["Upgrade"] = "gtfo"; + }); + try { + socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (); + } catch (AggregateException e) { + AssertWebSocketException (e, WebSocketError.Success); + return; + } + Assert.Fail ("Should have thrown"); + } + + [Test] + public void ServerHandshakeReturnWrongConnectionHeader () + { + HandleHttpRequestAsync ((req, resp) => { + resp.StatusCode = 101; + resp.Headers["Upgrade"] = "websocket"; + // Mono http request doesn't like the forcing, test still valid since the default connection header value is empty + //ForceSetHeader (resp.Headers, "Connection", "Foo"); + }); + try { + socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (); + } catch (AggregateException e) { + AssertWebSocketException (e, WebSocketError.Success); + return; + } + Assert.Fail ("Should have thrown"); + } + + [Test] + public void EchoTest () + { + const string Payload = "This is a websocket test"; + + Assert.AreEqual (WebSocketState.None, socket.State); + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + Assert.AreEqual (WebSocketState.Open, socket.State); + + var sendBuffer = Encoding.ASCII.GetBytes (Payload); + socket.SendAsync (new ArraySegment<byte> (sendBuffer), WebSocketMessageType.Text, true, CancellationToken.None).Wait (); + + var receiveBuffer = new byte[Payload.Length]; + var resp = socket.ReceiveAsync (new ArraySegment<byte> (receiveBuffer), CancellationToken.None).Result; + + Assert.AreEqual (Payload.Length, resp.Count); + Assert.IsTrue (resp.EndOfMessage); + Assert.AreEqual (WebSocketMessageType.Text, resp.MessageType); + Assert.AreEqual (Payload, Encoding.ASCII.GetString (receiveBuffer, 0, resp.Count)); + + socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + Assert.AreEqual (WebSocketState.Closed, socket.State); + } + + [Test] + public void CloseOutputAsyncTest () + { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + Assert.AreEqual (WebSocketState.Open, socket.State); + + socket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + Assert.AreEqual (WebSocketState.CloseSent, socket.State); + + var resp = socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None).Result; + Assert.AreEqual (WebSocketState.Closed, socket.State); + Assert.AreEqual (WebSocketMessageType.Close, resp.MessageType); + Assert.AreEqual (WebSocketCloseStatus.NormalClosure, resp.CloseStatus); + Assert.AreEqual (string.Empty, resp.CloseStatusDescription); + } + + [Test] + public void CloseAsyncTest () + { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + Assert.AreEqual (WebSocketState.Open, socket.State); + + socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + Assert.AreEqual (WebSocketState.Closed, socket.State); + } + + [Test, ExpectedException (typeof (InvalidOperationException))] + public void SendAsyncArgTest_NotConnected () + { + socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None); + } + + [Test, ExpectedException (typeof (ArgumentNullException))] + public void SendAsyncArgTest_NoArray () + { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + socket.SendAsync (new ArraySegment<byte> (), WebSocketMessageType.Text, true, CancellationToken.None); + } + + [Test, ExpectedException (typeof (InvalidOperationException))] + public void ReceiveAsyncArgTest_NotConnected () + { + socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None); + } + + [Test, ExpectedException (typeof (ArgumentNullException))] + public void ReceiveAsyncArgTest_NoArray () + { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + socket.ReceiveAsync (new ArraySegment<byte> (), CancellationToken.None); + } + + [Test] + public void ReceiveAsyncWrongState_Closed () + { + try { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None).Wait (); + } catch (AggregateException e) { + AssertWebSocketException (e, WebSocketError.Success); + return; + } + Assert.Fail ("Should have thrown"); + } + + [Test] + public void SendAsyncWrongState_Closed () + { + try { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None).Wait (); + } catch (AggregateException e) { + AssertWebSocketException (e, WebSocketError.Success); + return; + } + Assert.Fail ("Should have thrown"); + } + + [Test] + public void SendAsyncWrongState_CloseSent () + { + try { + socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (); + socket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (); + socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None).Wait (); + } catch (AggregateException e) { + AssertWebSocketException (e, WebSocketError.Success); + return; + } + Assert.Fail ("Should have thrown"); + } + + async Task HandleHttpRequestAsync (Action<HttpListenerRequest, HttpListenerResponse> handler) + { + var ctx = await listener.GetContextAsync (); + handler (ctx.Request, ctx.Response); + ctx.Response.Close (); + } + + void AssertWebSocketException (AggregateException e, WebSocketError error, Type inner = null) + { + var wsEx = e.InnerException as WebSocketException; + Console.WriteLine (e.InnerException.ToString ()); + Assert.IsNotNull (wsEx, "Not a websocketexception"); + Assert.AreEqual (error, wsEx.WebSocketErrorCode); + if (inner != null) { + Assert.IsNotNull (wsEx.InnerException); + Assert.IsInstanceOfType (inner, wsEx.InnerException); + } + } + + void ForceSetHeader (WebHeaderCollection headers, string name, string value) + { + if (headerSetMethod == null) + headerSetMethod = typeof (WebHeaderCollection).GetMethod ("AddValue", BindingFlags.NonPublic); + headerSetMethod.Invoke (headers, new[] { name, value }); + } + } +} + +#endif diff --git a/mcs/class/System/Test/System.Net/IPAddressTest.cs b/mcs/class/System/Test/System.Net/IPAddressTest.cs index 965b1cd44a..a07c1a19d9 100644 --- a/mcs/class/System/Test/System.Net/IPAddressTest.cs +++ b/mcs/class/System/Test/System.Net/IPAddressTest.cs @@ -545,6 +545,15 @@ public class IPAddressTest Assert.IsTrue (IPAddress.Parse ("FF01::1").IsIPv6Multicast, "#2"); Assert.IsFalse (IPAddress.Parse ("FE00::1").IsIPv6Multicast, "#3"); } + +#if NET_4_0 + [Test] + public void IsIPv6Teredo () + { + Assert.IsTrue (IPAddress.Parse ("2001::1").IsIPv6Teredo, "#1"); + Assert.IsFalse (IPAddress.Parse ("2002::1").IsIPv6Teredo, "#2"); + } +#endif } } diff --git a/mcs/class/System/mobile_System.dll.sources b/mcs/class/System/mobile_System.dll.sources index 8b5c746266..f5ffb4ac71 100644 --- a/mcs/class/System/mobile_System.dll.sources +++ b/mcs/class/System/mobile_System.dll.sources @@ -20,6 +20,8 @@ System.Collections.Specialized/HybridDictionary.cs System.Collections.Specialized/ListDictionary.cs System.Collections.Specialized/NameObjectCollectionBase.cs System.Collections.Specialized/NameValueCollection.cs +System.Collections.Specialized/IOrderedDictionary.cs +System.Collections.Specialized/OrderedDictionary.cs System.Collections.Specialized/ProcessStringDictionary.cs System.Collections.Specialized/StringCollection.cs System.Collections.Specialized/StringDictionary.cs @@ -28,7 +30,28 @@ System.Collections.Specialized/INotifyCollectionChanged.cs System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs System.Collections.Specialized/NotifyCollectionChangedAction.cs System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs +System.ComponentModel.Design.Serialization/ComponentSerializationService.cs +System.ComponentModel.Design.Serialization/ContextStack.cs +System.ComponentModel.Design.Serialization/DefaultSerializationProviderAttribute.cs +System.ComponentModel.Design.Serialization/DesignerLoader.cs +System.ComponentModel.Design.Serialization/DesignerSerializerAttribute.cs +System.ComponentModel.Design.Serialization/IDesignerLoaderHost.cs +System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.cs +System.ComponentModel.Design.Serialization/IDesignerLoaderService.cs +System.ComponentModel.Design.Serialization/IDesignerSerializationManager.cs +System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.cs +System.ComponentModel.Design.Serialization/IDesignerSerializationService.cs +System.ComponentModel.Design.Serialization/INameCreationService.cs System.ComponentModel.Design.Serialization/InstanceDescriptor.cs +System.ComponentModel.Design.Serialization/MemberRelationship.cs +System.ComponentModel.Design.Serialization/MemberRelationshipService.cs +System.ComponentModel.Design.Serialization/ResolveNameEventArgs.cs +System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs +System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.cs +System.ComponentModel.Design.Serialization/SerializationStore.cs +System.ComponentModel.Design/ActiveDesignerEventArgs.cs +System.ComponentModel.Design/ActiveDesignerEventHandler.cs +System.ComponentModel.Design/CheckoutException.cs System.ComponentModel.Design/CommandID.cs System.ComponentModel.Design/ComponentChangedEventArgs.cs System.ComponentModel.Design/ComponentChangedEventHandler.cs @@ -38,31 +61,61 @@ System.ComponentModel.Design/ComponentEventArgs.cs System.ComponentModel.Design/ComponentEventHandler.cs System.ComponentModel.Design/ComponentRenameEventArgs.cs System.ComponentModel.Design/ComponentRenameEventHandler.cs +System.ComponentModel.Design/DesignerCollection.cs +System.ComponentModel.Design/DesignerEventArgs.cs +System.ComponentModel.Design/DesignerEventHandler.cs +System.ComponentModel.Design/DesignerOptionService.cs System.ComponentModel.Design/DesignerTransaction.cs System.ComponentModel.Design/DesignerTransactionCloseEventArgs.cs System.ComponentModel.Design/DesignerTransactionCloseEventHandler.cs System.ComponentModel.Design/DesignerVerb.cs System.ComponentModel.Design/DesignerVerbCollection.cs +System.ComponentModel.Design/HelpContextType.cs +System.ComponentModel.Design/HelpKeywordAttribute.cs +System.ComponentModel.Design/HelpKeywordType.cs System.ComponentModel.Design/IComponentChangeService.cs +System.ComponentModel.Design/IComponentDiscoveryService.cs +System.ComponentModel.Design/IComponentInitializer.cs System.ComponentModel.Design/IDesigner.cs +System.ComponentModel.Design/IDesignerEventService.cs +System.ComponentModel.Design/IDesignerFilter.cs System.ComponentModel.Design/IDesignerHost.cs +System.ComponentModel.Design/IDesignerHostTransactionState.cs +System.ComponentModel.Design/IDesignerOptionService.cs +System.ComponentModel.Design/IDictionaryService.cs +System.ComponentModel.Design/IEventBindingService.cs +System.ComponentModel.Design/IExtenderListService.cs +System.ComponentModel.Design/IExtenderProviderService.cs +System.ComponentModel.Design/IHelpService.cs +System.ComponentModel.Design/IInheritanceService.cs +System.ComponentModel.Design/IMenuCommandService.cs System.ComponentModel.Design/IReferenceService.cs +System.ComponentModel.Design/IResourceService.cs System.ComponentModel.Design/IRootDesigner.cs +System.ComponentModel.Design/ISelectionService.cs System.ComponentModel.Design/IServiceContainer.cs +System.ComponentModel.Design/ITreeDesigner.cs System.ComponentModel.Design/ITypeDescriptorFilterService.cs +System.ComponentModel.Design/ITypeDiscoveryService.cs System.ComponentModel.Design/ITypeResolutionService.cs System.ComponentModel.Design/MenuCommand.cs +System.ComponentModel.Design/SelectionTypes.cs +System.ComponentModel.Design/ServiceContainer.cs System.ComponentModel.Design/ServiceCreatorCallback.cs System.ComponentModel.Design/StandardCommands.cs +System.ComponentModel.Design/StandardToolWindows.cs +System.ComponentModel.Design/TypeDescriptionProviderService.cs System.ComponentModel.Design/ViewTechnology.cs System.ComponentModel/AddingNewEventArgs.cs System.ComponentModel/AddingNewEventHandler.cs +System.ComponentModel/AmbientValueAttribute.cs System.ComponentModel/ArrayConverter.cs System.ComponentModel/AsyncCompletedEventArgs.cs System.ComponentModel/AsyncCompletedEventHandler.cs System.ComponentModel/AsyncOperation.cs System.ComponentModel/AsyncOperationManager.cs System.ComponentModel/AttributeCollection.cs +System.ComponentModel/AttributeProviderAttribute.cs System.ComponentModel/BackgroundWorker.cs System.ComponentModel/BaseNumberConverter.cs System.ComponentModel/BindableAttribute.cs @@ -73,20 +126,32 @@ System.ComponentModel/BooleanConverter.cs System.ComponentModel/BrowsableAttribute.cs System.ComponentModel/ByteConverter.cs System.ComponentModel/CancelEventArgs.cs +System.ComponentModel/CancelEventHandler.cs System.ComponentModel/CategoryAttribute.cs System.ComponentModel/CharConverter.cs System.ComponentModel/CollectionChangeAction.cs System.ComponentModel/CollectionChangeEventArgs.cs System.ComponentModel/CollectionChangeEventHandler.cs System.ComponentModel/CollectionConverter.cs +System.ComponentModel/ComplexBindingPropertiesAttribute.cs System.ComponentModel/Component.cs System.ComponentModel/ComponentCollection.cs System.ComponentModel/ComponentConverter.cs +System.ComponentModel/ComponentEditor.cs +System.ComponentModel/ComponentResourceManager.cs +System.ComponentModel/Container.cs +System.ComponentModel/ContainerFilterService.cs System.ComponentModel/CultureInfoConverter.cs System.ComponentModel/CustomTypeDescriptor.cs System.ComponentModel/DataErrorsChangedEventArgs.cs +System.ComponentModel/DataObjectAttribute.cs +System.ComponentModel/DataObjectFieldAttribute.cs +System.ComponentModel/DataObjectMethodAttribute.cs +System.ComponentModel/DataObjectMethodType.cs System.ComponentModel/DateTimeConverter.cs +System.ComponentModel/DateTimeOffsetConverter.cs System.ComponentModel/DecimalConverter.cs +System.ComponentModel/DefaultBindingPropertyAttribute.cs System.ComponentModel/DefaultEventAttribute.cs System.ComponentModel/DefaultPropertyAttribute.cs System.ComponentModel/DefaultValueAttribute.cs @@ -109,24 +174,35 @@ System.ComponentModel/EventDescriptor.cs System.ComponentModel/EventDescriptorCollection.cs System.ComponentModel/EventHandlerList.cs System.ComponentModel/ExpandableObjectConverter.cs +System.ComponentModel/ExtenderProvidedPropertyAttribute.cs System.ComponentModel/GuidConverter.cs +System.ComponentModel/HandledEventArgs.cs +System.ComponentModel/HandledEventHandler.cs System.ComponentModel/IBindingList.cs System.ComponentModel/IBindingListView.cs System.ComponentModel/ICancelAddNew.cs System.ComponentModel/IChangeTracking.cs System.ComponentModel/IComNativeDescriptorHandler.cs System.ComponentModel/IComponent.cs -System.ComponentModel/IComponent.cs System.ComponentModel/IContainer.cs System.ComponentModel/ICustomTypeDescriptor.cs System.ComponentModel/IDataErrorInfo.cs -System.ComponentModel/IDataErrorInfo.cs System.ComponentModel/IEditableObject.cs System.ComponentModel/IExtenderProvider.cs +System.ComponentModel/IIntellisenseBuilder.cs System.ComponentModel/IListSource.cs +System.ComponentModel/ImmutableObjectAttribute.cs +System.ComponentModel/INestedContainer.cs +System.ComponentModel/INestedSite.cs +System.ComponentModel/InheritanceAttribute.cs +System.ComponentModel/InheritanceLevel.cs +System.ComponentModel/InitializationEventAttribute.cs System.ComponentModel/INotifyDataErrorInfo.cs System.ComponentModel/INotifyPropertyChanged.cs System.ComponentModel/INotifyPropertyChanging.cs +System.ComponentModel/InstallerTypeAttribute.cs +System.ComponentModel/InstanceCreationEditor.cs +System.ComponentModel/InvalidAsynchronousStateException.cs System.ComponentModel/IRaiseItemChangedEvents.cs System.ComponentModel/IRevertibleChangeTracking.cs System.ComponentModel/ISite.cs @@ -139,7 +215,6 @@ System.ComponentModel/Int16Converter.cs System.ComponentModel/Int32Converter.cs System.ComponentModel/Int64Converter.cs System.ComponentModel/InvalidEnumArgumentException.cs -System.ComponentModel/InvalidEnumArgumentException.cs System.ComponentModel/ListBindableAttribute.cs System.ComponentModel/ListChangedEventArgs.cs System.ComponentModel/ListChangedEventHandler.cs @@ -147,14 +222,18 @@ System.ComponentModel/ListChangedType.cs System.ComponentModel/ListSortDescription.cs System.ComponentModel/ListSortDescriptionCollection.cs System.ComponentModel/ListSortDirection.cs -System.ComponentModel/ListSortDirection.cs System.ComponentModel/LocalizableAttribute.cs +System.ComponentModel/LookupBindingPropertiesAttribute.cs System.ComponentModel/MarshalByValueComponent.cs +System.ComponentModel/MaskedTextProvider.cs +System.ComponentModel/MaskedTextResultHint.cs System.ComponentModel/MemberDescriptor.cs System.ComponentModel/MergablePropertyAttribute.cs System.ComponentModel/MultilineStringConverter.cs +System.ComponentModel/NestedContainer.cs System.ComponentModel/NotifyParentPropertyAttribute.cs System.ComponentModel/NullableConverter.cs +System.ComponentModel/ParenthesizePropertyNameAttribute.cs System.ComponentModel/PasswordPropertyTextAttribute.cs System.ComponentModel/ProgressChangedEventArgs.cs System.ComponentModel/ProgressChangedEventHandler.cs @@ -163,24 +242,27 @@ System.ComponentModel/PropertyChangedEventHandler.cs System.ComponentModel/PropertyChangingEventArgs.cs System.ComponentModel/PropertyChangingEventHandler.cs System.ComponentModel/PropertyDescriptor.cs -System.ComponentModel/PropertyDescriptor.cs System.ComponentModel/PropertyDescriptorCollection.cs -System.ComponentModel/ReadOnlyAttribute.cs +System.ComponentModel/PropertyTabAttribute.cs +System.ComponentModel/PropertyTabScope.cs +System.ComponentModel/ProvidePropertyAttribute.cs System.ComponentModel/ReadOnlyAttribute.cs System.ComponentModel/RecommendedAsConfigurableAttribute.cs System.ComponentModel/ReferenceConverter.cs -System.ComponentModel/ReferenceConverter.cs System.ComponentModel/ReflectionEventDescriptor.cs System.ComponentModel/ReflectionPropertyDescriptor.cs System.ComponentModel/RefreshEventArgs.cs System.ComponentModel/RefreshEventHandler.cs System.ComponentModel/RefreshProperties.cs System.ComponentModel/RefreshPropertiesAttribute.cs +System.ComponentModel/RunInstallerAttribute.cs System.ComponentModel/RunWorkerCompletedEventArgs.cs System.ComponentModel/RunWorkerCompletedEventHandler.cs System.ComponentModel/SByteConverter.cs +System.ComponentModel/SettingsBindableAttribute.cs System.ComponentModel/SingleConverter.cs System.ComponentModel/StringConverter.cs +System.ComponentModel/SyntaxCheck.cs System.ComponentModel/TimeSpanConverter.cs System.ComponentModel/ToolboxItemAttribute.cs System.ComponentModel/ToolboxItemFilterAttribute.cs @@ -188,11 +270,13 @@ System.ComponentModel/ToolboxItemFilterType.cs System.ComponentModel/TypeConverter.cs System.ComponentModel/TypeConverterAttribute.cs System.ComponentModel/TypeDescriptionProvider.cs +System.ComponentModel/TypeDescriptionProviderAttribute.cs System.ComponentModel/TypeDescriptor.cs System.ComponentModel/TypeListConverter.cs System.ComponentModel/UInt16Converter.cs System.ComponentModel/UInt32Converter.cs System.ComponentModel/UInt64Converter.cs +System.ComponentModel/WarningException.cs System.ComponentModel/WeakObjectWrapper.cs System.ComponentModel/WeakObjectWrapperComparer.cs System.ComponentModel/Win32Exception.cs diff --git a/mcs/class/WindowsBase/System.ComponentModel/GroupDescription.cs b/mcs/class/WindowsBase/System.ComponentModel/GroupDescription.cs index ed9d824c33..edc1a624b2 100644 --- a/mcs/class/WindowsBase/System.ComponentModel/GroupDescription.cs +++ b/mcs/class/WindowsBase/System.ComponentModel/GroupDescription.cs @@ -31,12 +31,15 @@ namespace System.ComponentModel { public abstract class GroupDescription : INotifyPropertyChanged { + readonly ObservableCollection<object> groupNames; + protected GroupDescription () { + groupNames = new ObservableCollection<object> (); } public ObservableCollection<object> GroupNames { - get { throw new NotImplementedException (); } + get { return groupNames; } } event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { @@ -48,7 +51,7 @@ namespace System.ComponentModel { public virtual bool NamesMatch (object groupName, object itemName) { - throw new NotImplementedException (); + return Equals (groupName, itemName); } protected virtual void OnPropertyChanged (PropertyChangedEventArgs e) @@ -60,7 +63,7 @@ namespace System.ComponentModel { [EditorBrowsable (EditorBrowsableState.Never)] public bool ShouldSerializeGroupNames () { - throw new NotImplementedException (); + return GroupNames.Count != 0; } public abstract object GroupNameFromItem (object item, int level, CultureInfo culture); diff --git a/mcs/class/WindowsBase/System.ComponentModel/SortDescriptionCollection.cs b/mcs/class/WindowsBase/System.ComponentModel/SortDescriptionCollection.cs index 2044bca076..9174cfb445 100644 --- a/mcs/class/WindowsBase/System.ComponentModel/SortDescriptionCollection.cs +++ b/mcs/class/WindowsBase/System.ComponentModel/SortDescriptionCollection.cs @@ -32,10 +32,17 @@ namespace System.ComponentModel { public class SortDescriptionCollection : Collection<SortDescription>, INotifyCollectionChanged { - public static readonly SortDescriptionCollection Empty = new SortDescriptionCollection (); + public static readonly SortDescriptionCollection Empty = new SortDescriptionCollection (true); - public SortDescriptionCollection () + readonly bool isReadOnly; + + public SortDescriptionCollection () : this (false) + { + } + + SortDescriptionCollection (bool isReadOnly) { + this.isReadOnly = isReadOnly; } event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged { @@ -47,12 +54,18 @@ namespace System.ComponentModel { protected override void ClearItems () { + if (isReadOnly) + throw new NotSupportedException (); + base.ClearItems (); OnCollectionChanged (NotifyCollectionChangedAction.Reset); } protected override void InsertItem (int index, SortDescription item) { + if (isReadOnly) + throw new NotSupportedException (); + item.Seal (); base.InsertItem (index, item); OnCollectionChanged (NotifyCollectionChangedAction.Add, item, index); @@ -60,6 +73,9 @@ namespace System.ComponentModel { protected override void RemoveItem (int index) { + if (isReadOnly) + throw new NotSupportedException (); + SortDescription sd = base [index]; base.RemoveItem (index); OnCollectionChanged (NotifyCollectionChangedAction.Remove, sd, index); @@ -67,6 +83,9 @@ namespace System.ComponentModel { protected override void SetItem (int index, SortDescription item) { + if (isReadOnly) + throw new NotSupportedException (); + SortDescription old = base [index]; item.Seal (); base.SetItem (index, item); diff --git a/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs b/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs index 9160f30bbe..8e02384f58 100644 --- a/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs +++ b/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs @@ -237,7 +237,7 @@ namespace System.IO.Packaging { { while (true) { - string s = relationshipId.ToString (); + string s = "Re" + relationshipId.ToString (); if (!RelationshipExists (s)) return s; relationshipId ++; @@ -262,4 +262,4 @@ namespace System.IO.Packaging { Package.WriteRelationships (Relationships, s); } } -}
\ No newline at end of file +} diff --git a/mcs/class/WindowsBase/System.Windows/PointConverter.cs b/mcs/class/WindowsBase/System.Windows/PointConverter.cs index 7391bae685..eef6c529da 100644 --- a/mcs/class/WindowsBase/System.Windows/PointConverter.cs +++ b/mcs/class/WindowsBase/System.Windows/PointConverter.cs @@ -44,7 +44,7 @@ namespace System.Windows { public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) { if (!(value is string)) - throw new NotSupportedException ("RectConverter only supports converting from strings"); + throw new NotSupportedException ("PointConverter only supports converting from strings"); return Point.Parse ((string)value); } diff --git a/mcs/class/WindowsBase/Test/System.ComponentModel/GroupDescriptionTest.cs b/mcs/class/WindowsBase/Test/System.ComponentModel/GroupDescriptionTest.cs new file mode 100644 index 0000000000..037e0394ec --- /dev/null +++ b/mcs/class/WindowsBase/Test/System.ComponentModel/GroupDescriptionTest.cs @@ -0,0 +1,68 @@ +// +// GroupDescriptionTest.cs +// +// Author: +// Antonius Riha <antoniusriha@gmail.com> +// +// Copyright (c) 2014 Antonius Riha +// +// 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. +using System; +using System.ComponentModel; +using System.Globalization; +using NUnit.Framework; + +namespace MonoTests.System.ComponentModel +{ + [TestFixture] + public class GroupDescriptionTest + { + [Test] + public void NamesMatch () + { + var gd = new ConcreteGroupDescription (); + var obj = new object (); + Assert.IsTrue (gd.NamesMatch (obj, obj), "A1"); + Assert.IsFalse (gd.NamesMatch (new object (), new object ()), "A2"); + } + + [Test] + public void ShouldSerializeGroupNames () + { + var g = new ConcreteGroupDescription (); + g.GroupNames.Add ("name"); + Assert.IsTrue (g.ShouldSerializeGroupNames (), "#A1"); + } + + [Test] + public void ShouldSerializeGroupNamesEmpty () + { + var g = new ConcreteGroupDescription (); + Assert.IsFalse (g.ShouldSerializeGroupNames (), "#A1"); + } + + class ConcreteGroupDescription : GroupDescription + { + public override object GroupNameFromItem (object item, int level, CultureInfo culture) + { + throw new NotSupportedException (); + } + } + } +} diff --git a/mcs/class/WindowsBase/Test/System.ComponentModel/SortDescriptionCollectionTest.cs b/mcs/class/WindowsBase/Test/System.ComponentModel/SortDescriptionCollectionTest.cs index 9c1e3d5e66..cfde0f6813 100644 --- a/mcs/class/WindowsBase/Test/System.ComponentModel/SortDescriptionCollectionTest.cs +++ b/mcs/class/WindowsBase/Test/System.ComponentModel/SortDescriptionCollectionTest.cs @@ -152,5 +152,51 @@ namespace MonoTests.System.ComponentModel { Assert.AreEqual (ListSortDirection.Descending, addedItem.Direction, "ADD_#2"); Assert.AreEqual (true, addedItem.IsSealed, "ADD_#3"); } + + [Test] + public void GetEmptyCollection () + { + var collection = SortDescriptionCollection.Empty; + CollectionAssert.IsEmpty (collection, "A1"); + } + + [Test] + [ExpectedException (typeof(NotSupportedException))] + public void AddToEmptyCollection () + { + var collection = SortDescriptionCollection.Empty; + collection.Add (new SortDescription ()); + } + + [Test] + public void RemoveFromEmptyCollection () + { + var collection = SortDescriptionCollection.Empty; + Assert.IsFalse (collection.Remove (new SortDescription ()), "A1"); + } + + [Test] + [ExpectedException (typeof(NotSupportedException))] + public void RemoveAtIndexFromEmptyCollection () + { + var collection = SortDescriptionCollection.Empty; + collection.RemoveAt (0); + } + + [Test] + [ExpectedException (typeof(NotSupportedException))] + public void ClearEmptyCollection () + { + var collection = SortDescriptionCollection.Empty; + collection.Clear (); + } + + [Test] + [ExpectedException (typeof(NotSupportedException))] + public void InsertIntoEmptyCollection () + { + var collection = SortDescriptionCollection.Empty; + collection.Insert (0, new SortDescription ()); + } } } diff --git a/mcs/class/WindowsBase/WindowsBase_test.dll.sources b/mcs/class/WindowsBase/WindowsBase_test.dll.sources index 437fef32ef..23dde059fc 100644 --- a/mcs/class/WindowsBase/WindowsBase_test.dll.sources +++ b/mcs/class/WindowsBase/WindowsBase_test.dll.sources @@ -3,6 +3,7 @@ System.Collections.ObjectModel/ReadOnlyObservableCollectionTest.cs System.Collections.Specialized/NotifyCollectionChangedEventArgsTest.cs System.Collections.Specialized/CollectionChangedEventValidators.cs System.ComponentModel/CurrentChangingEventArgsTest.cs +System.ComponentModel/GroupDescriptionTest.cs System.ComponentModel/PropertyFilterAttributeTest.cs System.ComponentModel/SortDescriptionCollectionTest.cs System.ComponentModel/SortDescriptionTest.cs diff --git a/mcs/class/corlib/Documentation/en/System.Collections.Concurrent/EnumerablePartitionerOptions.xml b/mcs/class/corlib/Documentation/en/System.Collections.Concurrent/EnumerablePartitionerOptions.xml new file mode 100644 index 0000000000..b91575013c --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.Concurrent/EnumerablePartitionerOptions.xml @@ -0,0 +1,50 @@ +<Type Name="EnumerablePartitionerOptions" FullName="System.Collections.Concurrent.EnumerablePartitionerOptions"> + <TypeSignature Language="C#" Value="public enum EnumerablePartitionerOptions" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed EnumerablePartitionerOptions extends System.Enum" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Enum</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Flags</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="NoBuffering"> + <MemberSignature Language="C#" Value="NoBuffering" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Collections.Concurrent.EnumerablePartitionerOptions NoBuffering = int32(1)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Concurrent.EnumerablePartitionerOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + <Member MemberName="None"> + <MemberSignature Language="C#" Value="None" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Collections.Concurrent.EnumerablePartitionerOptions None = int32(0)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Concurrent.EnumerablePartitionerOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyCollection`1.xml b/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyCollection`1.xml new file mode 100644 index 0000000000..ed282726cc --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyCollection`1.xml @@ -0,0 +1,43 @@ +<Type Name="IReadOnlyCollection<T>" FullName="System.Collections.Generic.IReadOnlyCollection<T>"> + <TypeSignature Language="C#" Value="public interface IReadOnlyCollection<out T> : System.Collections.Generic.IEnumerable<out T>" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IReadOnlyCollection`1<+ T> implements class System.Collections.Generic.IEnumerable`1<!T>, class System.Collections.IEnumerable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.Generic.IEnumerable<T></InterfaceName> + </Interface> + </Interfaces> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Count"> + <MemberSignature Language="C#" Value="public int Count { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Count" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyDictionary`2.xml b/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyDictionary`2.xml new file mode 100644 index 0000000000..b3f68e823d --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyDictionary`2.xml @@ -0,0 +1,122 @@ +<Type Name="IReadOnlyDictionary<TKey,TValue>" FullName="System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>"> + <TypeSignature Language="C#" Value="public interface IReadOnlyDictionary<TKey,TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IReadOnlyDictionary`2<TKey, TValue> implements class System.Collections.Generic.IEnumerable`1<valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>>, class System.Collections.Generic.IReadOnlyCollection`1<valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>>, class System.Collections.IEnumerable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TKey" /> + <TypeParameter Name="TValue" /> + </TypeParameters> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey,TValue>></InterfaceName> + </Interface> + </Interfaces> + <Docs> + <typeparam name="TKey">To be added.</typeparam> + <typeparam name="TValue">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="ContainsKey"> + <MemberSignature Language="C#" Value="public bool ContainsKey (TKey key);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool ContainsKey(!TKey key) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Item"> + <MemberSignature Language="C#" Value="public TValue this[TKey key] { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !TValue Item(!TKey)" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>TValue</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Keys"> + <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable<TKey> Keys { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<!TKey> Keys" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<TKey></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="TryGetValue"> + <MemberSignature Language="C#" Value="public bool TryGetValue (TKey key, out TValue value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool TryGetValue(!TKey key, !TValue value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + <Parameter Name="value" Type="TValue&" RefType="out" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Values"> + <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable<TValue> Values { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<!TValue> Values" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<TValue></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyList`1.xml b/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyList`1.xml new file mode 100644 index 0000000000..ebeeecb310 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.Generic/IReadOnlyList`1.xml @@ -0,0 +1,50 @@ +<Type Name="IReadOnlyList<T>" FullName="System.Collections.Generic.IReadOnlyList<T>"> + <TypeSignature Language="C#" Value="public interface IReadOnlyList<out T> : System.Collections.Generic.IEnumerable<out T>, System.Collections.Generic.IReadOnlyCollection<out T>" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IReadOnlyList`1<+ T> implements class System.Collections.Generic.IEnumerable`1<!T>, class System.Collections.Generic.IReadOnlyCollection`1<!T>, class System.Collections.IEnumerable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.Generic.IEnumerable<T></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IReadOnlyCollection<T></InterfaceName> + </Interface> + </Interfaces> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Item"> + <MemberSignature Language="C#" Value="public T this[int index] { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !T Item(int32)" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="index" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="index">To be added.</param> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml b/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml new file mode 100644 index 0000000000..97114ee87a --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml @@ -0,0 +1,255 @@ +<Type Name="ReadOnlyDictionary<TKey,TValue>+KeyCollection" FullName="System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>+KeyCollection"> + <TypeSignature Language="C#" Value="public sealed class ReadOnlyDictionary<TKey,TValue>.KeyCollection : System.Collections.Generic.ICollection<TKey>, System.Collections.Generic.IEnumerable<TKey>, System.Collections.ICollection" /> + <TypeSignature Language="ILAsm" Value=".class nested public auto ansi serializable sealed beforefieldinit ReadOnlyDictionary`2/KeyCollection<TKey, TValue> extends System.Object implements class System.Collections.Generic.ICollection`1<!TKey>, class System.Collections.Generic.IEnumerable`1<!TKey>, class System.Collections.ICollection, class System.Collections.IEnumerable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TKey" /> + <TypeParameter Name="TValue" /> + </TypeParameters> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.Generic.ICollection<TKey></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IEnumerable<TKey></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.ICollection</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerDisplay("Count={Count}")</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.Generic.CollectionDebuggerView`2))</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="CopyTo"> + <MemberSignature Language="C#" Value="public void CopyTo (TKey[] array, int arrayIndex);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void CopyTo(!TKey[] array, int32 arrayIndex) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="array" Type="TKey[]" /> + <Parameter Name="arrayIndex" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="array">To be added.</param> + <param name="arrayIndex">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Count"> + <MemberSignature Language="C#" Value="public int Count { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Count" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetEnumerator"> + <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerator<TKey> GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IEnumerator`1<!TKey> GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerator<TKey></ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TKey>.Add"> + <MemberSignature Language="C#" Value="void ICollection<TKey>.Add (TKey item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<TKey>.Add(!TKey item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="TKey" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TKey>.Clear"> + <MemberSignature Language="C#" Value="void ICollection<TKey>.Clear ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<TKey>.Clear() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TKey>.Contains"> + <MemberSignature Language="C#" Value="bool ICollection<TKey>.Contains (TKey item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.ICollection<TKey>.Contains(!TKey item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="TKey" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TKey>.IsReadOnly"> + <MemberSignature Language="C#" Value="bool System.Collections.Generic.ICollection<TKey>.IsReadOnly { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.Generic.ICollection<TKey>.IsReadOnly" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TKey>.Remove"> + <MemberSignature Language="C#" Value="bool ICollection<TKey>.Remove (TKey item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.ICollection<TKey>.Remove(!TKey item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="TKey" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.CopyTo"> + <MemberSignature Language="C#" Value="void ICollection.CopyTo (Array array, int index);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.ICollection.CopyTo(class System.Array array, int32 index) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="array" Type="System.Array" /> + <Parameter Name="index" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="array">To be added.</param> + <param name="index">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.IsSynchronized"> + <MemberSignature Language="C#" Value="bool System.Collections.ICollection.IsSynchronized { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.ICollection.IsSynchronized" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.SyncRoot"> + <MemberSignature Language="C#" Value="object System.Collections.ICollection.SyncRoot { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance object System.Collections.ICollection.SyncRoot" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Object</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IEnumerable.GetEnumerator"> + <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.IEnumerator</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml b/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml new file mode 100644 index 0000000000..cac08361b0 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml @@ -0,0 +1,255 @@ +<Type Name="ReadOnlyDictionary<TKey,TValue>+ValueCollection" FullName="System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>+ValueCollection"> + <TypeSignature Language="C#" Value="public sealed class ReadOnlyDictionary<TKey,TValue>.ValueCollection : System.Collections.Generic.ICollection<TValue>, System.Collections.Generic.IEnumerable<TValue>, System.Collections.ICollection" /> + <TypeSignature Language="ILAsm" Value=".class nested public auto ansi serializable sealed beforefieldinit ReadOnlyDictionary`2/ValueCollection<TKey, TValue> extends System.Object implements class System.Collections.Generic.ICollection`1<!TValue>, class System.Collections.Generic.IEnumerable`1<!TValue>, class System.Collections.ICollection, class System.Collections.IEnumerable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TKey" /> + <TypeParameter Name="TValue" /> + </TypeParameters> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.Generic.ICollection<TValue></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IEnumerable<TValue></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.ICollection</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerDisplay("Count={Count}")</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.Generic.CollectionDebuggerView`2))</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="CopyTo"> + <MemberSignature Language="C#" Value="public void CopyTo (TValue[] array, int arrayIndex);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void CopyTo(!TValue[] array, int32 arrayIndex) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="array" Type="TValue[]" /> + <Parameter Name="arrayIndex" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="array">To be added.</param> + <param name="arrayIndex">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Count"> + <MemberSignature Language="C#" Value="public int Count { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Count" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetEnumerator"> + <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerator<TValue> GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IEnumerator`1<!TValue> GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerator<TValue></ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TValue>.Add"> + <MemberSignature Language="C#" Value="void ICollection<TValue>.Add (TValue item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<TValue>.Add(!TValue item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="TValue" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TValue>.Clear"> + <MemberSignature Language="C#" Value="void ICollection<TValue>.Clear ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<TValue>.Clear() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TValue>.Contains"> + <MemberSignature Language="C#" Value="bool ICollection<TValue>.Contains (TValue item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.ICollection<TValue>.Contains(!TValue item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="TValue" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TValue>.IsReadOnly"> + <MemberSignature Language="C#" Value="bool System.Collections.Generic.ICollection<TValue>.IsReadOnly { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.Generic.ICollection<TValue>.IsReadOnly" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<TValue>.Remove"> + <MemberSignature Language="C#" Value="bool ICollection<TValue>.Remove (TValue item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.ICollection<TValue>.Remove(!TValue item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="TValue" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.CopyTo"> + <MemberSignature Language="C#" Value="void ICollection.CopyTo (Array array, int index);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.ICollection.CopyTo(class System.Array array, int32 index) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="array" Type="System.Array" /> + <Parameter Name="index" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="array">To be added.</param> + <param name="index">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.IsSynchronized"> + <MemberSignature Language="C#" Value="bool System.Collections.ICollection.IsSynchronized { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.ICollection.IsSynchronized" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.SyncRoot"> + <MemberSignature Language="C#" Value="object System.Collections.ICollection.SyncRoot { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance object System.Collections.ICollection.SyncRoot" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Object</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IEnumerable.GetEnumerator"> + <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.IEnumerator</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml b/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml new file mode 100644 index 0000000000..25a0de8b34 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml @@ -0,0 +1,694 @@ +<Type Name="ReadOnlyDictionary<TKey,TValue>" FullName="System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>"> + <TypeSignature Language="C#" Value="public class ReadOnlyDictionary<TKey,TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IDictionary<TKey,TValue>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>, System.Collections.IDictionary" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit ReadOnlyDictionary`2<TKey, TValue> extends System.Object implements class System.Collections.Generic.ICollection`1<valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>>, class System.Collections.Generic.IDictionary`2<!TKey, !TValue>, class System.Collections.Generic.IEnumerable`1<valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>>, class System.Collections.Generic.IReadOnlyCollection`1<valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>>, class System.Collections.Generic.IReadOnlyDictionary`2<!TKey, !TValue>, class System.Collections.ICollection, class System.Collections.IDictionary, class System.Collections.IEnumerable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TKey" /> + <TypeParameter Name="TValue" /> + </TypeParameters> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IDictionary<TKey,TValue></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey,TValue>></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.Generic.IReadOnlyDictionary<TKey,TValue></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Collections.IDictionary</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerDisplay("Count={Count}")</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.Generic.CollectionDebuggerView`2))</AttributeName> + </Attribute> + </Attributes> + <Docs> + <typeparam name="TKey">To be added.</typeparam> + <typeparam name="TValue">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ReadOnlyDictionary (System.Collections.Generic.IDictionary<TKey,TValue> dictionary);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Collections.Generic.IDictionary`2<!TKey, !TValue> dictionary) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="dictionary" Type="System.Collections.Generic.IDictionary<TKey,TValue>" /> + </Parameters> + <Docs> + <param name="dictionary">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ContainsKey"> + <MemberSignature Language="C#" Value="public bool ContainsKey (TKey key);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool ContainsKey(!TKey key) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Count"> + <MemberSignature Language="C#" Value="public int Count { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Count" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Dictionary"> + <MemberSignature Language="C#" Value="protected System.Collections.Generic.IDictionary<TKey,TValue> Dictionary { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IDictionary`2<!TKey, !TValue> Dictionary" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IDictionary<TKey,TValue></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetEnumerator"> + <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>> GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IEnumerator`1<valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>> GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>></ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Item"> + <MemberSignature Language="C#" Value="public TValue this[TKey key] { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !TValue Item(!TKey)" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>TValue</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Keys"> + <MemberSignature Language="C#" Value="public System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>.KeyCollection Keys { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<!TKey, !TValue> Keys" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>+KeyCollection</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add"> + <MemberSignature Language="C#" Value="void ICollection<KeyValuePair<TKey,TValue>>.Add (System.Collections.Generic.KeyValuePair<TKey,TValue> item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue> item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="System.Collections.Generic.KeyValuePair<TKey,TValue>" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Clear"> + <MemberSignature Language="C#" Value="void ICollection<KeyValuePair<TKey,TValue>>.Clear ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Clear() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains"> + <MemberSignature Language="C#" Value="bool ICollection<KeyValuePair<TKey,TValue>>.Contains (System.Collections.Generic.KeyValuePair<TKey,TValue> item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains(valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue> item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="System.Collections.Generic.KeyValuePair<TKey,TValue>" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo"> + <MemberSignature Language="C#" Value="void ICollection<KeyValuePair<TKey,TValue>>.CopyTo (System.Collections.Generic.KeyValuePair<TKey,TValue>[] array, int arrayIndex);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue>[] array, int32 arrayIndex) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="array" Type="System.Collections.Generic.KeyValuePair<TKey,TValue>[]" /> + <Parameter Name="arrayIndex" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="array">To be added.</param> + <param name="arrayIndex">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.IsReadOnly"> + <MemberSignature Language="C#" Value="bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.IsReadOnly { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.IsReadOnly" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove"> + <MemberSignature Language="C#" Value="bool ICollection<KeyValuePair<TKey,TValue>>.Remove (System.Collections.Generic.KeyValuePair<TKey,TValue> item);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove(valuetype System.Collections.Generic.KeyValuePair`2<!TKey, !TValue> item) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="item" Type="System.Collections.Generic.KeyValuePair<TKey,TValue>" /> + </Parameters> + <Docs> + <param name="item">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IDictionary<TKey,TValue>.Add"> + <MemberSignature Language="C#" Value="void IDictionary<TKey,TValue>.Add (TKey key, TValue value);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.Generic.IDictionary<TKey,TValue>.Add(!TKey key, !TValue value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + <Parameter Name="value" Type="TValue" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IDictionary<TKey,TValue>.Item"> + <MemberSignature Language="C#" Value="TValue System.Collections.Generic.IDictionary<TKey,TValue>.Item[TKey key] { get; set; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !TValue System.Collections.Generic.IDictionary<TKey,TValue>.Item(!TKey)" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>TValue</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IDictionary<TKey,TValue>.Keys"> + <MemberSignature Language="C#" Value="System.Collections.Generic.ICollection<TKey> System.Collections.Generic.IDictionary<TKey,TValue>.Keys { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.ICollection`1<!TKey> System.Collections.Generic.IDictionary<TKey,TValue>.Keys" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.ICollection<TKey></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IDictionary<TKey,TValue>.Remove"> + <MemberSignature Language="C#" Value="bool IDictionary<TKey,TValue>.Remove (TKey key);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.Generic.IDictionary<TKey,TValue>.Remove(!TKey key) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IDictionary<TKey,TValue>.Values"> + <MemberSignature Language="C#" Value="System.Collections.Generic.ICollection<TValue> System.Collections.Generic.IDictionary<TKey,TValue>.Values { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.ICollection`1<!TValue> System.Collections.Generic.IDictionary<TKey,TValue>.Values" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.ICollection<TValue></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Keys"> + <MemberSignature Language="C#" Value="System.Collections.Generic.IEnumerable<TKey> System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Keys { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<!TKey> System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Keys" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<TKey></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Values"> + <MemberSignature Language="C#" Value="System.Collections.Generic.IEnumerable<TValue> System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Values { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<!TValue> System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Values" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<TValue></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.CopyTo"> + <MemberSignature Language="C#" Value="void ICollection.CopyTo (Array array, int index);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.ICollection.CopyTo(class System.Array array, int32 index) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="array" Type="System.Array" /> + <Parameter Name="index" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="array">To be added.</param> + <param name="index">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.IsSynchronized"> + <MemberSignature Language="C#" Value="bool System.Collections.ICollection.IsSynchronized { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.ICollection.IsSynchronized" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.ICollection.SyncRoot"> + <MemberSignature Language="C#" Value="object System.Collections.ICollection.SyncRoot { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance object System.Collections.ICollection.SyncRoot" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Object</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Add"> + <MemberSignature Language="C#" Value="void IDictionary.Add (object key, object value);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.IDictionary.Add(object key, object value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="System.Object" /> + <Parameter Name="value" Type="System.Object" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Clear"> + <MemberSignature Language="C#" Value="void IDictionary.Clear ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.IDictionary.Clear() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Contains"> + <MemberSignature Language="C#" Value="bool IDictionary.Contains (object key);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance bool System.Collections.IDictionary.Contains(object key) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="System.Object" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.GetEnumerator"> + <MemberSignature Language="C#" Value="System.Collections.IDictionaryEnumerator IDictionary.GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IDictionaryEnumerator System.Collections.IDictionary.GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.IDictionaryEnumerator</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.IsFixedSize"> + <MemberSignature Language="C#" Value="bool System.Collections.IDictionary.IsFixedSize { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.IDictionary.IsFixedSize" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.IsReadOnly"> + <MemberSignature Language="C#" Value="bool System.Collections.IDictionary.IsReadOnly { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.IDictionary.IsReadOnly" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Item"> + <MemberSignature Language="C#" Value="object System.Collections.IDictionary.Item[object key] { get; set; }" /> + <MemberSignature Language="ILAsm" Value=".property instance object System.Collections.IDictionary.Item(object)" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Object</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="System.Object" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Keys"> + <MemberSignature Language="C#" Value="System.Collections.ICollection System.Collections.IDictionary.Keys { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ICollection System.Collections.IDictionary.Keys" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ICollection</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Remove"> + <MemberSignature Language="C#" Value="void IDictionary.Remove (object key);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.IDictionary.Remove(object key) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="System.Object" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IDictionary.Values"> + <MemberSignature Language="C#" Value="System.Collections.ICollection System.Collections.IDictionary.Values { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ICollection System.Collections.IDictionary.Values" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ICollection</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Collections.IEnumerable.GetEnumerator"> + <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.IEnumerator</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="TryGetValue"> + <MemberSignature Language="C#" Value="public bool TryGetValue (TKey key, out TValue value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool TryGetValue(!TKey key, !TValue value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="key" Type="TKey" /> + <Parameter Name="value" Type="TValue&" RefType="out" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Values"> + <MemberSignature Language="C#" Value="public System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>.ValueCollection Values { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<!TKey, !TValue> Values" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>+ValueCollection</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractAbbreviatorAttribute.xml b/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractAbbreviatorAttribute.xml new file mode 100644 index 0000000000..69068d3d77 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractAbbreviatorAttribute.xml @@ -0,0 +1,39 @@ +<Type Name="ContractAbbreviatorAttribute" FullName="System.Diagnostics.Contracts.ContractAbbreviatorAttribute"> + <TypeSignature Language="C#" Value="public sealed class ContractAbbreviatorAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ContractAbbreviatorAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Method)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ContractAbbreviatorAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractArgumentValidatorAttribute.xml b/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractArgumentValidatorAttribute.xml new file mode 100644 index 0000000000..14f78529e9 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractArgumentValidatorAttribute.xml @@ -0,0 +1,39 @@ +<Type Name="ContractArgumentValidatorAttribute" FullName="System.Diagnostics.Contracts.ContractArgumentValidatorAttribute"> + <TypeSignature Language="C#" Value="public sealed class ContractArgumentValidatorAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ContractArgumentValidatorAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Method)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ContractArgumentValidatorAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractOptionAttribute.xml b/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractOptionAttribute.xml new file mode 100644 index 0000000000..04f199f7f6 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Diagnostics.Contracts/ContractOptionAttribute.xml @@ -0,0 +1,130 @@ +<Type Name="ContractOptionAttribute" FullName="System.Diagnostics.Contracts.ContractOptionAttribute"> + <TypeSignature Language="C#" Value="public class ContractOptionAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ContractOptionAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=true, Inherited=false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ContractOptionAttribute (string category, string setting, bool enabled);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string category, string setting, bool enabled) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="category" Type="System.String" /> + <Parameter Name="setting" Type="System.String" /> + <Parameter Name="enabled" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="category">To be added.</param> + <param name="setting">To be added.</param> + <param name="enabled">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ContractOptionAttribute (string category, string setting, string value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string category, string setting, string value) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="category" Type="System.String" /> + <Parameter Name="setting" Type="System.String" /> + <Parameter Name="value" Type="System.String" /> + </Parameters> + <Docs> + <param name="category">To be added.</param> + <param name="setting">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Category"> + <MemberSignature Language="C#" Value="public string Category { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Category" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Enabled"> + <MemberSignature Language="C#" Value="public bool Enabled { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool Enabled" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Setting"> + <MemberSignature Language="C#" Value="public string Setting { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Setting" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Value"> + <MemberSignature Language="C#" Value="public string Value { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Value" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Globalization/CultureInfo.xml b/mcs/class/corlib/Documentation/en/System.Globalization/CultureInfo.xml index 06974c4677..83cd914f02 100755 --- a/mcs/class/corlib/Documentation/en/System.Globalization/CultureInfo.xml +++ b/mcs/class/corlib/Documentation/en/System.Globalization/CultureInfo.xml @@ -23,15 +23,9 @@ </Interfaces> <Docs> <summary> - <para> Reserved for future use.</para> + <para>Represents locale information used by all culture dependendent types and methods.</para> </summary> <remarks> - <para> - <block subset="none" type="note">This class is - provided in order to implement the abstract methods that require it in the - reflection library. - </block> - </para> </remarks> </Docs> <Members> @@ -225,9 +219,9 @@ <ReturnType>System.Globalization.CultureInfo</ReturnType> </ReturnValue> <Docs> - <summary>To be added.</summary> - <value>To be added.</value> - <remarks>To be added.</remarks> + <summary>CultureInfo that represents the culture used by the current thread.</summary> + <value></value> + <remarks>Initial value for each thread is determined using following rules. When <see cref="P:System.Globalization.CultureInfo.DefaultThreadCurrentCulture" /> is set its value is used otherwise the framework uses <see cref="M:System.Globalization.CultureInfo.CreateSpecificCulture" /> method to map system locate to framework culture name. This operation may fail in rare cases when system locale is set to invalid value or to value which cannot be translated to framework culture name. In such case <see cref="P:System.Globalization.CultureInfo.InvariantCulture" /> values is used.</remarks> </Docs> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/AssemblyContentType.xml b/mcs/class/corlib/Documentation/en/System.Reflection/AssemblyContentType.xml new file mode 100644 index 0000000000..447c8fc8d6 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/AssemblyContentType.xml @@ -0,0 +1,50 @@ +<Type Name="AssemblyContentType" FullName="System.Reflection.AssemblyContentType"> + <TypeSignature Language="C#" Value="public enum AssemblyContentType" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed AssemblyContentType extends System.Enum" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Enum</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Default"> + <MemberSignature Language="C#" Value="Default" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Reflection.AssemblyContentType Default = int32(0)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.AssemblyContentType</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + <Member MemberName="WindowsRuntime"> + <MemberSignature Language="C#" Value="WindowsRuntime" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Reflection.AssemblyContentType WindowsRuntime = int32(1)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.AssemblyContentType</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/AssemblyMetadataAttribute.xml b/mcs/class/corlib/Documentation/en/System.Reflection/AssemblyMetadataAttribute.xml new file mode 100644 index 0000000000..85085c7e14 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/AssemblyMetadataAttribute.xml @@ -0,0 +1,73 @@ +<Type Name="AssemblyMetadataAttribute" FullName="System.Reflection.AssemblyMetadataAttribute"> + <TypeSignature Language="C#" Value="public sealed class AssemblyMetadataAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit AssemblyMetadataAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AssemblyMetadataAttribute (string key, string value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string key, string value) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="key" Type="System.String" /> + <Parameter Name="value" Type="System.String" /> + </Parameters> + <Docs> + <param name="key">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Key"> + <MemberSignature Language="C#" Value="public string Key { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Key" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Value"> + <MemberSignature Language="C#" Value="public string Value { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Value" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/AssemblySignatureKeyAttribute.xml b/mcs/class/corlib/Documentation/en/System.Reflection/AssemblySignatureKeyAttribute.xml new file mode 100644 index 0000000000..08a2ea1156 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/AssemblySignatureKeyAttribute.xml @@ -0,0 +1,73 @@ +<Type Name="AssemblySignatureKeyAttribute" FullName="System.Reflection.AssemblySignatureKeyAttribute"> + <TypeSignature Language="C#" Value="public sealed class AssemblySignatureKeyAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit AssemblySignatureKeyAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AssemblySignatureKeyAttribute (string publicKey, string countersignature);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string publicKey, string countersignature) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="publicKey" Type="System.String" /> + <Parameter Name="countersignature" Type="System.String" /> + </Parameters> + <Docs> + <param name="publicKey">To be added.</param> + <param name="countersignature">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Countersignature"> + <MemberSignature Language="C#" Value="public string Countersignature { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Countersignature" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="PublicKey"> + <MemberSignature Language="C#" Value="public string PublicKey { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string PublicKey" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/CustomAttributeExtensions.xml b/mcs/class/corlib/Documentation/en/System.Reflection/CustomAttributeExtensions.xml new file mode 100644 index 0000000000..df30bdc794 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/CustomAttributeExtensions.xml @@ -0,0 +1,894 @@ +<Type Name="CustomAttributeExtensions" FullName="System.Reflection.CustomAttributeExtensions"> + <TypeSignature Language="C#" Value="public static class CustomAttributeExtensions" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit CustomAttributeExtensions extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetCustomAttribute"> + <MemberSignature Language="C#" Value="public static Attribute GetCustomAttribute (this System.Reflection.Assembly element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Attribute GetCustomAttribute(class System.Reflection.Assembly element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Attribute</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Assembly" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute"> + <MemberSignature Language="C#" Value="public static Attribute GetCustomAttribute (this System.Reflection.MemberInfo element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Attribute GetCustomAttribute(class System.Reflection.MemberInfo element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Attribute</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute"> + <MemberSignature Language="C#" Value="public static Attribute GetCustomAttribute (this System.Reflection.Module element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Attribute GetCustomAttribute(class System.Reflection.Module element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Attribute</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Module" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute"> + <MemberSignature Language="C#" Value="public static Attribute GetCustomAttribute (this System.Reflection.ParameterInfo element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Attribute GetCustomAttribute(class System.Reflection.ParameterInfo element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Attribute</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute"> + <MemberSignature Language="C#" Value="public static Attribute GetCustomAttribute (this System.Reflection.MemberInfo element, Type attributeType, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Attribute GetCustomAttribute(class System.Reflection.MemberInfo element, class System.Type attributeType, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Attribute</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute"> + <MemberSignature Language="C#" Value="public static Attribute GetCustomAttribute (this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Attribute GetCustomAttribute(class System.Reflection.ParameterInfo element, class System.Type attributeType, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Attribute</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute<T>"> + <MemberSignature Language="C#" Value="public static T GetCustomAttribute<T> (this System.Reflection.Assembly element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetCustomAttribute<(class System.Attribute) T>(class System.Reflection.Assembly element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Assembly" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute<T>"> + <MemberSignature Language="C#" Value="public static T GetCustomAttribute<T> (this System.Reflection.MemberInfo element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetCustomAttribute<(class System.Attribute) T>(class System.Reflection.MemberInfo element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute<T>"> + <MemberSignature Language="C#" Value="public static T GetCustomAttribute<T> (this System.Reflection.Module element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetCustomAttribute<(class System.Attribute) T>(class System.Reflection.Module element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Module" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute<T>"> + <MemberSignature Language="C#" Value="public static T GetCustomAttribute<T> (this System.Reflection.ParameterInfo element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetCustomAttribute<(class System.Attribute) T>(class System.Reflection.ParameterInfo element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute<T>"> + <MemberSignature Language="C#" Value="public static T GetCustomAttribute<T> (this System.Reflection.MemberInfo element, bool inherit) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetCustomAttribute<(class System.Attribute) T>(class System.Reflection.MemberInfo element, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttribute<T>"> + <MemberSignature Language="C#" Value="public static T GetCustomAttribute<T> (this System.Reflection.ParameterInfo element, bool inherit) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetCustomAttribute<(class System.Attribute) T>(class System.Reflection.ParameterInfo element, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Assembly element);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.Assembly element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Assembly" RefType="this" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.MemberInfo element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Module element);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.Module element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Module" RefType="this" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.ParameterInfo element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Assembly element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.Assembly element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Assembly" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.MemberInfo element, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.MemberInfo element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Module element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.Module element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Module" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.ParameterInfo element, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.ParameterInfo element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, Type attributeType, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.MemberInfo element, class System.Type attributeType, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Attribute> GetCustomAttributes(class System.Reflection.ParameterInfo element, class System.Type attributeType, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Attribute></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes<T>"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.Assembly element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> GetCustomAttributes<(class System.Attribute) T>(class System.Reflection.Assembly element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Assembly" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes<T>"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.MemberInfo element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> GetCustomAttributes<(class System.Attribute) T>(class System.Reflection.MemberInfo element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes<T>"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.Module element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> GetCustomAttributes<(class System.Attribute) T>(class System.Reflection.Module element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Module" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes<T>"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.ParameterInfo element) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> GetCustomAttributes<(class System.Attribute) T>(class System.Reflection.ParameterInfo element) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes<T>"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.MemberInfo element, bool inherit) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> GetCustomAttributes<(class System.Attribute) T>(class System.Reflection.MemberInfo element, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetCustomAttributes<T>"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.ParameterInfo element, bool inherit) where T : Attribute;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<!!T> GetCustomAttributes<(class System.Attribute) T>(class System.Reflection.ParameterInfo element, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <BaseTypeName>System.Attribute</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="element">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDefined"> + <MemberSignature Language="C#" Value="public static bool IsDefined (this System.Reflection.Assembly element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsDefined(class System.Reflection.Assembly element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Assembly" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDefined"> + <MemberSignature Language="C#" Value="public static bool IsDefined (this System.Reflection.MemberInfo element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsDefined(class System.Reflection.MemberInfo element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDefined"> + <MemberSignature Language="C#" Value="public static bool IsDefined (this System.Reflection.Module element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsDefined(class System.Reflection.Module element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.Module" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDefined"> + <MemberSignature Language="C#" Value="public static bool IsDefined (this System.Reflection.ParameterInfo element, Type attributeType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsDefined(class System.Reflection.ParameterInfo element, class System.Type attributeType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDefined"> + <MemberSignature Language="C#" Value="public static bool IsDefined (this System.Reflection.MemberInfo element, Type attributeType, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsDefined(class System.Reflection.MemberInfo element, class System.Type attributeType, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.MemberInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDefined"> + <MemberSignature Language="C#" Value="public static bool IsDefined (this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsDefined(class System.Reflection.ParameterInfo element, class System.Type attributeType, bool inherit) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="element" Type="System.Reflection.ParameterInfo" RefType="this" /> + <Parameter Name="attributeType" Type="System.Type" /> + <Parameter Name="inherit" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="element">To be added.</param> + <param name="attributeType">To be added.</param> + <param name="inherit">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/IReflectableType.xml b/mcs/class/corlib/Documentation/en/System.Reflection/IReflectableType.xml new file mode 100644 index 0000000000..9d0d54a250 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/IReflectableType.xml @@ -0,0 +1,32 @@ +<Type Name="IReflectableType" FullName="System.Reflection.IReflectableType"> + <TypeSignature Language="C#" Value="public interface IReflectableType" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IReflectableType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetTypeInfo"> + <MemberSignature Language="C#" Value="public System.Reflection.TypeInfo GetTypeInfo ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.TypeInfo GetTypeInfo() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.TypeInfo</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/IntrospectionExtensions.xml b/mcs/class/corlib/Documentation/en/System.Reflection/IntrospectionExtensions.xml new file mode 100644 index 0000000000..086213e937 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/IntrospectionExtensions.xml @@ -0,0 +1,38 @@ +<Type Name="IntrospectionExtensions" FullName="System.Reflection.IntrospectionExtensions"> + <TypeSignature Language="C#" Value="public static class IntrospectionExtensions" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit IntrospectionExtensions extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetTypeInfo"> + <MemberSignature Language="C#" Value="public static System.Reflection.TypeInfo GetTypeInfo (this Type type);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.TypeInfo GetTypeInfo(class System.Type type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.TypeInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/ReflectionContext.xml b/mcs/class/corlib/Documentation/en/System.Reflection/ReflectionContext.xml new file mode 100644 index 0000000000..1eb15f39cc --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/ReflectionContext.xml @@ -0,0 +1,91 @@ +<Type Name="ReflectionContext" FullName="System.Reflection.ReflectionContext"> + <TypeSignature Language="C#" Value="public abstract class ReflectionContext" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit ReflectionContext extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="protected ReflectionContext ();" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetTypeForObject"> + <MemberSignature Language="C#" Value="public virtual System.Reflection.TypeInfo GetTypeForObject (object value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.TypeInfo GetTypeForObject(object value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.TypeInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="value" Type="System.Object" /> + </Parameters> + <Docs> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="MapAssembly"> + <MemberSignature Language="C#" Value="public abstract System.Reflection.Assembly MapAssembly (System.Reflection.Assembly assembly);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.Assembly MapAssembly(class System.Reflection.Assembly assembly) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.Assembly</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="assembly" Type="System.Reflection.Assembly" /> + </Parameters> + <Docs> + <param name="assembly">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="MapType"> + <MemberSignature Language="C#" Value="public abstract System.Reflection.TypeInfo MapType (System.Reflection.TypeInfo type);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.TypeInfo MapType(class System.Reflection.TypeInfo type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.TypeInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Reflection.TypeInfo" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/RuntimeReflectionExtensions.xml b/mcs/class/corlib/Documentation/en/System.Reflection/RuntimeReflectionExtensions.xml new file mode 100644 index 0000000000..56c915223a --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/RuntimeReflectionExtensions.xml @@ -0,0 +1,250 @@ +<Type Name="RuntimeReflectionExtensions" FullName="System.Reflection.RuntimeReflectionExtensions"> + <TypeSignature Language="C#" Value="public static class RuntimeReflectionExtensions" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit RuntimeReflectionExtensions extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetMethodInfo"> + <MemberSignature Language="C#" Value="public static System.Reflection.MethodInfo GetMethodInfo (this Delegate del);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.MethodInfo GetMethodInfo(class System.Delegate del) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.MethodInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="del" Type="System.Delegate" RefType="this" /> + </Parameters> + <Docs> + <param name="del">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeBaseDefinition"> + <MemberSignature Language="C#" Value="public static System.Reflection.MethodInfo GetRuntimeBaseDefinition (this System.Reflection.MethodInfo method);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.MethodInfo GetRuntimeBaseDefinition(class System.Reflection.MethodInfo method) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.MethodInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="method" Type="System.Reflection.MethodInfo" RefType="this" /> + </Parameters> + <Docs> + <param name="method">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeEvent"> + <MemberSignature Language="C#" Value="public static System.Reflection.EventInfo GetRuntimeEvent (this Type type, string name);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.EventInfo GetRuntimeEvent(class System.Type type, string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.EventInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeEvents"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<System.Reflection.EventInfo> GetRuntimeEvents (this Type type);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Reflection.EventInfo> GetRuntimeEvents(class System.Type type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.EventInfo></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeField"> + <MemberSignature Language="C#" Value="public static System.Reflection.FieldInfo GetRuntimeField (this Type type, string name);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.FieldInfo GetRuntimeField(class System.Type type, string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.FieldInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeFields"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> GetRuntimeFields (this Type type);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Reflection.FieldInfo> GetRuntimeFields(class System.Type type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeInterfaceMap"> + <MemberSignature Language="C#" Value="public static System.Reflection.InterfaceMapping GetRuntimeInterfaceMap (this System.Reflection.TypeInfo typeInfo, Type interfaceType);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Reflection.InterfaceMapping GetRuntimeInterfaceMap(class System.Reflection.TypeInfo typeInfo, class System.Type interfaceType) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.InterfaceMapping</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="typeInfo" Type="System.Reflection.TypeInfo" RefType="this" /> + <Parameter Name="interfaceType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="typeInfo">To be added.</param> + <param name="interfaceType">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeMethod"> + <MemberSignature Language="C#" Value="public static System.Reflection.MethodInfo GetRuntimeMethod (this Type type, string name, Type[] parameters);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.MethodInfo GetRuntimeMethod(class System.Type type, string name, class System.Type[] parameters) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.MethodInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + <Parameter Name="name" Type="System.String" /> + <Parameter Name="parameters" Type="System.Type[]" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <param name="name">To be added.</param> + <param name="parameters">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeMethods"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> GetRuntimeMethods (this Type type);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Reflection.MethodInfo> GetRuntimeMethods(class System.Type type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeProperties"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> GetRuntimeProperties (this Type type);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<class System.Reflection.PropertyInfo> GetRuntimeProperties(class System.Type type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetRuntimeProperty"> + <MemberSignature Language="C#" Value="public static System.Reflection.PropertyInfo GetRuntimeProperty (this Type type, string name);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Reflection.PropertyInfo GetRuntimeProperty(class System.Type type, string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.PropertyInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" RefType="this" /> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Reflection/TypeInfo.xml b/mcs/class/corlib/Documentation/en/System.Reflection/TypeInfo.xml new file mode 100644 index 0000000000..544492276f --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Reflection/TypeInfo.xml @@ -0,0 +1,340 @@ +<Type Name="TypeInfo" FullName="System.Reflection.TypeInfo"> + <TypeSignature Language="C#" Value="public abstract class TypeInfo : Type, System.Reflection.IReflectableType" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit TypeInfo extends System.Type implements class System.Reflection.IReflectableType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Type</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Reflection.IReflectableType</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="AsType"> + <MemberSignature Language="C#" Value="public virtual Type AsType ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Type AsType() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Type</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredConstructors"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo> DeclaredConstructors { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.ConstructorInfo> DeclaredConstructors" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredEvents"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.EventInfo> DeclaredEvents { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.EventInfo> DeclaredEvents" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.EventInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredFields"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> DeclaredFields { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.FieldInfo> DeclaredFields" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredMembers"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo> DeclaredMembers { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.MemberInfo> DeclaredMembers" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredMethods"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> DeclaredMethods { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.MethodInfo> DeclaredMethods" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredNestedTypes"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> DeclaredNestedTypes { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.TypeInfo> DeclaredNestedTypes" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DeclaredProperties"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> DeclaredProperties { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.PropertyInfo> DeclaredProperties" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GenericTypeParameters"> + <MemberSignature Language="C#" Value="public virtual Type[] GenericTypeParameters { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Type[] GenericTypeParameters" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Type[]</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetDeclaredEvent"> + <MemberSignature Language="C#" Value="public virtual System.Reflection.EventInfo GetDeclaredEvent (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.EventInfo GetDeclaredEvent(string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.EventInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetDeclaredField"> + <MemberSignature Language="C#" Value="public virtual System.Reflection.FieldInfo GetDeclaredField (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.FieldInfo GetDeclaredField(string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.FieldInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetDeclaredMethod"> + <MemberSignature Language="C#" Value="public virtual System.Reflection.MethodInfo GetDeclaredMethod (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.MethodInfo GetDeclaredMethod(string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.MethodInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetDeclaredMethods"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> GetDeclaredMethods (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IEnumerable`1<class System.Reflection.MethodInfo> GetDeclaredMethods(string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetDeclaredNestedType"> + <MemberSignature Language="C#" Value="public virtual System.Reflection.TypeInfo GetDeclaredNestedType (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.TypeInfo GetDeclaredNestedType(string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.TypeInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetDeclaredProperty"> + <MemberSignature Language="C#" Value="public virtual System.Reflection.PropertyInfo GetDeclaredProperty (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Reflection.PropertyInfo GetDeclaredProperty(string name) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.PropertyInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ImplementedInterfaces"> + <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable<Type> ImplementedInterfaces { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1<class System.Type> ImplementedInterfaces" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.Type></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsAssignableFrom"> + <MemberSignature Language="C#" Value="public virtual bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool IsAssignableFrom(class System.Reflection.TypeInfo typeInfo) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="typeInfo" Type="System.Reflection.TypeInfo" /> + </Parameters> + <Docs> + <param name="typeInfo">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Reflection.IReflectableType.GetTypeInfo"> + <MemberSignature Language="C#" Value="System.Reflection.TypeInfo IReflectableType.GetTypeInfo ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Reflection.TypeInfo System.Reflection.IReflectableType.GetTypeInfo() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.TypeInfo</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/IResourceReader.xml b/mcs/class/corlib/Documentation/en/System.Resources/IResourceReader.xml index 5c66441470..70cc31eacc 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/IResourceReader.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/IResourceReader.xml @@ -1,5 +1,6 @@ <Type Name="IResourceReader" FullName="System.Resources.IResourceReader"> <TypeSignature Maintainer="auto" Language="C#" Value="public interface IResourceReader : IDisposable, System.Collections.IEnumerable" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IResourceReader implements class System.Collections.IEnumerable, class System.IDisposable" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -8,6 +9,19 @@ <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement> + <Interfaces> + <Interface> + <InterfaceName>System.Collections.IEnumerable</InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.IDisposable</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -15,7 +29,13 @@ <Members> <Member MemberName="Close"> <MemberSignature Language="C#" Value="public void Close ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -24,15 +44,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetEnumerator"> + <MemberSignature Language="C#" Value="public System.Collections.IDictionaryEnumerator GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.IDictionaryEnumerator GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetEnumerator"> - <MemberSignature Language="C#" Value="public System.Collections.IDictionaryEnumerator GetEnumerator ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Collections.IDictionaryEnumerator</ReturnType> </ReturnValue> @@ -42,24 +63,6 @@ <returns>To be added: an object of type 'Collections.IDictionaryEnumerator'</returns> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> - <Interfaces> - <Interface> - <InterfaceName>System.Collections.IEnumerable</InterfaceName> - </Interface> - <Interface> - <InterfaceName>System.IDisposable</InterfaceName> - </Interface> - </Interfaces> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/IResourceWriter.xml b/mcs/class/corlib/Documentation/en/System.Resources/IResourceWriter.xml index d38cb9ef01..352523d454 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/IResourceWriter.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/IResourceWriter.xml @@ -1,5 +1,6 @@ <Type Name="IResourceWriter" FullName="System.Resources.IResourceWriter"> <TypeSignature Maintainer="auto" Language="C#" Value="public interface IResourceWriter : IDisposable" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IResourceWriter implements class System.IDisposable" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -8,6 +9,16 @@ <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement> + <Interfaces> + <Interface> + <InterfaceName>System.IDisposable</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -15,7 +26,13 @@ <Members> <Member MemberName="AddResource"> <MemberSignature Language="C#" Value="public void AddResource (string name, byte[] value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddResource(string name, unsigned int8[] value) cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -29,15 +46,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="AddResource"> + <MemberSignature Language="C#" Value="public void AddResource (string name, object value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddResource(string name, object value) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="AddResource"> - <MemberSignature Language="C#" Value="public void AddResource (string name, object value);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -51,15 +69,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="AddResource"> + <MemberSignature Language="C#" Value="public void AddResource (string name, string value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddResource(string name, string value) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="AddResource"> - <MemberSignature Language="C#" Value="public void AddResource (string name, string value);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -73,15 +92,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Close"> + <MemberSignature Language="C#" Value="public void Close ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Close"> - <MemberSignature Language="C#" Value="public void Close ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -90,15 +110,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Generate"> + <MemberSignature Language="C#" Value="public void Generate ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Generate() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Generate"> - <MemberSignature Language="C#" Value="public void Generate ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -107,21 +128,6 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> - <Interfaces> - <Interface> - <InterfaceName>System.IDisposable</InterfaceName> - </Interface> - </Interfaces> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/MissingManifestResourceException.xml b/mcs/class/corlib/Documentation/en/System.Resources/MissingManifestResourceException.xml index 9fd233ac49..62d475cda9 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/MissingManifestResourceException.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/MissingManifestResourceException.xml @@ -1,5 +1,6 @@ <Type Name="MissingManifestResourceException" FullName="System.Resources.MissingManifestResourceException"> <TypeSignature Maintainer="auto" Language="C#" Value="public class MissingManifestResourceException : SystemException" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit MissingManifestResourceException extends System.SystemException" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -13,6 +14,11 @@ </Base> <Interfaces> </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -20,22 +26,29 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public MissingManifestResourceException ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters /> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public MissingManifestResourceException (string message);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public MissingManifestResourceException (string message);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="message" Type="System.String" /> @@ -45,15 +58,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="protected MissingManifestResourceException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="protected MissingManifestResourceException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> @@ -65,15 +79,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public MissingManifestResourceException (string message, Exception inner);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception inner) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public MissingManifestResourceException (string message, Exception inner);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="message" Type="System.String" /> @@ -85,16 +100,6 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/MissingSatelliteAssemblyException.xml b/mcs/class/corlib/Documentation/en/System.Resources/MissingSatelliteAssemblyException.xml index a1c6e2e254..4ccea6a8f9 100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/MissingSatelliteAssemblyException.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/MissingSatelliteAssemblyException.xml @@ -1,5 +1,6 @@ <Type Name="MissingSatelliteAssemblyException" FullName="System.Resources.MissingSatelliteAssemblyException"> <TypeSignature Language="C#" Value="public class MissingSatelliteAssemblyException : SystemException" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit MissingSatelliteAssemblyException extends System.SystemException" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyVersions> @@ -25,27 +26,30 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public MissingSatelliteAssemblyException ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberType>Constructor</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <Parameters /> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public MissingSatelliteAssemblyException (string message);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" /> <MemberType>Constructor</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <Parameters> <Parameter Name="message" Type="System.String" /> </Parameters> @@ -55,17 +59,18 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="protected MissingSatelliteAssemblyException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> <MemberType>Constructor</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <Parameters> <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> @@ -77,17 +82,18 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public MissingSatelliteAssemblyException (string message, Exception inner);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception inner) cil managed" /> <MemberType>Constructor</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <Parameters> <Parameter Name="message" Type="System.String" /> <Parameter Name="inner" Type="System.Exception" /> @@ -99,17 +105,18 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public MissingSatelliteAssemblyException (string message, string cultureName);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, string cultureName) cil managed" /> <MemberType>Constructor</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <Parameters> <Parameter Name="message" Type="System.String" /> <Parameter Name="cultureName" Type="System.String" /> @@ -121,17 +128,18 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> <Member MemberName="CultureName"> <MemberSignature Language="C#" Value="public string CultureName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string CultureName" /> <MemberType>Property</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -141,10 +149,9 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> </Members> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/NeutralResourcesLanguageAttribute.xml b/mcs/class/corlib/Documentation/en/System.Resources/NeutralResourcesLanguageAttribute.xml index 50c193eab1..4e6d859e16 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/NeutralResourcesLanguageAttribute.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/NeutralResourcesLanguageAttribute.xml @@ -1,5 +1,6 @@ <Type Name="NeutralResourcesLanguageAttribute" FullName="System.Resources.NeutralResourcesLanguageAttribute"> <TypeSignature Maintainer="auto" Language="C#" Value="public sealed class NeutralResourcesLanguageAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit NeutralResourcesLanguageAttribute extends System.Attribute" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -27,7 +28,13 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public NeutralResourcesLanguageAttribute (string cultureName);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string cultureName) cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters> <Parameter Name="cultureName" Type="System.String" /> @@ -37,15 +44,15 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public NeutralResourcesLanguageAttribute (string cultureName, System.Resources.UltimateResourceFallbackLocation location);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string cultureName, valuetype System.Resources.UltimateResourceFallbackLocation location) cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <Parameters> <Parameter Name="cultureName" Type="System.String" /> <Parameter Name="location" Type="System.Resources.UltimateResourceFallbackLocation" /> @@ -57,14 +64,16 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="CultureName"> <MemberSignature Language="C#" Value="public string CultureName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string CultureName" /> <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -73,15 +82,15 @@ <value>To be added: an object of type 'string'</value> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="Location"> <MemberSignature Language="C#" Value="public System.Resources.UltimateResourceFallbackLocation Location { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Resources.UltimateResourceFallbackLocation Location" /> <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Resources.UltimateResourceFallbackLocation</ReturnType> </ReturnValue> @@ -91,10 +100,6 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/ResourceManager.xml b/mcs/class/corlib/Documentation/en/System.Resources/ResourceManager.xml index 23a789ff83..33a5dd36f5 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/ResourceManager.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/ResourceManager.xml @@ -1,5 +1,6 @@ <Type Name="ResourceManager" FullName="System.Resources.ResourceManager"> <TypeSignature Maintainer="auto" Language="C#" Value="public class ResourceManager" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit ResourceManager extends System.Object" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -12,6 +13,11 @@ <BaseTypeName>System.Object</BaseTypeName> </Base> <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -19,22 +25,29 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="protected ResourceManager ();" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters /> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceManager (Type resourceSource);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type resourceSource) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceManager (Type resourceSource);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="resourceSource" Type="System.Type" /> @@ -44,15 +57,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceManager (string baseName, System.Reflection.Assembly assembly);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string baseName, class System.Reflection.Assembly assembly) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceManager (string baseName, System.Reflection.Assembly assembly);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="baseName" Type="System.String" /> @@ -64,15 +78,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceManager (string baseName, System.Reflection.Assembly assembly, Type usingResourceSet);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string baseName, class System.Reflection.Assembly assembly, class System.Type usingResourceSet) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceManager (string baseName, System.Reflection.Assembly assembly, Type usingResourceSet);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="baseName" Type="System.String" /> @@ -86,15 +101,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="BaseName"> + <MemberSignature Language="C#" Value="public virtual string BaseName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string BaseName" /> + <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="BaseName"> - <MemberSignature Language="C#" Value="public virtual string BaseName { get; }" /> - <MemberType>Property</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -103,15 +119,16 @@ <value>To be added: an object of type 'string'</value> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="BaseNameField"> + <MemberSignature Language="C#" Value="protected string BaseNameField;" /> + <MemberSignature Language="ILAsm" Value=".field family string BaseNameField" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="BaseNameField"> - <MemberSignature Language="C#" Value="protected string BaseNameField;" /> - <MemberType>Field</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -120,15 +137,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="CreateFileBasedResourceManager"> + <MemberSignature Language="C#" Value="public static System.Resources.ResourceManager CreateFileBasedResourceManager (string baseName, string resourceDir, Type usingResourceSet);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Resources.ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, class System.Type usingResourceSet) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="CreateFileBasedResourceManager"> - <MemberSignature Language="C#" Value="public static System.Resources.ResourceManager CreateFileBasedResourceManager (string baseName, string resourceDir, Type usingResourceSet);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Resources.ResourceManager</ReturnType> </ReturnValue> @@ -145,15 +163,15 @@ <returns>To be added: an object of type 'ResourceManager'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="FallbackLocation"> + <MemberSignature Language="C#" Value="protected System.Resources.UltimateResourceFallbackLocation FallbackLocation { get; set; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Resources.UltimateResourceFallbackLocation FallbackLocation" /> + <MemberType>Property</MemberType> <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="FallbackLocation"> - <MemberSignature Language="C#" Value="protected System.Resources.UltimateResourceFallbackLocation FallbackLocation { set; get; }" /> - <MemberType>Property</MemberType> <ReturnValue> <ReturnType>System.Resources.UltimateResourceFallbackLocation</ReturnType> </ReturnValue> @@ -163,14 +181,16 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="GetNeutralResourcesLanguage"> <MemberSignature Language="C#" Value="protected static System.Globalization.CultureInfo GetNeutralResourcesLanguage (System.Reflection.Assembly a);" /> + <MemberSignature Language="ILAsm" Value=".method familystatic hidebysig class System.Globalization.CultureInfo GetNeutralResourcesLanguage(class System.Reflection.Assembly a) cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Globalization.CultureInfo</ReturnType> </ReturnValue> @@ -183,15 +203,16 @@ <returns>To be added: an object of type 'Globalization.CultureInfo'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetObject"> + <MemberSignature Language="C#" Value="public virtual object GetObject (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object GetObject(string name) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetObject"> - <MemberSignature Language="C#" Value="public virtual object GetObject (string name);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Object</ReturnType> </ReturnValue> @@ -204,15 +225,16 @@ <returns>To be added: an object of type 'object'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetObject"> + <MemberSignature Language="C#" Value="public virtual object GetObject (string name, System.Globalization.CultureInfo culture);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object GetObject(string name, class System.Globalization.CultureInfo culture) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetObject"> - <MemberSignature Language="C#" Value="public virtual object GetObject (string name, System.Globalization.CultureInfo culture);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Object</ReturnType> </ReturnValue> @@ -227,15 +249,16 @@ <returns>To be added: an object of type 'object'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetResourceFileName"> + <MemberSignature Language="C#" Value="protected virtual string GetResourceFileName (System.Globalization.CultureInfo culture);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance string GetResourceFileName(class System.Globalization.CultureInfo culture) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetResourceFileName"> - <MemberSignature Language="C#" Value="protected virtual string GetResourceFileName (System.Globalization.CultureInfo culture);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -248,15 +271,16 @@ <returns>To be added: an object of type 'string'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetResourceSet"> + <MemberSignature Language="C#" Value="public virtual System.Resources.ResourceSet GetResourceSet (System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Resources.ResourceSet GetResourceSet(class System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetResourceSet"> - <MemberSignature Language="C#" Value="public virtual System.Resources.ResourceSet GetResourceSet (System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Resources.ResourceSet</ReturnType> </ReturnValue> @@ -273,15 +297,16 @@ <returns>To be added: an object of type 'ResourceSet'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetSatelliteContractVersion"> + <MemberSignature Language="C#" Value="protected static Version GetSatelliteContractVersion (System.Reflection.Assembly a);" /> + <MemberSignature Language="ILAsm" Value=".method familystatic hidebysig class System.Version GetSatelliteContractVersion(class System.Reflection.Assembly a) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetSatelliteContractVersion"> - <MemberSignature Language="C#" Value="protected static Version GetSatelliteContractVersion (System.Reflection.Assembly a);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Version</ReturnType> </ReturnValue> @@ -294,15 +319,20 @@ <returns>To be added: an object of type 'Version'</returns> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="GetStream"> <MemberSignature Language="C#" Value="public System.IO.UnmanagedMemoryStream GetStream (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.UnmanagedMemoryStream GetStream(string name) cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> + </Attribute> + </Attributes> <ReturnValue> <ReturnType>System.IO.UnmanagedMemoryStream</ReturnType> </ReturnValue> @@ -316,22 +346,20 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> + </Member> + <Member MemberName="GetStream"> + <MemberSignature Language="C#" Value="public System.IO.UnmanagedMemoryStream GetStream (string name, System.Globalization.CultureInfo culture);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.UnmanagedMemoryStream GetStream(string name, class System.Globalization.CultureInfo culture) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <Attributes> <Attribute> - <AttributeName>System.CLSCompliant(false)</AttributeName> - </Attribute> - <Attribute> <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> </Attribute> </Attributes> - </Member> - <Member MemberName="GetStream"> - <MemberSignature Language="C#" Value="public System.IO.UnmanagedMemoryStream GetStream (string name, System.Globalization.CultureInfo culture);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.IO.UnmanagedMemoryStream</ReturnType> </ReturnValue> @@ -347,22 +375,16 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> - <Attributes> - <Attribute> - <AttributeName>System.CLSCompliant(false)</AttributeName> - </Attribute> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> - </Attribute> - </Attributes> </Member> <Member MemberName="GetString"> <MemberSignature Language="C#" Value="public virtual string GetString (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetString(string name) cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -375,15 +397,16 @@ <returns>To be added: an object of type 'string'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetString"> + <MemberSignature Language="C#" Value="public virtual string GetString (string name, System.Globalization.CultureInfo culture);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetString(string name, class System.Globalization.CultureInfo culture) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetString"> - <MemberSignature Language="C#" Value="public virtual string GetString (string name, System.Globalization.CultureInfo culture);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -398,33 +421,35 @@ <returns>To be added: an object of type 'string'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="HeaderVersionNumber"> + <MemberSignature Language="C#" Value="public static readonly int HeaderVersionNumber;" /> + <MemberSignature Language="ILAsm" Value=".field public static initonly int32 HeaderVersionNumber" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="HeaderVersionNumber"> - <MemberSignature Language="C#" Value="public static readonly int HeaderVersionNumber;" /> - <MemberType>Field</MemberType> <ReturnValue> <ReturnType>System.Int32</ReturnType> </ReturnValue> <Parameters /> + <MemberValue>1</MemberValue> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> </Docs> - <MemberValue>1</MemberValue> + </Member> + <Member MemberName="IgnoreCase"> + <MemberSignature Language="C#" Value="public virtual bool IgnoreCase { get; set; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IgnoreCase" /> + <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="IgnoreCase"> - <MemberSignature Language="C#" Value="public virtual bool IgnoreCase { set; get; }" /> - <MemberType>Property</MemberType> <ReturnValue> <ReturnType>System.Boolean</ReturnType> </ReturnValue> @@ -435,15 +460,16 @@ <value>To be added: an object of type 'bool'</value> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="InternalGetResourceSet"> + <MemberSignature Language="C#" Value="protected virtual System.Resources.ResourceSet InternalGetResourceSet (System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Resources.ResourceSet InternalGetResourceSet(class System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="InternalGetResourceSet"> - <MemberSignature Language="C#" Value="protected virtual System.Resources.ResourceSet InternalGetResourceSet (System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Resources.ResourceSet</ReturnType> </ReturnValue> @@ -460,33 +486,35 @@ <returns>To be added: an object of type 'ResourceSet'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="MagicNumber"> + <MemberSignature Language="C#" Value="public static readonly int MagicNumber;" /> + <MemberSignature Language="ILAsm" Value=".field public static initonly int32 MagicNumber" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="MagicNumber"> - <MemberSignature Language="C#" Value="public static readonly int MagicNumber;" /> - <MemberType>Field</MemberType> <ReturnValue> <ReturnType>System.Int32</ReturnType> </ReturnValue> <Parameters /> + <MemberValue>-1091581234</MemberValue> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> </Docs> - <MemberValue>-1091581234</MemberValue> + </Member> + <Member MemberName="MainAssembly"> + <MemberSignature Language="C#" Value="protected System.Reflection.Assembly MainAssembly;" /> + <MemberSignature Language="ILAsm" Value=".field family class System.Reflection.Assembly MainAssembly" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="MainAssembly"> - <MemberSignature Language="C#" Value="protected System.Reflection.Assembly MainAssembly;" /> - <MemberType>Field</MemberType> <ReturnValue> <ReturnType>System.Reflection.Assembly</ReturnType> </ReturnValue> @@ -495,15 +523,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="ReleaseAllResources"> + <MemberSignature Language="C#" Value="public virtual void ReleaseAllResources ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void ReleaseAllResources() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="ReleaseAllResources"> - <MemberSignature Language="C#" Value="public virtual void ReleaseAllResources ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -512,15 +541,21 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="ResourceSets"> + <MemberSignature Language="C#" Value="protected System.Collections.Hashtable ResourceSets;" /> + <MemberSignature Language="ILAsm" Value=".field family class System.Collections.Hashtable ResourceSets" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="ResourceSets"> - <MemberSignature Language="C#" Value="protected System.Collections.Hashtable ResourceSets;" /> - <MemberType>Field</MemberType> + <Attributes> + <Attribute> + <AttributeName>System.Obsolete("Use InternalGetResourceSet instead.")</AttributeName> + </Attribute> + </Attributes> <ReturnValue> <ReturnType>System.Collections.Hashtable</ReturnType> </ReturnValue> @@ -529,15 +564,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="ResourceSetType"> + <MemberSignature Language="C#" Value="public virtual Type ResourceSetType { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Type ResourceSetType" /> + <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="ResourceSetType"> - <MemberSignature Language="C#" Value="public virtual Type ResourceSetType { get; }" /> - <MemberType>Property</MemberType> <ReturnValue> <ReturnType>System.Type</ReturnType> </ReturnValue> @@ -546,16 +582,6 @@ <value>To be added: an object of type 'Type'</value> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/ResourceReader.xml b/mcs/class/corlib/Documentation/en/System.Resources/ResourceReader.xml index 7770f7e8a8..02301a773e 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/ResourceReader.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/ResourceReader.xml @@ -1,5 +1,6 @@ <Type Name="ResourceReader" FullName="System.Resources.ResourceReader"> <TypeSignature Maintainer="auto" Language="C#" Value="public sealed class ResourceReader : System.Resources.IResourceReader" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ResourceReader extends System.Object implements class System.Collections.IEnumerable, class System.IDisposable, class System.Resources.IResourceReader" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -16,6 +17,11 @@ <InterfaceName>System.Resources.IResourceReader</InterfaceName> </Interface> </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -23,7 +29,13 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public ResourceReader (System.IO.Stream stream);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.IO.Stream stream) cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters> <Parameter Name="stream" Type="System.IO.Stream" /> @@ -33,15 +45,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceReader (string fileName);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceReader (string fileName);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="fileName" Type="System.String" /> @@ -51,15 +64,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Close"> + <MemberSignature Language="C#" Value="public void Close ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Close"> - <MemberSignature Language="C#" Value="public void Close ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -68,15 +82,32 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Dispose"> + <MemberSignature Language="C#" Value="public void Dispose ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> </Member> <Member MemberName="GetEnumerator"> <MemberSignature Language="C#" Value="public System.Collections.IDictionaryEnumerator GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.IDictionaryEnumerator GetEnumerator() cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Collections.IDictionaryEnumerator</ReturnType> </ReturnValue> @@ -86,14 +117,10 @@ <returns>To be added: an object of type 'Collections.IDictionaryEnumerator'</returns> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="GetResourceData"> <MemberSignature Language="C#" Value="public void GetResourceData (string resourceName, out string resourceType, out byte[] resourceData);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void GetResourceData(string resourceName, string resourceType, unsigned int8[] resourceData) cil managed" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> @@ -117,7 +144,13 @@ </Member> <Member MemberName="System.Collections.IEnumerable.GetEnumerator"> <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Collections.IEnumerator</ReturnType> </ReturnValue> @@ -127,11 +160,6 @@ <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="System.IDisposable.Dispose"> <MemberSignature Language="C#" Value="void IDisposable.Dispose ();" /> @@ -147,13 +175,7 @@ <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> </Member> </Members> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/ResourceSet.xml b/mcs/class/corlib/Documentation/en/System.Resources/ResourceSet.xml index 237f1fc08f..3369e593d8 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/ResourceSet.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/ResourceSet.xml @@ -1,5 +1,6 @@ <Type Name="ResourceSet" FullName="System.Resources.ResourceSet"> <TypeSignature Maintainer="auto" Language="C#" Value="public class ResourceSet : IDisposable, System.Collections.IEnumerable" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit ResourceSet extends System.Object implements class System.Collections.IEnumerable, class System.IDisposable" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -19,6 +20,11 @@ <InterfaceName>System.IDisposable</InterfaceName> </Interface> </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -26,22 +32,29 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="protected ResourceSet ();" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters /> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceSet (System.IO.Stream stream);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.IO.Stream stream) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceSet (System.IO.Stream stream);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="stream" Type="System.IO.Stream" /> @@ -51,15 +64,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceSet (System.Resources.IResourceReader reader);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Resources.IResourceReader reader) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceSet (System.Resources.IResourceReader reader);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="reader" Type="System.Resources.IResourceReader" /> @@ -69,15 +83,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceSet (string fileName);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceSet (string fileName);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="fileName" Type="System.String" /> @@ -87,15 +102,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Close"> + <MemberSignature Language="C#" Value="public virtual void Close ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Close"> - <MemberSignature Language="C#" Value="public virtual void Close ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -104,15 +120,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Dispose"> + <MemberSignature Language="C#" Value="public void Dispose ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Dispose"> - <MemberSignature Language="C#" Value="public void Dispose ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -121,15 +138,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Dispose"> + <MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Dispose"> - <MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -141,15 +159,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetDefaultReader"> + <MemberSignature Language="C#" Value="public virtual Type GetDefaultReader ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Type GetDefaultReader() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetDefaultReader"> - <MemberSignature Language="C#" Value="public virtual Type GetDefaultReader ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Type</ReturnType> </ReturnValue> @@ -159,15 +178,16 @@ <returns>To be added: an object of type 'Type'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetDefaultWriter"> + <MemberSignature Language="C#" Value="public virtual Type GetDefaultWriter ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Type GetDefaultWriter() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetDefaultWriter"> - <MemberSignature Language="C#" Value="public virtual Type GetDefaultWriter ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Type</ReturnType> </ReturnValue> @@ -177,15 +197,21 @@ <returns>To be added: an object of type 'Type'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetEnumerator"> + <MemberSignature Language="C#" Value="public virtual System.Collections.IDictionaryEnumerator GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.IDictionaryEnumerator GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetEnumerator"> - <MemberSignature Language="C#" Value="public virtual System.Collections.IDictionaryEnumerator GetEnumerator ();" /> - <MemberType>Method</MemberType> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> + </Attribute> + </Attributes> <ReturnValue> <ReturnType>System.Collections.IDictionaryEnumerator</ReturnType> </ReturnValue> @@ -195,20 +221,16 @@ <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> + </Member> + <Member MemberName="GetObject"> + <MemberSignature Language="C#" Value="public virtual object GetObject (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object GetObject(string name) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> - </Attribute> - </Attributes> - </Member> - <Member MemberName="GetObject"> - <MemberSignature Language="C#" Value="public virtual object GetObject (string name);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Object</ReturnType> </ReturnValue> @@ -221,15 +243,16 @@ <returns>To be added: an object of type 'object'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetObject"> + <MemberSignature Language="C#" Value="public virtual object GetObject (string name, bool ignoreCase);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object GetObject(string name, bool ignoreCase) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetObject"> - <MemberSignature Language="C#" Value="public virtual object GetObject (string name, bool ignoreCase);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Object</ReturnType> </ReturnValue> @@ -244,15 +267,16 @@ <returns>To be added: an object of type 'object'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetString"> + <MemberSignature Language="C#" Value="public virtual string GetString (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetString(string name) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetString"> - <MemberSignature Language="C#" Value="public virtual string GetString (string name);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -265,15 +289,16 @@ <returns>To be added: an object of type 'string'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="GetString"> + <MemberSignature Language="C#" Value="public virtual string GetString (string name, bool ignoreCase);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetString(string name, bool ignoreCase) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="GetString"> - <MemberSignature Language="C#" Value="public virtual string GetString (string name, bool ignoreCase);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -288,15 +313,16 @@ <returns>To be added: an object of type 'string'</returns> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Reader"> + <MemberSignature Language="C#" Value="protected System.Resources.IResourceReader Reader;" /> + <MemberSignature Language="ILAsm" Value=".field family class System.Resources.IResourceReader Reader" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Reader"> - <MemberSignature Language="C#" Value="protected System.Resources.IResourceReader Reader;" /> - <MemberType>Field</MemberType> <ReturnValue> <ReturnType>System.Resources.IResourceReader</ReturnType> </ReturnValue> @@ -305,15 +331,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="ReadResources"> + <MemberSignature Language="C#" Value="protected virtual void ReadResources ();" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void ReadResources() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="ReadResources"> - <MemberSignature Language="C#" Value="protected virtual void ReadResources ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -322,15 +349,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="System.Collections.IEnumerable.GetEnumerator"> + <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="System.Collections.IEnumerable.GetEnumerator"> - <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Collections.IEnumerator</ReturnType> </ReturnValue> @@ -340,15 +368,16 @@ <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> + </Member> + <Member MemberName="Table"> + <MemberSignature Language="C#" Value="protected System.Collections.Hashtable Table;" /> + <MemberSignature Language="ILAsm" Value=".field family class System.Collections.Hashtable Table" /> + <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Table"> - <MemberSignature Language="C#" Value="protected System.Collections.Hashtable Table;" /> - <MemberType>Field</MemberType> <ReturnValue> <ReturnType>System.Collections.Hashtable</ReturnType> </ReturnValue> @@ -357,16 +386,6 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/ResourceWriter.xml b/mcs/class/corlib/Documentation/en/System.Resources/ResourceWriter.xml index 8eed6453ae..d1f409f479 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/ResourceWriter.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/ResourceWriter.xml @@ -1,5 +1,6 @@ <Type Name="ResourceWriter" FullName="System.Resources.ResourceWriter"> <TypeSignature Maintainer="auto" Language="C#" Value="public sealed class ResourceWriter : System.Resources.IResourceWriter" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ResourceWriter extends System.Object implements class System.IDisposable, class System.Resources.IResourceWriter" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -16,6 +17,11 @@ <InterfaceName>System.Resources.IResourceWriter</InterfaceName> </Interface> </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> + </Attribute> + </Attributes> <Docs> <summary>To be added</summary> <remarks>To be added</remarks> @@ -23,7 +29,13 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public ResourceWriter (System.IO.Stream stream);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.IO.Stream stream) cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters> <Parameter Name="stream" Type="System.IO.Stream" /> @@ -33,15 +45,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ResourceWriter (string fileName);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName) cil managed" /> + <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName=".ctor"> - <MemberSignature Language="C#" Value="public ResourceWriter (string fileName);" /> - <MemberType>Constructor</MemberType> <ReturnValue /> <Parameters> <Parameter Name="fileName" Type="System.String" /> @@ -51,15 +64,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="AddResource"> + <MemberSignature Language="C#" Value="public void AddResource (string name, byte[] value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddResource(string name, unsigned int8[] value) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="AddResource"> - <MemberSignature Language="C#" Value="public void AddResource (string name, byte[] value);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -73,15 +87,37 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="AddResource"> + <MemberSignature Language="C#" Value="public void AddResource (string name, System.IO.Stream value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddResource(string name, class System.IO.Stream value) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + <Parameter Name="value" Type="System.IO.Stream" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> </Member> <Member MemberName="AddResource"> <MemberSignature Language="C#" Value="public void AddResource (string name, object value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddResource(string name, object value) cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -95,15 +131,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="AddResource"> + <MemberSignature Language="C#" Value="public void AddResource (string name, string value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddResource(string name, string value) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="AddResource"> - <MemberSignature Language="C#" Value="public void AddResource (string name, string value);" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -117,15 +154,38 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="AddResource"> + <MemberSignature Language="C#" Value="public void AddResource (string name, System.IO.Stream value, bool closeAfterWrite);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddResource(string name, class System.IO.Stream value, bool closeAfterWrite) cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="name" Type="System.String" /> + <Parameter Name="value" Type="System.IO.Stream" /> + <Parameter Name="closeAfterWrite" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <param name="value">To be added.</param> + <param name="closeAfterWrite">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> </Member> <Member MemberName="AddResourceData"> <MemberSignature Language="C#" Value="public void AddResourceData (string name, string typeName, byte[] serializedData);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddResourceData(string name, string typeName, unsigned int8[] serializedData) cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -142,14 +202,16 @@ <remarks>To be added.</remarks> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> <Member MemberName="Close"> <MemberSignature Language="C#" Value="public void Close ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" /> <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -158,15 +220,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Dispose"> + <MemberSignature Language="C#" Value="public void Dispose ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Dispose"> - <MemberSignature Language="C#" Value="public void Dispose ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -175,15 +238,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Generate"> + <MemberSignature Language="C#" Value="public void Generate ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Generate() cil managed" /> + <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Generate"> - <MemberSignature Language="C#" Value="public void Generate ();" /> - <MemberType>Method</MemberType> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> @@ -192,16 +256,22 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="TypeNameConverter"> + <MemberSignature Language="C#" Value="public Func<Type,string> TypeNameConverter { get; set; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Func`2<class System.Type, string> TypeNameConverter" /> + <MemberType>Property</MemberType> <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Func<System.Type,System.String></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> </Member> </Members> - <Attributes> - <Attribute> - <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName> - </Attribute> - </Attributes> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/SatelliteContractVersionAttribute.xml b/mcs/class/corlib/Documentation/en/System.Resources/SatelliteContractVersionAttribute.xml index 2e215118a4..0d4d7ff664 100755..100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/SatelliteContractVersionAttribute.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/SatelliteContractVersionAttribute.xml @@ -1,5 +1,6 @@ <Type Name="SatelliteContractVersionAttribute" FullName="System.Resources.SatelliteContractVersionAttribute"> <TypeSignature Maintainer="auto" Language="C#" Value="public sealed class SatelliteContractVersionAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit SatelliteContractVersionAttribute extends System.Attribute" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey> @@ -27,7 +28,13 @@ <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public SatelliteContractVersionAttribute (string version);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string version) cil managed" /> <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>1.0.5000.0</AssemblyVersion> + <AssemblyVersion>2.0.0.0</AssemblyVersion> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue /> <Parameters> <Parameter Name="version" Type="System.String" /> @@ -37,15 +44,16 @@ <summary>To be added</summary> <remarks>To be added</remarks> </Docs> + </Member> + <Member MemberName="Version"> + <MemberSignature Language="C#" Value="public string Version { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Version" /> + <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.5000.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> - </Member> - <Member MemberName="Version"> - <MemberSignature Language="C#" Value="public string Version { get; }" /> - <MemberType>Property</MemberType> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> @@ -54,11 +62,6 @@ <value>To be added: an object of type 'string'</value> <remarks>To be added</remarks> </Docs> - <AssemblyInfo> - <AssemblyVersion>1.0.5000.0</AssemblyVersion> - <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> </Member> </Members> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Resources/UltimateResourceFallbackLocation.xml b/mcs/class/corlib/Documentation/en/System.Resources/UltimateResourceFallbackLocation.xml index f736538262..6331921f7a 100644 --- a/mcs/class/corlib/Documentation/en/System.Resources/UltimateResourceFallbackLocation.xml +++ b/mcs/class/corlib/Documentation/en/System.Resources/UltimateResourceFallbackLocation.xml @@ -1,5 +1,6 @@ <Type Name="UltimateResourceFallbackLocation" FullName="System.Resources.UltimateResourceFallbackLocation"> <TypeSignature Language="C#" Value="public enum UltimateResourceFallbackLocation" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed UltimateResourceFallbackLocation extends System.Enum" /> <AssemblyInfo> <AssemblyName>mscorlib</AssemblyName> <AssemblyVersions> @@ -24,10 +25,12 @@ <Members> <Member MemberName="MainAssembly"> <MemberSignature Language="C#" Value="MainAssembly" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Resources.UltimateResourceFallbackLocation MainAssembly = int32(0)" /> <MemberType>Field</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Resources.UltimateResourceFallbackLocation</ReturnType> </ReturnValue> @@ -35,17 +38,18 @@ <summary>To be added.</summary> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> <Member MemberName="Satellite"> <MemberSignature Language="C#" Value="Satellite" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Resources.UltimateResourceFallbackLocation Satellite = int32(1)" /> <MemberType>Field</MemberType> - <AssemblyVersions> + <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> - </AssemblyVersions> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> <ReturnValue> <ReturnType>System.Resources.UltimateResourceFallbackLocation</ReturnType> </ReturnValue> @@ -53,10 +57,9 @@ <summary>To be added.</summary> <since version=".NET 2.0" /> </Docs> - <AssemblyInfo> + <AssemblyVersions> <AssemblyVersion>2.0.0.0</AssemblyVersion> - <AssemblyVersion>4.0.0.0</AssemblyVersion> - </AssemblyInfo> + </AssemblyVersions> </Member> </Members> </Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncStateMachineAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncStateMachineAttribute.xml new file mode 100644 index 0000000000..b376842151 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncStateMachineAttribute.xml @@ -0,0 +1,39 @@ +<Type Name="AsyncStateMachineAttribute" FullName="System.Runtime.CompilerServices.AsyncStateMachineAttribute"> + <TypeSignature Language="C#" Value="public sealed class AsyncStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit AsyncStateMachineAttribute extends System.Runtime.CompilerServices.StateMachineAttribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Runtime.CompilerServices.StateMachineAttribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AsyncStateMachineAttribute (Type stateMachineType);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type stateMachineType) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="stateMachineType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="stateMachineType">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.xml new file mode 100644 index 0000000000..247f1ef315 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.xml @@ -0,0 +1,202 @@ +<Type Name="AsyncTaskMethodBuilder" FullName="System.Runtime.CompilerServices.AsyncTaskMethodBuilder"> + <TypeSignature Language="C#" Value="public struct AsyncTaskMethodBuilder" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit AsyncTaskMethodBuilder extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="AwaitOnCompleted<TAwaiter,TStateMachine>"> + <MemberSignature Language="C#" Value="public void AwaitOnCompleted<TAwaiter,TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AwaitOnCompleted<(class System.Runtime.CompilerServices.INotifyCompletion) TAwaiter, (class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TAwaiter awaiter, !!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TAwaiter"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.INotifyCompletion</InterfaceName> + </Constraints> + </TypeParameter> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="awaiter" Type="TAwaiter&" RefType="ref" /> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TAwaiter">To be added.</typeparam> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="awaiter">To be added.</param> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>"> + <MemberSignature Language="C#" Value="public void AwaitUnsafeOnCompleted<TAwaiter,TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AwaitUnsafeOnCompleted<(class System.Runtime.CompilerServices.ICriticalNotifyCompletion) TAwaiter, (class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TAwaiter awaiter, !!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TAwaiter"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Constraints> + </TypeParameter> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="awaiter" Type="TAwaiter&" RefType="ref" /> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TAwaiter">To be added.</typeparam> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="awaiter">To be added.</param> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Create"> + <MemberSignature Language="C#" Value="public static System.Runtime.CompilerServices.AsyncTaskMethodBuilder Create ();" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Runtime.CompilerServices.AsyncTaskMethodBuilder Create() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.CompilerServices.AsyncTaskMethodBuilder</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetException"> + <MemberSignature Language="C#" Value="public void SetException (Exception exception);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Exception exception) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="exception" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="exception">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetResult"> + <MemberSignature Language="C#" Value="public void SetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetStateMachine"> + <MemberSignature Language="C#" Value="public void SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetStateMachine(class System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="stateMachine" Type="System.Runtime.CompilerServices.IAsyncStateMachine" /> + </Parameters> + <Docs> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Start<TStateMachine>"> + <MemberSignature Language="C#" Value="public void Start<TStateMachine> (ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Start<(class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Task"> + <MemberSignature Language="C#" Value="public System.Threading.Tasks.Task Task { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.Task Task" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Threading.Tasks.Task</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncTaskMethodBuilder`1.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncTaskMethodBuilder`1.xml new file mode 100644 index 0000000000..c4b9641430 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncTaskMethodBuilder`1.xml @@ -0,0 +1,209 @@ +<Type Name="AsyncTaskMethodBuilder<TResult>" FullName="System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>"> + <TypeSignature Language="C#" Value="public struct AsyncTaskMethodBuilder<TResult>" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit AsyncTaskMethodBuilder`1<TResult> extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TResult" /> + </TypeParameters> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <typeparam name="TResult">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="AwaitOnCompleted<TAwaiter,TStateMachine>"> + <MemberSignature Language="C#" Value="public void AwaitOnCompleted<TAwaiter,TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AwaitOnCompleted<(class System.Runtime.CompilerServices.INotifyCompletion) TAwaiter, (class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TAwaiter awaiter, !!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TAwaiter"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.INotifyCompletion</InterfaceName> + </Constraints> + </TypeParameter> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="awaiter" Type="TAwaiter&" RefType="ref" /> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TAwaiter">To be added.</typeparam> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="awaiter">To be added.</param> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>"> + <MemberSignature Language="C#" Value="public void AwaitUnsafeOnCompleted<TAwaiter,TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AwaitUnsafeOnCompleted<(class System.Runtime.CompilerServices.ICriticalNotifyCompletion) TAwaiter, (class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TAwaiter awaiter, !!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TAwaiter"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Constraints> + </TypeParameter> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="awaiter" Type="TAwaiter&" RefType="ref" /> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TAwaiter">To be added.</typeparam> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="awaiter">To be added.</param> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Create"> + <MemberSignature Language="C#" Value="public static System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult> Create ();" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<!TResult> Create() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult></ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetException"> + <MemberSignature Language="C#" Value="public void SetException (Exception exception);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Exception exception) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="exception" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="exception">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetResult"> + <MemberSignature Language="C#" Value="public void SetResult (TResult result);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetResult(!TResult result) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="result" Type="TResult" /> + </Parameters> + <Docs> + <param name="result">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetStateMachine"> + <MemberSignature Language="C#" Value="public void SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetStateMachine(class System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="stateMachine" Type="System.Runtime.CompilerServices.IAsyncStateMachine" /> + </Parameters> + <Docs> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Start<TStateMachine>"> + <MemberSignature Language="C#" Value="public void Start<TStateMachine> (ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Start<(class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Task"> + <MemberSignature Language="C#" Value="public System.Threading.Tasks.Task<TResult> Task { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.Task`1<!TResult> Task" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Threading.Tasks.Task<TResult></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncVoidMethodBuilder.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncVoidMethodBuilder.xml new file mode 100644 index 0000000000..d1ce6722b4 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/AsyncVoidMethodBuilder.xml @@ -0,0 +1,186 @@ +<Type Name="AsyncVoidMethodBuilder" FullName="System.Runtime.CompilerServices.AsyncVoidMethodBuilder"> + <TypeSignature Language="C#" Value="public struct AsyncVoidMethodBuilder" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit AsyncVoidMethodBuilder extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="AwaitOnCompleted<TAwaiter,TStateMachine>"> + <MemberSignature Language="C#" Value="public void AwaitOnCompleted<TAwaiter,TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AwaitOnCompleted<(class System.Runtime.CompilerServices.INotifyCompletion) TAwaiter, (class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TAwaiter awaiter, !!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TAwaiter"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.INotifyCompletion</InterfaceName> + </Constraints> + </TypeParameter> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="awaiter" Type="TAwaiter&" RefType="ref" /> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TAwaiter">To be added.</typeparam> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="awaiter">To be added.</param> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>"> + <MemberSignature Language="C#" Value="public void AwaitUnsafeOnCompleted<TAwaiter,TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AwaitUnsafeOnCompleted<(class System.Runtime.CompilerServices.ICriticalNotifyCompletion) TAwaiter, (class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TAwaiter awaiter, !!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TAwaiter"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Constraints> + </TypeParameter> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="awaiter" Type="TAwaiter&" RefType="ref" /> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TAwaiter">To be added.</typeparam> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="awaiter">To be added.</param> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Create"> + <MemberSignature Language="C#" Value="public static System.Runtime.CompilerServices.AsyncVoidMethodBuilder Create ();" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Runtime.CompilerServices.AsyncVoidMethodBuilder Create() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.CompilerServices.AsyncVoidMethodBuilder</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetException"> + <MemberSignature Language="C#" Value="public void SetException (Exception exception);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Exception exception) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="exception" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="exception">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetResult"> + <MemberSignature Language="C#" Value="public void SetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetStateMachine"> + <MemberSignature Language="C#" Value="public void SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetStateMachine(class System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="stateMachine" Type="System.Runtime.CompilerServices.IAsyncStateMachine" /> + </Parameters> + <Docs> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Start<TStateMachine>"> + <MemberSignature Language="C#" Value="public void Start<TStateMachine> (ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine;" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Start<(class System.Runtime.CompilerServices.IAsyncStateMachine) TStateMachine>(!!TStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="TStateMachine"> + <Constraints> + <InterfaceName>System.Runtime.CompilerServices.IAsyncStateMachine</InterfaceName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="stateMachine" Type="TStateMachine&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="TStateMachine">To be added.</typeparam> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerFilePathAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerFilePathAttribute.xml new file mode 100644 index 0000000000..b41082db6a --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerFilePathAttribute.xml @@ -0,0 +1,36 @@ +<Type Name="CallerFilePathAttribute" FullName="System.Runtime.CompilerServices.CallerFilePathAttribute"> + <TypeSignature Language="C#" Value="public sealed class CallerFilePathAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit CallerFilePathAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Parameter, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public CallerFilePathAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerLineNumberAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerLineNumberAttribute.xml new file mode 100644 index 0000000000..3d093b5ebf --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerLineNumberAttribute.xml @@ -0,0 +1,36 @@ +<Type Name="CallerLineNumberAttribute" FullName="System.Runtime.CompilerServices.CallerLineNumberAttribute"> + <TypeSignature Language="C#" Value="public sealed class CallerLineNumberAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit CallerLineNumberAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Parameter, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public CallerLineNumberAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerMemberNameAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerMemberNameAttribute.xml new file mode 100644 index 0000000000..0b2ff16fc6 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/CallerMemberNameAttribute.xml @@ -0,0 +1,36 @@ +<Type Name="CallerMemberNameAttribute" FullName="System.Runtime.CompilerServices.CallerMemberNameAttribute"> + <TypeSignature Language="C#" Value="public sealed class CallerMemberNameAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit CallerMemberNameAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Parameter, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public CallerMemberNameAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.xml new file mode 100644 index 0000000000..e8aa09c0bc --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.xml @@ -0,0 +1,92 @@ +<Type Name="ConfiguredTaskAwaitable+ConfiguredTaskAwaiter" FullName="System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter"> + <TypeSignature Language="C#" Value="public struct ConfiguredTaskAwaitable.ConfiguredTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class nested public sequential ansi sealed beforefieldinit ConfiguredTaskAwaitable/ConfiguredTaskAwaiter extends System.ValueType implements class System.Runtime.CompilerServices.ICriticalNotifyCompletion, class System.Runtime.CompilerServices.INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetResult"> + <MemberSignature Language="C#" Value="public void GetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void GetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsCompleted"> + <MemberSignature Language="C#" Value="public bool IsCompleted { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IsCompleted" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="OnCompleted"> + <MemberSignature Language="C#" Value="public void OnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="UnsafeOnCompleted"> + <MemberSignature Language="C#" Value="public void UnsafeOnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void UnsafeOnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.xml new file mode 100644 index 0000000000..d2d24eca0d --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.xml @@ -0,0 +1,35 @@ +<Type Name="ConfiguredTaskAwaitable" FullName="System.Runtime.CompilerServices.ConfiguredTaskAwaitable"> + <TypeSignature Language="C#" Value="public struct ConfiguredTaskAwaitable" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit ConfiguredTaskAwaitable extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetAwaiter"> + <MemberSignature Language="C#" Value="public System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter GetAwaiter() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.xml new file mode 100644 index 0000000000..8f96a7c9b0 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.xml @@ -0,0 +1,96 @@ +<Type Name="ConfiguredTaskAwaitable<TResult>+ConfiguredTaskAwaiter" FullName="System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>+ConfiguredTaskAwaiter"> + <TypeSignature Language="C#" Value="public struct ConfiguredTaskAwaitable<TResult>.ConfiguredTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class nested public sequential ansi sealed beforefieldinit ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult> extends System.ValueType implements class System.Runtime.CompilerServices.ICriticalNotifyCompletion, class System.Runtime.CompilerServices.INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TResult" /> + </TypeParameters> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetResult"> + <MemberSignature Language="C#" Value="public TResult GetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance !TResult GetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsCompleted"> + <MemberSignature Language="C#" Value="public bool IsCompleted { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IsCompleted" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="OnCompleted"> + <MemberSignature Language="C#" Value="public void OnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="UnsafeOnCompleted"> + <MemberSignature Language="C#" Value="public void UnsafeOnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void UnsafeOnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable`1.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable`1.xml new file mode 100644 index 0000000000..f3efb097bf --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ConfiguredTaskAwaitable`1.xml @@ -0,0 +1,39 @@ +<Type Name="ConfiguredTaskAwaitable<TResult>" FullName="System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>"> + <TypeSignature Language="C#" Value="public struct ConfiguredTaskAwaitable<TResult>" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit ConfiguredTaskAwaitable`1<TResult> extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TResult" /> + </TypeParameters> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <typeparam name="TResult">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetAwaiter"> + <MemberSignature Language="C#" Value="public System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>.ConfiguredTaskAwaiter GetAwaiter ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<!TResult> GetAwaiter() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>+ConfiguredTaskAwaiter</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ContractHelper.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ContractHelper.xml new file mode 100644 index 0000000000..b5a4843cd9 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ContractHelper.xml @@ -0,0 +1,87 @@ +<Type Name="ContractHelper" FullName="System.Runtime.CompilerServices.ContractHelper"> + <TypeSignature Language="C#" Value="public static class ContractHelper" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit ContractHelper extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="RaiseContractFailedEvent"> + <MemberSignature Language="C#" Value="public static string RaiseContractFailedEvent (System.Diagnostics.Contracts.ContractFailureKind failureKind, string userMessage, string conditionText, Exception innerException);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig string RaiseContractFailedEvent(valuetype System.Diagnostics.Contracts.ContractFailureKind failureKind, string userMessage, string conditionText, class System.Exception innerException) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerNonUserCode</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="failureKind" Type="System.Diagnostics.Contracts.ContractFailureKind" /> + <Parameter Name="userMessage" Type="System.String" /> + <Parameter Name="conditionText" Type="System.String" /> + <Parameter Name="innerException" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="failureKind">To be added.</param> + <param name="userMessage">To be added.</param> + <param name="conditionText">To be added.</param> + <param name="innerException">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="TriggerFailure"> + <MemberSignature Language="C#" Value="public static void TriggerFailure (System.Diagnostics.Contracts.ContractFailureKind kind, string displayMessage, string userMessage, string conditionText, Exception innerException);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void TriggerFailure(valuetype System.Diagnostics.Contracts.ContractFailureKind kind, string displayMessage, string userMessage, string conditionText, class System.Exception innerException) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerNonUserCode</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="kind" Type="System.Diagnostics.Contracts.ContractFailureKind" /> + <Parameter Name="displayMessage" Type="System.String" /> + <Parameter Name="userMessage" Type="System.String" /> + <Parameter Name="conditionText" Type="System.String" /> + <Parameter Name="innerException" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="kind">To be added.</param> + <param name="displayMessage">To be added.</param> + <param name="userMessage">To be added.</param> + <param name="conditionText">To be added.</param> + <param name="innerException">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ExtensionAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ExtensionAttribute.xml new file mode 100644 index 0000000000..a7ae4989c8 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ExtensionAttribute.xml @@ -0,0 +1,39 @@ +<Type Name="ExtensionAttribute" FullName="System.Runtime.CompilerServices.ExtensionAttribute"> + <TypeSignature Language="C#" Value="public sealed class ExtensionAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ExtensionAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.All)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ExtensionAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/IAsyncStateMachine.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/IAsyncStateMachine.xml new file mode 100644 index 0000000000..55427a9848 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/IAsyncStateMachine.xml @@ -0,0 +1,50 @@ +<Type Name="IAsyncStateMachine" FullName="System.Runtime.CompilerServices.IAsyncStateMachine"> + <TypeSignature Language="C#" Value="public interface IAsyncStateMachine" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IAsyncStateMachine" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="MoveNext"> + <MemberSignature Language="C#" Value="public void MoveNext ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void MoveNext() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetStateMachine"> + <MemberSignature Language="C#" Value="public void SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SetStateMachine(class System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="stateMachine" Type="System.Runtime.CompilerServices.IAsyncStateMachine" /> + </Parameters> + <Docs> + <param name="stateMachine">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ICriticalNotifyCompletion.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ICriticalNotifyCompletion.xml new file mode 100644 index 0000000000..435028af95 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/ICriticalNotifyCompletion.xml @@ -0,0 +1,38 @@ +<Type Name="ICriticalNotifyCompletion" FullName="System.Runtime.CompilerServices.ICriticalNotifyCompletion"> + <TypeSignature Language="C#" Value="public interface ICriticalNotifyCompletion : System.Runtime.CompilerServices.INotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract ICriticalNotifyCompletion implements class System.Runtime.CompilerServices.INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.CompilerServices.INotifyCompletion</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="UnsafeOnCompleted"> + <MemberSignature Language="C#" Value="public void UnsafeOnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void UnsafeOnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/INotifyCompletion.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/INotifyCompletion.xml new file mode 100644 index 0000000000..91d189cf17 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/INotifyCompletion.xml @@ -0,0 +1,34 @@ +<Type Name="INotifyCompletion" FullName="System.Runtime.CompilerServices.INotifyCompletion"> + <TypeSignature Language="C#" Value="public interface INotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="OnCompleted"> + <MemberSignature Language="C#" Value="public void OnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/IteratorStateMachineAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/IteratorStateMachineAttribute.xml new file mode 100644 index 0000000000..17489b3c86 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/IteratorStateMachineAttribute.xml @@ -0,0 +1,39 @@ +<Type Name="IteratorStateMachineAttribute" FullName="System.Runtime.CompilerServices.IteratorStateMachineAttribute"> + <TypeSignature Language="C#" Value="public sealed class IteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit IteratorStateMachineAttribute extends System.Runtime.CompilerServices.StateMachineAttribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Runtime.CompilerServices.StateMachineAttribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public IteratorStateMachineAttribute (Type stateMachineType);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type stateMachineType) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="stateMachineType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="stateMachineType">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/StateMachineAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/StateMachineAttribute.xml new file mode 100644 index 0000000000..1cabaa43d4 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/StateMachineAttribute.xml @@ -0,0 +1,55 @@ +<Type Name="StateMachineAttribute" FullName="System.Runtime.CompilerServices.StateMachineAttribute"> + <TypeSignature Language="C#" Value="public class StateMachineAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit StateMachineAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public StateMachineAttribute (Type stateMachineType);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type stateMachineType) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="stateMachineType" Type="System.Type" /> + </Parameters> + <Docs> + <param name="stateMachineType">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="StateMachineType"> + <MemberSignature Language="C#" Value="public Type StateMachineType { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Type StateMachineType" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Type</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/TaskAwaiter.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/TaskAwaiter.xml new file mode 100644 index 0000000000..aa09dfd6fb --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/TaskAwaiter.xml @@ -0,0 +1,92 @@ +<Type Name="TaskAwaiter" FullName="System.Runtime.CompilerServices.TaskAwaiter"> + <TypeSignature Language="C#" Value="public struct TaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit TaskAwaiter extends System.ValueType implements class System.Runtime.CompilerServices.ICriticalNotifyCompletion, class System.Runtime.CompilerServices.INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetResult"> + <MemberSignature Language="C#" Value="public void GetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void GetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsCompleted"> + <MemberSignature Language="C#" Value="public bool IsCompleted { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IsCompleted" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="OnCompleted"> + <MemberSignature Language="C#" Value="public void OnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="UnsafeOnCompleted"> + <MemberSignature Language="C#" Value="public void UnsafeOnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void UnsafeOnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/TaskAwaiter`1.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/TaskAwaiter`1.xml new file mode 100644 index 0000000000..b8cb3fab6e --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/TaskAwaiter`1.xml @@ -0,0 +1,97 @@ +<Type Name="TaskAwaiter<TResult>" FullName="System.Runtime.CompilerServices.TaskAwaiter<TResult>"> + <TypeSignature Language="C#" Value="public struct TaskAwaiter<TResult> : System.Runtime.CompilerServices.ICriticalNotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit TaskAwaiter`1<TResult> extends System.ValueType implements class System.Runtime.CompilerServices.ICriticalNotifyCompletion, class System.Runtime.CompilerServices.INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TResult" /> + </TypeParameters> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <typeparam name="TResult">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetResult"> + <MemberSignature Language="C#" Value="public TResult GetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance !TResult GetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsCompleted"> + <MemberSignature Language="C#" Value="public bool IsCompleted { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IsCompleted" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="OnCompleted"> + <MemberSignature Language="C#" Value="public void OnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="UnsafeOnCompleted"> + <MemberSignature Language="C#" Value="public void UnsafeOnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void UnsafeOnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/YieldAwaitable+YieldAwaiter.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/YieldAwaitable+YieldAwaiter.xml new file mode 100644 index 0000000000..25997da82c --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/YieldAwaitable+YieldAwaiter.xml @@ -0,0 +1,92 @@ +<Type Name="YieldAwaitable+YieldAwaiter" FullName="System.Runtime.CompilerServices.YieldAwaitable+YieldAwaiter"> + <TypeSignature Language="C#" Value="public struct YieldAwaitable.YieldAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion" /> + <TypeSignature Language="ILAsm" Value=".class nested public sequential ansi sealed beforefieldinit YieldAwaitable/YieldAwaiter extends System.ValueType implements class System.Runtime.CompilerServices.ICriticalNotifyCompletion, class System.Runtime.CompilerServices.INotifyCompletion" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.CompilerServices.ICriticalNotifyCompletion</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetResult"> + <MemberSignature Language="C#" Value="public void GetResult ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void GetResult() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsCompleted"> + <MemberSignature Language="C#" Value="public bool IsCompleted { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IsCompleted" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="OnCompleted"> + <MemberSignature Language="C#" Value="public void OnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="UnsafeOnCompleted"> + <MemberSignature Language="C#" Value="public void UnsafeOnCompleted (Action continuation);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void UnsafeOnCompleted(class System.Action continuation) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="continuation" Type="System.Action" /> + </Parameters> + <Docs> + <param name="continuation">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/YieldAwaitable.xml b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/YieldAwaitable.xml new file mode 100644 index 0000000000..f530f2da80 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.CompilerServices/YieldAwaitable.xml @@ -0,0 +1,35 @@ +<Type Name="YieldAwaitable" FullName="System.Runtime.CompilerServices.YieldAwaitable"> + <TypeSignature Language="C#" Value="public struct YieldAwaitable" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit YieldAwaitable extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="GetAwaiter"> + <MemberSignature Language="C#" Value="public System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter GetAwaiter ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Runtime.CompilerServices.YieldAwaitable/YieldAwaiter GetAwaiter() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.CompilerServices.YieldAwaitable+YieldAwaiter</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/ExceptionDispatchInfo.xml b/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/ExceptionDispatchInfo.xml new file mode 100644 index 0000000000..b9c6c5b0e7 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/ExceptionDispatchInfo.xml @@ -0,0 +1,70 @@ +<Type Name="ExceptionDispatchInfo" FullName="System.Runtime.ExceptionServices.ExceptionDispatchInfo"> + <TypeSignature Language="C#" Value="public sealed class ExceptionDispatchInfo" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ExceptionDispatchInfo extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Capture"> + <MemberSignature Language="C#" Value="public static System.Runtime.ExceptionServices.ExceptionDispatchInfo Capture (Exception source);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Runtime.ExceptionServices.ExceptionDispatchInfo Capture(class System.Exception source) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.ExceptionServices.ExceptionDispatchInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="source" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="source">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SourceException"> + <MemberSignature Language="C#" Value="public Exception SourceException { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Exception SourceException" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Exception</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Throw"> + <MemberSignature Language="C#" Value="public void Throw ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Throw() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/FirstChanceExceptionEventArgs.xml b/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/FirstChanceExceptionEventArgs.xml new file mode 100644 index 0000000000..13255cbf46 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/FirstChanceExceptionEventArgs.xml @@ -0,0 +1,50 @@ +<Type Name="FirstChanceExceptionEventArgs" FullName="System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs"> + <TypeSignature Language="C#" Value="public class FirstChanceExceptionEventArgs : EventArgs" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit FirstChanceExceptionEventArgs extends System.EventArgs" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.EventArgs</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public FirstChanceExceptionEventArgs (Exception exception);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Exception exception) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="exception" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="exception">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Exception"> + <MemberSignature Language="C#" Value="public Exception Exception { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Exception Exception" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Exception</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.xml new file mode 100644 index 0000000000..cdd9c582a3 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.xml @@ -0,0 +1,36 @@ +<Type Name="HandleProcessCorruptedStateExceptionsAttribute" FullName="System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute"> + <TypeSignature Language="C#" Value="public sealed class HandleProcessCorruptedStateExceptionsAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit HandleProcessCorruptedStateExceptionsAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public HandleProcessCorruptedStateExceptionsAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.xml new file mode 100644 index 0000000000..099591248f --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.xml @@ -0,0 +1,55 @@ +<Type Name="DefaultInterfaceAttribute" FullName="System.Runtime.InteropServices.WindowsRuntime.DefaultInterfaceAttribute"> + <TypeSignature Language="C#" Value="public sealed class DefaultInterfaceAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit DefaultInterfaceAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public DefaultInterfaceAttribute (Type defaultInterface);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type defaultInterface) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="defaultInterface" Type="System.Type" /> + </Parameters> + <Docs> + <param name="defaultInterface">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DefaultInterface"> + <MemberSignature Language="C#" Value="public Type DefaultInterface { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Type DefaultInterface" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Type</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.xml new file mode 100644 index 0000000000..ffba507e8f --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.xml @@ -0,0 +1,71 @@ +<Type Name="DesignerNamespaceResolveEventArgs" FullName="System.Runtime.InteropServices.WindowsRuntime.DesignerNamespaceResolveEventArgs"> + <TypeSignature Language="C#" Value="public class DesignerNamespaceResolveEventArgs : EventArgs" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DesignerNamespaceResolveEventArgs extends System.EventArgs" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.EventArgs</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public DesignerNamespaceResolveEventArgs (string namespaceName);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string namespaceName) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="namespaceName" Type="System.String" /> + </Parameters> + <Docs> + <param name="namespaceName">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="NamespaceName"> + <MemberSignature Language="C#" Value="public string NamespaceName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string NamespaceName" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ResolvedAssemblyFiles"> + <MemberSignature Language="C#" Value="public System.Collections.ObjectModel.Collection<string> ResolvedAssemblyFiles { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ObjectModel.Collection`1<string> ResolvedAssemblyFiles" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ObjectModel.Collection<System.String></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.xml new file mode 100644 index 0000000000..9de2223b64 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.xml @@ -0,0 +1,99 @@ +<Type Name="EventRegistrationToken" FullName="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken"> + <TypeSignature Language="C#" Value="public struct EventRegistrationToken" /> + <TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit EventRegistrationToken extends System.ValueType" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Equals"> + <MemberSignature Language="C#" Value="public override bool Equals (object obj);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="obj" Type="System.Object" /> + </Parameters> + <Docs> + <param name="obj">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetHashCode"> + <MemberSignature Language="C#" Value="public override int GetHashCode ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="op_Equality"> + <MemberSignature Language="C#" Value="public static bool op_Equality (System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken left, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken right);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Equality(valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken left, valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken right) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="left" Type="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" /> + <Parameter Name="right" Type="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" /> + </Parameters> + <Docs> + <param name="left">To be added.</param> + <param name="right">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="op_Inequality"> + <MemberSignature Language="C#" Value="public static bool op_Inequality (System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken left, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken right);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Inequality(valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken left, valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken right) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="left" Type="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" /> + <Parameter Name="right" Type="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" /> + </Parameters> + <Docs> + <param name="left">To be added.</param> + <param name="right">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable`1.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable`1.xml new file mode 100644 index 0000000000..a134e71e30 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable`1.xml @@ -0,0 +1,133 @@ +<Type Name="EventRegistrationTokenTable<T>" FullName="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T>"> + <TypeSignature Language="C#" Value="public sealed class EventRegistrationTokenTable<T> where T : class" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit EventRegistrationTokenTable`1<class T> extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public EventRegistrationTokenTable ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="AddEventHandler"> + <MemberSignature Language="C#" Value="public System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken AddEventHandler (T handler);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken AddEventHandler(!T handler) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="handler" Type="T" /> + </Parameters> + <Docs> + <param name="handler">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetOrCreateEventRegistrationTokenTable"> + <MemberSignature Language="C#" Value="public static System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T> GetOrCreateEventRegistrationTokenTable (ref System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T> refEventTable);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1<!T> GetOrCreateEventRegistrationTokenTable(class System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1<!T> refEventTable) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="refEventTable" Type="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable<T>&" RefType="ref" /> + </Parameters> + <Docs> + <param name="refEventTable">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="InvocationList"> + <MemberSignature Language="C#" Value="public T InvocationList { get; set; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !T InvocationList" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="RemoveEventHandler"> + <MemberSignature Language="C#" Value="public void RemoveEventHandler (System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken token);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveEventHandler(valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken token) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="token" Type="System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" /> + </Parameters> + <Docs> + <param name="token">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="RemoveEventHandler"> + <MemberSignature Language="C#" Value="public void RemoveEventHandler (T handler);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveEventHandler(!T handler) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="handler" Type="T" /> + </Parameters> + <Docs> + <param name="handler">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.xml new file mode 100644 index 0000000000..18cabc5fa2 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.xml @@ -0,0 +1,37 @@ +<Type Name="IActivationFactory" FullName="System.Runtime.InteropServices.WindowsRuntime.IActivationFactory"> + <TypeSignature Language="C#" Value="public interface IActivationFactory" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IActivationFactory" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.Guid("00000035-0000-0000-C000-000000000046")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="ActivateInstance"> + <MemberSignature Language="C#" Value="public object ActivateInstance ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object ActivateInstance() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Object</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.xml new file mode 100644 index 0000000000..fdcdd49257 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.xml @@ -0,0 +1,127 @@ +<Type Name="InterfaceImplementedInVersionAttribute" FullName="System.Runtime.InteropServices.WindowsRuntime.InterfaceImplementedInVersionAttribute"> + <TypeSignature Language="C#" Value="public sealed class InterfaceImplementedInVersionAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit InterfaceImplementedInVersionAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public InterfaceImplementedInVersionAttribute (Type interfaceType, byte majorVersion, byte minorVersion, byte buildVersion, byte revisionVersion);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type interfaceType, unsigned int8 majorVersion, unsigned int8 minorVersion, unsigned int8 buildVersion, unsigned int8 revisionVersion) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="interfaceType" Type="System.Type" /> + <Parameter Name="majorVersion" Type="System.Byte" /> + <Parameter Name="minorVersion" Type="System.Byte" /> + <Parameter Name="buildVersion" Type="System.Byte" /> + <Parameter Name="revisionVersion" Type="System.Byte" /> + </Parameters> + <Docs> + <param name="interfaceType">To be added.</param> + <param name="majorVersion">To be added.</param> + <param name="minorVersion">To be added.</param> + <param name="buildVersion">To be added.</param> + <param name="revisionVersion">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="BuildVersion"> + <MemberSignature Language="C#" Value="public byte BuildVersion { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance unsigned int8 BuildVersion" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Byte</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="InterfaceType"> + <MemberSignature Language="C#" Value="public Type InterfaceType { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Type InterfaceType" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Type</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="MajorVersion"> + <MemberSignature Language="C#" Value="public byte MajorVersion { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance unsigned int8 MajorVersion" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Byte</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="MinorVersion"> + <MemberSignature Language="C#" Value="public byte MinorVersion { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance unsigned int8 MinorVersion" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Byte</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="RevisionVersion"> + <MemberSignature Language="C#" Value="public byte RevisionVersion { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance unsigned int8 RevisionVersion" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Byte</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.xml new file mode 100644 index 0000000000..e12494b07e --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.xml @@ -0,0 +1,89 @@ +<Type Name="NamespaceResolveEventArgs" FullName="System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs"> + <TypeSignature Language="C#" Value="public class NamespaceResolveEventArgs : EventArgs" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit NamespaceResolveEventArgs extends System.EventArgs" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.EventArgs</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public NamespaceResolveEventArgs (string namespaceName, System.Reflection.Assembly requestingAssembly);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string namespaceName, class System.Reflection.Assembly requestingAssembly) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="namespaceName" Type="System.String" /> + <Parameter Name="requestingAssembly" Type="System.Reflection.Assembly" /> + </Parameters> + <Docs> + <param name="namespaceName">To be added.</param> + <param name="requestingAssembly">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="NamespaceName"> + <MemberSignature Language="C#" Value="public string NamespaceName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string NamespaceName" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="RequestingAssembly"> + <MemberSignature Language="C#" Value="public System.Reflection.Assembly RequestingAssembly { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Reflection.Assembly RequestingAssembly" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Reflection.Assembly</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ResolvedAssemblies"> + <MemberSignature Language="C#" Value="public System.Collections.ObjectModel.Collection<System.Reflection.Assembly> ResolvedAssemblies { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.ObjectModel.Collection`1<class System.Reflection.Assembly> ResolvedAssemblies" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ObjectModel.Collection<System.Reflection.Assembly></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.xml new file mode 100644 index 0000000000..883f167f02 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.xml @@ -0,0 +1,36 @@ +<Type Name="ReadOnlyArrayAttribute" FullName="System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArrayAttribute"> + <TypeSignature Language="C#" Value="public sealed class ReadOnlyArrayAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ReadOnlyArrayAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ReadOnlyArrayAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml new file mode 100644 index 0000000000..9f8ff6d391 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml @@ -0,0 +1,55 @@ +<Type Name="ReturnValueNameAttribute" FullName="System.Runtime.InteropServices.WindowsRuntime.ReturnValueNameAttribute"> + <TypeSignature Language="C#" Value="public sealed class ReturnValueNameAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ReturnValueNameAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.ReturnValue | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ReturnValueNameAttribute (string name);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string name) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="name" Type="System.String" /> + </Parameters> + <Docs> + <param name="name">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Name"> + <MemberSignature Language="C#" Value="public string Name { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Name" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.xml new file mode 100644 index 0000000000..9578d1164f --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.xml @@ -0,0 +1,168 @@ +<Type Name="WindowsRuntimeMarshal" FullName="System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal"> + <TypeSignature Language="C#" Value="public static class WindowsRuntimeMarshal" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit WindowsRuntimeMarshal extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="AddEventHandler<T>"> + <MemberSignature Language="C#" Value="public static void AddEventHandler<T> (Func<T,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> addMethod, Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, T handler);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void AddEventHandler<T>(class System.Func`2<!!T, valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> addMethod, class System.Action`1<valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, !!T handler) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T" /> + </TypeParameters> + <Parameters> + <Parameter Name="addMethod" Type="System.Func<T,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken>" /> + <Parameter Name="removeMethod" Type="System.Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken>" /> + <Parameter Name="handler" Type="T" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="addMethod">To be added.</param> + <param name="removeMethod">To be added.</param> + <param name="handler">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="FreeHString"> + <MemberSignature Language="C#" Value="public static void FreeHString (IntPtr ptr);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void FreeHString(native int ptr) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="ptr" Type="System.IntPtr" /> + </Parameters> + <Docs> + <param name="ptr">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetActivationFactory"> + <MemberSignature Language="C#" Value="public static System.Runtime.InteropServices.WindowsRuntime.IActivationFactory GetActivationFactory (Type type);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Runtime.InteropServices.WindowsRuntime.IActivationFactory GetActivationFactory(class System.Type type) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.InteropServices.WindowsRuntime.IActivationFactory</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="type" Type="System.Type" /> + </Parameters> + <Docs> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="PtrToStringHString"> + <MemberSignature Language="C#" Value="public static string PtrToStringHString (IntPtr ptr);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig string PtrToStringHString(native int ptr) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="ptr" Type="System.IntPtr" /> + </Parameters> + <Docs> + <param name="ptr">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="RemoveAllEventHandlers"> + <MemberSignature Language="C#" Value="public static void RemoveAllEventHandlers (Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void RemoveAllEventHandlers(class System.Action`1<valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="removeMethod" Type="System.Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken>" /> + </Parameters> + <Docs> + <param name="removeMethod">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="RemoveEventHandler<T>"> + <MemberSignature Language="C#" Value="public static void RemoveEventHandler<T> (Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, T handler);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void RemoveEventHandler<T>(class System.Action`1<valuetype System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, !!T handler) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T" /> + </TypeParameters> + <Parameters> + <Parameter Name="removeMethod" Type="System.Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken>" /> + <Parameter Name="handler" Type="T" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="removeMethod">To be added.</param> + <param name="handler">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="StringToHString"> + <MemberSignature Language="C#" Value="public static IntPtr StringToHString (string s);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig native int StringToHString(string s) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.IntPtr</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="s" Type="System.String" /> + </Parameters> + <Docs> + <param name="s">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.xml new file mode 100644 index 0000000000..9af7039291 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.xml @@ -0,0 +1,94 @@ +<Type Name="WindowsRuntimeMetadata" FullName="System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata"> + <TypeSignature Language="C#" Value="public static class WindowsRuntimeMetadata" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit WindowsRuntimeMetadata extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="DesignerNamespaceResolve"> + <MemberSignature Language="C#" Value="public static event EventHandler<System.Runtime.InteropServices.WindowsRuntime.DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve;" /> + <MemberSignature Language="ILAsm" Value=".event class System.EventHandler`1<class System.Runtime.InteropServices.WindowsRuntime.DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve" /> + <MemberType>Event</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.EventHandler<System.Runtime.InteropServices.WindowsRuntime.DesignerNamespaceResolveEventArgs></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ReflectionOnlyNamespaceResolve"> + <MemberSignature Language="C#" Value="public static event EventHandler<System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs> ReflectionOnlyNamespaceResolve;" /> + <MemberSignature Language="ILAsm" Value=".event class System.EventHandler`1<class System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs> ReflectionOnlyNamespaceResolve" /> + <MemberType>Event</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.EventHandler<System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ResolveNamespace"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<string> ResolveNamespace (string namespaceName, System.Collections.Generic.IEnumerable<string> packageGraphFilePaths);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<string> ResolveNamespace(string namespaceName, class System.Collections.Generic.IEnumerable`1<string> packageGraphFilePaths) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.String></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="namespaceName" Type="System.String" /> + <Parameter Name="packageGraphFilePaths" Type="System.Collections.Generic.IEnumerable<System.String>" /> + </Parameters> + <Docs> + <param name="namespaceName">To be added.</param> + <param name="packageGraphFilePaths">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ResolveNamespace"> + <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<string> ResolveNamespace (string namespaceName, string windowsSdkFilePath, System.Collections.Generic.IEnumerable<string> packageGraphFilePaths);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<string> ResolveNamespace(string namespaceName, string windowsSdkFilePath, class System.Collections.Generic.IEnumerable`1<string> packageGraphFilePaths) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.Generic.IEnumerable<System.String></ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="namespaceName" Type="System.String" /> + <Parameter Name="windowsSdkFilePath" Type="System.String" /> + <Parameter Name="packageGraphFilePaths" Type="System.Collections.Generic.IEnumerable<System.String>" /> + </Parameters> + <Docs> + <param name="namespaceName">To be added.</param> + <param name="windowsSdkFilePath">To be added.</param> + <param name="packageGraphFilePaths">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.xml new file mode 100644 index 0000000000..e6076bfa66 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.xml @@ -0,0 +1,36 @@ +<Type Name="WriteOnlyArrayAttribute" FullName="System.Runtime.InteropServices.WindowsRuntime.WriteOnlyArrayAttribute"> + <TypeSignature Language="C#" Value="public sealed class WriteOnlyArrayAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit WriteOnlyArrayAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public WriteOnlyArrayAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices/TypeIdentifierAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices/TypeIdentifierAttribute.xml new file mode 100644 index 0000000000..d869f93780 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.InteropServices/TypeIdentifierAttribute.xml @@ -0,0 +1,86 @@ +<Type Name="TypeIdentifierAttribute" FullName="System.Runtime.InteropServices.TypeIdentifierAttribute"> + <TypeSignature Language="C#" Value="public sealed class TypeIdentifierAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit TypeIdentifierAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate | System.AttributeTargets.All, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public TypeIdentifierAttribute ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public TypeIdentifierAttribute (string scope, string identifier);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string scope, string identifier) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="scope" Type="System.String" /> + <Parameter Name="identifier" Type="System.String" /> + </Parameters> + <Docs> + <param name="scope">To be added.</param> + <param name="identifier">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Identifier"> + <MemberSignature Language="C#" Value="public string Identifier { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Identifier" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Scope"> + <MemberSignature Language="C#" Value="public string Scope { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Scope" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.Versioning/ComponentGuaranteesAttribute.xml b/mcs/class/corlib/Documentation/en/System.Runtime.Versioning/ComponentGuaranteesAttribute.xml new file mode 100644 index 0000000000..1fbef76eb2 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.Versioning/ComponentGuaranteesAttribute.xml @@ -0,0 +1,55 @@ +<Type Name="ComponentGuaranteesAttribute" FullName="System.Runtime.Versioning.ComponentGuaranteesAttribute"> + <TypeSignature Language="C#" Value="public sealed class ComponentGuaranteesAttribute : Attribute" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ComponentGuaranteesAttribute extends System.Attribute" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Attribute</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Module | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Delegate | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ComponentGuaranteesAttribute (System.Runtime.Versioning.ComponentGuaranteesOptions guarantees);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Runtime.Versioning.ComponentGuaranteesOptions guarantees) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="guarantees" Type="System.Runtime.Versioning.ComponentGuaranteesOptions" /> + </Parameters> + <Docs> + <param name="guarantees">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Guarantees"> + <MemberSignature Language="C#" Value="public System.Runtime.Versioning.ComponentGuaranteesOptions Guarantees { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Runtime.Versioning.ComponentGuaranteesOptions Guarantees" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.Versioning.ComponentGuaranteesOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Runtime.Versioning/ComponentGuaranteesOptions.xml b/mcs/class/corlib/Documentation/en/System.Runtime.Versioning/ComponentGuaranteesOptions.xml new file mode 100644 index 0000000000..b98d1f994d --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Runtime.Versioning/ComponentGuaranteesOptions.xml @@ -0,0 +1,78 @@ +<Type Name="ComponentGuaranteesOptions" FullName="System.Runtime.Versioning.ComponentGuaranteesOptions"> + <TypeSignature Language="C#" Value="public enum ComponentGuaranteesOptions" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed ComponentGuaranteesOptions extends System.Enum" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Enum</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Flags</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Exchange"> + <MemberSignature Language="C#" Value="Exchange" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Runtime.Versioning.ComponentGuaranteesOptions Exchange = int32(1)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.Versioning.ComponentGuaranteesOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + <Member MemberName="None"> + <MemberSignature Language="C#" Value="None" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Runtime.Versioning.ComponentGuaranteesOptions None = int32(0)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.Versioning.ComponentGuaranteesOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + <Member MemberName="SideBySide"> + <MemberSignature Language="C#" Value="SideBySide" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Runtime.Versioning.ComponentGuaranteesOptions SideBySide = int32(4)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.Versioning.ComponentGuaranteesOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + <Member MemberName="Stable"> + <MemberSignature Language="C#" Value="Stable" /> + <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Runtime.Versioning.ComponentGuaranteesOptions Stable = int32(2)" /> + <MemberType>Field</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Runtime.Versioning.ComponentGuaranteesOptions</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Security.AccessControl/AccessRule`1.xml b/mcs/class/corlib/Documentation/en/System.Security.AccessControl/AccessRule`1.xml new file mode 100644 index 0000000000..ad670e8a15 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Security.AccessControl/AccessRule`1.xml @@ -0,0 +1,132 @@ +<Type Name="AccessRule<T>" FullName="System.Security.AccessControl.AccessRule<T>"> + <TypeSignature Language="C#" Value="public class AccessRule<T> : System.Security.AccessControl.AccessRule where T : struct" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AccessRule`1<struct .ctor (class System.ValueType) T> extends System.Security.AccessControl.AccessRule" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute> + <ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute> + <BaseTypeName>System.ValueType</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Security.AccessControl.AccessRule</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AccessRule (System.Security.Principal.IdentityReference identity, T rights, System.Security.AccessControl.AccessControlType type);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Security.Principal.IdentityReference identity, !T rights, valuetype System.Security.AccessControl.AccessControlType type) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.Security.Principal.IdentityReference" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="type" Type="System.Security.AccessControl.AccessControlType" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AccessRule (string identity, T rights, System.Security.AccessControl.AccessControlType type);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string identity, !T rights, valuetype System.Security.AccessControl.AccessControlType type) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.String" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="type" Type="System.Security.AccessControl.AccessControlType" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AccessRule (System.Security.Principal.IdentityReference identity, T rights, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AccessControlType type);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Security.Principal.IdentityReference identity, !T rights, valuetype System.Security.AccessControl.InheritanceFlags inheritanceFlags, valuetype System.Security.AccessControl.PropagationFlags propagationFlags, valuetype System.Security.AccessControl.AccessControlType type) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.Security.Principal.IdentityReference" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="inheritanceFlags" Type="System.Security.AccessControl.InheritanceFlags" /> + <Parameter Name="propagationFlags" Type="System.Security.AccessControl.PropagationFlags" /> + <Parameter Name="type" Type="System.Security.AccessControl.AccessControlType" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="inheritanceFlags">To be added.</param> + <param name="propagationFlags">To be added.</param> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AccessRule (string identity, T rights, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AccessControlType type);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string identity, !T rights, valuetype System.Security.AccessControl.InheritanceFlags inheritanceFlags, valuetype System.Security.AccessControl.PropagationFlags propagationFlags, valuetype System.Security.AccessControl.AccessControlType type) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.String" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="inheritanceFlags" Type="System.Security.AccessControl.InheritanceFlags" /> + <Parameter Name="propagationFlags" Type="System.Security.AccessControl.PropagationFlags" /> + <Parameter Name="type" Type="System.Security.AccessControl.AccessControlType" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="inheritanceFlags">To be added.</param> + <param name="propagationFlags">To be added.</param> + <param name="type">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Rights"> + <MemberSignature Language="C#" Value="public T Rights { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !T Rights" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Security.AccessControl/AuditRule`1.xml b/mcs/class/corlib/Documentation/en/System.Security.AccessControl/AuditRule`1.xml new file mode 100644 index 0000000000..546dbbc24c --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Security.AccessControl/AuditRule`1.xml @@ -0,0 +1,132 @@ +<Type Name="AuditRule<T>" FullName="System.Security.AccessControl.AuditRule<T>"> + <TypeSignature Language="C#" Value="public class AuditRule<T> : System.Security.AccessControl.AuditRule where T : struct" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AuditRule`1<struct .ctor (class System.ValueType) T> extends System.Security.AccessControl.AuditRule" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute> + <ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute> + <BaseTypeName>System.ValueType</BaseTypeName> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Security.AccessControl.AuditRule</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AuditRule (System.Security.Principal.IdentityReference identity, T rights, System.Security.AccessControl.AuditFlags flags);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Security.Principal.IdentityReference identity, !T rights, valuetype System.Security.AccessControl.AuditFlags flags) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.Security.Principal.IdentityReference" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="flags" Type="System.Security.AccessControl.AuditFlags" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="flags">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AuditRule (string identity, T rights, System.Security.AccessControl.AuditFlags flags);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string identity, !T rights, valuetype System.Security.AccessControl.AuditFlags flags) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.String" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="flags" Type="System.Security.AccessControl.AuditFlags" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="flags">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AuditRule (System.Security.Principal.IdentityReference identity, T rights, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AuditFlags flags);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Security.Principal.IdentityReference identity, !T rights, valuetype System.Security.AccessControl.InheritanceFlags inheritanceFlags, valuetype System.Security.AccessControl.PropagationFlags propagationFlags, valuetype System.Security.AccessControl.AuditFlags flags) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.Security.Principal.IdentityReference" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="inheritanceFlags" Type="System.Security.AccessControl.InheritanceFlags" /> + <Parameter Name="propagationFlags" Type="System.Security.AccessControl.PropagationFlags" /> + <Parameter Name="flags" Type="System.Security.AccessControl.AuditFlags" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="inheritanceFlags">To be added.</param> + <param name="propagationFlags">To be added.</param> + <param name="flags">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public AuditRule (string identity, T rights, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AuditFlags flags);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string identity, !T rights, valuetype System.Security.AccessControl.InheritanceFlags inheritanceFlags, valuetype System.Security.AccessControl.PropagationFlags propagationFlags, valuetype System.Security.AccessControl.AuditFlags flags) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="identity" Type="System.String" /> + <Parameter Name="rights" Type="T" /> + <Parameter Name="inheritanceFlags" Type="System.Security.AccessControl.InheritanceFlags" /> + <Parameter Name="propagationFlags" Type="System.Security.AccessControl.PropagationFlags" /> + <Parameter Name="flags" Type="System.Security.AccessControl.AuditFlags" /> + </Parameters> + <Docs> + <param name="identity">To be added.</param> + <param name="rights">To be added.</param> + <param name="inheritanceFlags">To be added.</param> + <param name="propagationFlags">To be added.</param> + <param name="flags">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Rights"> + <MemberSignature Language="C#" Value="public T Rights { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance !T Rights" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Security.AccessControl/NativeObjectSecurity+ExceptionFromErrorCode.xml b/mcs/class/corlib/Documentation/en/System.Security.AccessControl/NativeObjectSecurity+ExceptionFromErrorCode.xml new file mode 100644 index 0000000000..0f3f7030a6 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Security.AccessControl/NativeObjectSecurity+ExceptionFromErrorCode.xml @@ -0,0 +1,29 @@ +<Type Name="NativeObjectSecurity+ExceptionFromErrorCode" FullName="System.Security.AccessControl.NativeObjectSecurity+ExceptionFromErrorCode"> + <TypeSignature Language="C#" Value="protected delegate Exception NativeObjectSecurity.ExceptionFromErrorCode(int errorCode, string name, SafeHandle handle, object context);" /> + <TypeSignature Language="ILAsm" Value=".class nested protected auto ansi sealed NativeObjectSecurity/ExceptionFromErrorCode extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Parameters> + <Parameter Name="errorCode" Type="System.Int32" /> + <Parameter Name="name" Type="System.String" /> + <Parameter Name="handle" Type="System.Runtime.InteropServices.SafeHandle" /> + <Parameter Name="context" Type="System.Object" /> + </Parameters> + <ReturnValue> + <ReturnType>System.Exception</ReturnType> + </ReturnValue> + <Docs> + <param name="errorCode">To be added.</param> + <param name="name">To be added.</param> + <param name="handle">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Security.Policy/EvidenceBase.xml b/mcs/class/corlib/Documentation/en/System.Security.Policy/EvidenceBase.xml new file mode 100644 index 0000000000..ac132830eb --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Security.Policy/EvidenceBase.xml @@ -0,0 +1,48 @@ +<Type Name="EvidenceBase" FullName="System.Security.Policy.EvidenceBase"> + <TypeSignature Language="C#" Value="public abstract class EvidenceBase" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract serializable beforefieldinit EvidenceBase extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="protected EvidenceBase ();" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Clone"> + <MemberSignature Language="C#" Value="public virtual System.Security.Policy.EvidenceBase Clone ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Security.Policy.EvidenceBase Clone() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Security.Policy.EvidenceBase</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.xml b/mcs/class/corlib/Documentation/en/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.xml new file mode 100644 index 0000000000..4dbe8c6e9c --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.xml @@ -0,0 +1,157 @@ +<Type Name="ConcurrentExclusiveSchedulerPair" FullName="System.Threading.Tasks.ConcurrentExclusiveSchedulerPair"> + <TypeSignature Language="C#" Value="public class ConcurrentExclusiveSchedulerPair" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ConcurrentExclusiveSchedulerPair extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerDisplay("Concurrent={ConcurrentTaskCount}, Exclusive={ExclusiveTaskCount}")</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Diagnostics.DebuggerTypeProxy(typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair/SchedulerDebuggerView))</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ConcurrentExclusiveSchedulerPair ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ConcurrentExclusiveSchedulerPair (System.Threading.Tasks.TaskScheduler taskScheduler);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Threading.Tasks.TaskScheduler taskScheduler) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="taskScheduler" Type="System.Threading.Tasks.TaskScheduler" /> + </Parameters> + <Docs> + <param name="taskScheduler">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ConcurrentExclusiveSchedulerPair (System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Threading.Tasks.TaskScheduler taskScheduler, int32 maxConcurrencyLevel) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="taskScheduler" Type="System.Threading.Tasks.TaskScheduler" /> + <Parameter Name="maxConcurrencyLevel" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="taskScheduler">To be added.</param> + <param name="maxConcurrencyLevel">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public ConcurrentExclusiveSchedulerPair (System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Threading.Tasks.TaskScheduler taskScheduler, int32 maxConcurrencyLevel, int32 maxItemsPerTask) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="taskScheduler" Type="System.Threading.Tasks.TaskScheduler" /> + <Parameter Name="maxConcurrencyLevel" Type="System.Int32" /> + <Parameter Name="maxItemsPerTask" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="taskScheduler">To be added.</param> + <param name="maxConcurrencyLevel">To be added.</param> + <param name="maxItemsPerTask">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Complete"> + <MemberSignature Language="C#" Value="public void Complete ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Complete() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Completion"> + <MemberSignature Language="C#" Value="public System.Threading.Tasks.Task Completion { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.Task Completion" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Threading.Tasks.Task</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConcurrentScheduler"> + <MemberSignature Language="C#" Value="public System.Threading.Tasks.TaskScheduler ConcurrentScheduler { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.TaskScheduler ConcurrentScheduler" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Threading.Tasks.TaskScheduler</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ExclusiveScheduler"> + <MemberSignature Language="C#" Value="public System.Threading.Tasks.TaskScheduler ExclusiveScheduler { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.TaskScheduler ExclusiveScheduler" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Threading.Tasks.TaskScheduler</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System.Threading/Volatile.xml b/mcs/class/corlib/Documentation/en/System.Threading/Volatile.xml new file mode 100644 index 0000000000..44357a0532 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System.Threading/Volatile.xml @@ -0,0 +1,768 @@ +<Type Name="Volatile" FullName="System.Threading.Volatile"> + <TypeSignature Language="C#" Value="public static class Volatile" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit Volatile extends System.Object" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static bool Read (ref bool location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Read(bool location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Boolean&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static byte Read (ref byte location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int8 Read(unsigned int8 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Byte</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Byte&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static double Read (ref double location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Read(float64 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Double</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Double&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static short Read (ref short location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig int16 Read(int16 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Int16</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Int16&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static int Read (ref int location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 Read(int32 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Int32&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static long Read (ref long location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig int64 Read(int64 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Int64</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Int64&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static IntPtr Read (ref IntPtr location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig native int Read(native int location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.IntPtr</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.IntPtr&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static sbyte Read (ref sbyte location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig int8 Read(int8 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.SByte</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.SByte&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static float Read (ref float location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig float32 Read(float32 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Single</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Single&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static ushort Read (ref ushort location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int16 Read(unsigned int16 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.UInt16</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UInt16&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static uint Read (ref uint location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int32 Read(unsigned int32 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.UInt32</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UInt32&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static ulong Read (ref ulong location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int64 Read(unsigned int64 location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.UInt64</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UInt64&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read"> + <MemberSignature Language="C#" Value="public static UIntPtr Read (ref UIntPtr location);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig native unsigned int Read(native unsigned int location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.UIntPtr</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UIntPtr&" RefType="ref" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Read<T>"> + <MemberSignature Language="C#" Value="public static T Read<T> (ref T location) where T : class;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T Read<class T>(!!T location) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>T</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="location" Type="T&" RefType="ref" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="location">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref bool location, bool value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(bool location, bool value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Boolean&" RefType="ref" /> + <Parameter Name="value" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref byte location, byte value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(unsigned int8 location, unsigned int8 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Byte&" RefType="ref" /> + <Parameter Name="value" Type="System.Byte" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref double location, double value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(float64 location, float64 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Double&" RefType="ref" /> + <Parameter Name="value" Type="System.Double" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref short location, short value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(int16 location, int16 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Int16&" RefType="ref" /> + <Parameter Name="value" Type="System.Int16" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref int location, int value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(int32 location, int32 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Int32&" RefType="ref" /> + <Parameter Name="value" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref long location, long value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(int64 location, int64 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Int64&" RefType="ref" /> + <Parameter Name="value" Type="System.Int64" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref IntPtr location, IntPtr value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(native int location, native int value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.IntPtr&" RefType="ref" /> + <Parameter Name="value" Type="System.IntPtr" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref sbyte location, sbyte value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(int8 location, int8 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.SByte&" RefType="ref" /> + <Parameter Name="value" Type="System.SByte" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref float location, float value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(float32 location, float32 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.Single&" RefType="ref" /> + <Parameter Name="value" Type="System.Single" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref ushort location, ushort value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(unsigned int16 location, unsigned int16 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UInt16&" RefType="ref" /> + <Parameter Name="value" Type="System.UInt16" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref uint location, uint value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(unsigned int32 location, unsigned int32 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UInt32&" RefType="ref" /> + <Parameter Name="value" Type="System.UInt32" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref ulong location, ulong value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(unsigned int64 location, unsigned int64 value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UInt64&" RefType="ref" /> + <Parameter Name="value" Type="System.UInt64" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write"> + <MemberSignature Language="C#" Value="public static void Write (ref UIntPtr location, UIntPtr value);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write(native unsigned int location, native unsigned int value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Attributes> + <Attribute> + <AttributeName>System.CLSCompliant(false)</AttributeName> + </Attribute> + <Attribute> + <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName> + </Attribute> + </Attributes> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="location" Type="System.UIntPtr&" RefType="ref" /> + <Parameter Name="value" Type="System.UIntPtr" /> + </Parameters> + <Docs> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Write<T>"> + <MemberSignature Language="C#" Value="public static void Write<T> (ref T location, T value) where T : class;" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void Write<class T>(!!T location, !!T value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Parameters> + <Parameter Name="location" Type="T&" RefType="ref" /> + <Parameter Name="value" Type="T" /> + </Parameters> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="location">To be added.</param> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Action.xml b/mcs/class/corlib/Documentation/en/System/Action.xml new file mode 100644 index 0000000000..17bdf90e35 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Action.xml @@ -0,0 +1,24 @@ +<Type Name="Action" FullName="System.Action"> + <TypeSignature Language="C#" Value="public delegate void Action();" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Action extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters /> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Action`1.xml b/mcs/class/corlib/Documentation/en/System/Action`1.xml new file mode 100644 index 0000000000..360e85b1a3 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Action`1.xml @@ -0,0 +1,30 @@ +<Type Name="Action<T>" FullName="System.Action<T>"> + <TypeSignature Language="C#" Value="public delegate void Action<in T>(T obj);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Action`1<- T> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Parameters> + <Parameter Name="obj" Type="T" /> + </Parameters> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T">To be added.</typeparam> + <param name="obj">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Action`2.xml b/mcs/class/corlib/Documentation/en/System/Action`2.xml new file mode 100644 index 0000000000..a1acfbdbcc --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Action`2.xml @@ -0,0 +1,43 @@ +<Type Name="Action<T1,T2>" FullName="System.Action<T1,T2>"> + <TypeSignature Language="C#" Value="public delegate void Action<in T1,in T2>(T1 arg1, T2 arg2);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Action`2<- T1, - T2> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T1"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T2"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg1" Type="T1" /> + <Parameter Name="arg2" Type="T2" /> + </Parameters> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T1">To be added.</typeparam> + <typeparam name="T2">To be added.</typeparam> + <param name="arg1">To be added.</param> + <param name="arg2">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Action`3.xml b/mcs/class/corlib/Documentation/en/System/Action`3.xml new file mode 100644 index 0000000000..4e7838366a --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Action`3.xml @@ -0,0 +1,51 @@ +<Type Name="Action<T1,T2,T3>" FullName="System.Action<T1,T2,T3>"> + <TypeSignature Language="C#" Value="public delegate void Action<in T1,in T2,in T3>(T1 arg1, T2 arg2, T3 arg3);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Action`3<- T1, - T2, - T3> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T1"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T2"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T3"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg1" Type="T1" /> + <Parameter Name="arg2" Type="T2" /> + <Parameter Name="arg3" Type="T3" /> + </Parameters> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T1">To be added.</typeparam> + <typeparam name="T2">To be added.</typeparam> + <typeparam name="T3">To be added.</typeparam> + <param name="arg1">To be added.</param> + <param name="arg2">To be added.</param> + <param name="arg3">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Action`4.xml b/mcs/class/corlib/Documentation/en/System/Action`4.xml new file mode 100644 index 0000000000..ca3737f0f0 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Action`4.xml @@ -0,0 +1,59 @@ +<Type Name="Action<T1,T2,T3,T4>" FullName="System.Action<T1,T2,T3,T4>"> + <TypeSignature Language="C#" Value="public delegate void Action<in T1,in T2,in T3,in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Action`4<- T1, - T2, - T3, - T4> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T1"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T2"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T3"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T4"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg1" Type="T1" /> + <Parameter Name="arg2" Type="T2" /> + <Parameter Name="arg3" Type="T3" /> + <Parameter Name="arg4" Type="T4" /> + </Parameters> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T1">To be added.</typeparam> + <typeparam name="T2">To be added.</typeparam> + <typeparam name="T3">To be added.</typeparam> + <typeparam name="T4">To be added.</typeparam> + <param name="arg1">To be added.</param> + <param name="arg2">To be added.</param> + <param name="arg3">To be added.</param> + <param name="arg4">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Func`1.xml b/mcs/class/corlib/Documentation/en/System/Func`1.xml new file mode 100644 index 0000000000..7a165d78ef --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Func`1.xml @@ -0,0 +1,33 @@ +<Type Name="Func<TResult>" FullName="System.Func<TResult>"> + <TypeSignature Language="C#" Value="public delegate TResult Func<out TResult>();" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`1<+ TResult> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="TResult"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters /> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="TResult">To be added.</typeparam> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Func`2.xml b/mcs/class/corlib/Documentation/en/System/Func`2.xml new file mode 100644 index 0000000000..a0b9e2e878 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Func`2.xml @@ -0,0 +1,42 @@ +<Type Name="Func<T,TResult>" FullName="System.Func<T,TResult>"> + <TypeSignature Language="C#" Value="public delegate TResult Func<in T,out TResult>(T arg);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2<- T, + TResult> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="TResult"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg" Type="T" /> + </Parameters> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T">To be added.</typeparam> + <typeparam name="TResult">To be added.</typeparam> + <param name="arg">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Func`3.xml b/mcs/class/corlib/Documentation/en/System/Func`3.xml new file mode 100644 index 0000000000..3bfc4171fb --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Func`3.xml @@ -0,0 +1,50 @@ +<Type Name="Func<T1,T2,TResult>" FullName="System.Func<T1,T2,TResult>"> + <TypeSignature Language="C#" Value="public delegate TResult Func<in T1,in T2,out TResult>(T1 arg1, T2 arg2);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`3<- T1, - T2, + TResult> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T1"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T2"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="TResult"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg1" Type="T1" /> + <Parameter Name="arg2" Type="T2" /> + </Parameters> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T1">To be added.</typeparam> + <typeparam name="T2">To be added.</typeparam> + <typeparam name="TResult">To be added.</typeparam> + <param name="arg1">To be added.</param> + <param name="arg2">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Func`4.xml b/mcs/class/corlib/Documentation/en/System/Func`4.xml new file mode 100644 index 0000000000..e3880c1e5d --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Func`4.xml @@ -0,0 +1,58 @@ +<Type Name="Func<T1,T2,T3,TResult>" FullName="System.Func<T1,T2,T3,TResult>"> + <TypeSignature Language="C#" Value="public delegate TResult Func<in T1,in T2,in T3,out TResult>(T1 arg1, T2 arg2, T3 arg3);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`4<- T1, - T2, - T3, + TResult> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T1"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T2"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T3"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="TResult"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg1" Type="T1" /> + <Parameter Name="arg2" Type="T2" /> + <Parameter Name="arg3" Type="T3" /> + </Parameters> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T1">To be added.</typeparam> + <typeparam name="T2">To be added.</typeparam> + <typeparam name="T3">To be added.</typeparam> + <typeparam name="TResult">To be added.</typeparam> + <param name="arg1">To be added.</param> + <param name="arg2">To be added.</param> + <param name="arg3">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Func`5.xml b/mcs/class/corlib/Documentation/en/System/Func`5.xml new file mode 100644 index 0000000000..b7bcae05b6 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Func`5.xml @@ -0,0 +1,66 @@ +<Type Name="Func<T1,T2,T3,T4,TResult>" FullName="System.Func<T1,T2,T3,T4,TResult>"> + <TypeSignature Language="C#" Value="public delegate TResult Func<in T1,in T2,in T3,in T4,out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`5<- T1, - T2, - T3, - T4, + TResult> extends System.MulticastDelegate" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T1"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T2"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T3"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="T4"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + <TypeParameter Name="TResult"> + <Constraints> + <ParameterAttribute>Covariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Delegate</BaseTypeName> + </Base> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Parameters> + <Parameter Name="arg1" Type="T1" /> + <Parameter Name="arg2" Type="T2" /> + <Parameter Name="arg3" Type="T3" /> + <Parameter Name="arg4" Type="T4" /> + </Parameters> + <ReturnValue> + <ReturnType>TResult</ReturnType> + </ReturnValue> + <Docs> + <typeparam name="T1">To be added.</typeparam> + <typeparam name="T2">To be added.</typeparam> + <typeparam name="T3">To be added.</typeparam> + <typeparam name="T4">To be added.</typeparam> + <typeparam name="TResult">To be added.</typeparam> + <param name="arg1">To be added.</param> + <param name="arg2">To be added.</param> + <param name="arg3">To be added.</param> + <param name="arg4">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/IProgress`1.xml b/mcs/class/corlib/Documentation/en/System/IProgress`1.xml new file mode 100644 index 0000000000..c7a409c27d --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/IProgress`1.xml @@ -0,0 +1,42 @@ +<Type Name="IProgress<T>" FullName="System.IProgress<T>"> + <TypeSignature Language="C#" Value="public interface IProgress<in T>" /> + <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IProgress`1<- T>" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>Contravariant</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Interfaces /> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="Report"> + <MemberSignature Language="C#" Value="public void Report (T value);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Report(!T value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="value" Type="T" /> + </Parameters> + <Docs> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/InvalidTimeZoneException.xml b/mcs/class/corlib/Documentation/en/System/InvalidTimeZoneException.xml new file mode 100644 index 0000000000..cd8dc67a45 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/InvalidTimeZoneException.xml @@ -0,0 +1,88 @@ +<Type Name="InvalidTimeZoneException" FullName="System.InvalidTimeZoneException"> + <TypeSignature Language="C#" Value="public class InvalidTimeZoneException : Exception" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit InvalidTimeZoneException extends System.Exception" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Exception</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public InvalidTimeZoneException ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public InvalidTimeZoneException (string message);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="message" Type="System.String" /> + </Parameters> + <Docs> + <param name="message">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="protected InvalidTimeZoneException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> + <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> + </Parameters> + <Docs> + <param name="info">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public InvalidTimeZoneException (string message, Exception innerException);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception innerException) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="message" Type="System.String" /> + <Parameter Name="innerException" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="message">To be added.</param> + <param name="innerException">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/Progress`1.xml b/mcs/class/corlib/Documentation/en/System/Progress`1.xml new file mode 100644 index 0000000000..f885c5ee39 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/Progress`1.xml @@ -0,0 +1,108 @@ +<Type Name="Progress<T>" FullName="System.Progress<T>"> + <TypeSignature Language="C#" Value="public class Progress<T> : IProgress<T>" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Progress`1<T> extends System.Object implements class System.IProgress`1<!T>" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T" /> + </TypeParameters> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.IProgress<T></InterfaceName> + </Interface> + </Interfaces> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public Progress ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public Progress (Action<T> handler);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Action`1<!T> handler) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="handler" Type="System.Action<T>" /> + </Parameters> + <Docs> + <param name="handler">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="OnReport"> + <MemberSignature Language="C#" Value="protected virtual void OnReport (T value);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnReport(!T value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="value" Type="T" /> + </Parameters> + <Docs> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ProgressChanged"> + <MemberSignature Language="C#" Value="public event EventHandler<T> ProgressChanged;" /> + <MemberSignature Language="ILAsm" Value=".event class System.EventHandler`1<!T> ProgressChanged" /> + <MemberType>Event</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.EventHandler<T></ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.IProgress<T>.Report"> + <MemberSignature Language="C#" Value="void IProgress<T>.Report (T value);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.IProgress<T>.Report(!T value) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="value" Type="T" /> + </Parameters> + <Docs> + <param name="value">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/TimeZoneInfo+AdjustmentRule.xml b/mcs/class/corlib/Documentation/en/System/TimeZoneInfo+AdjustmentRule.xml new file mode 100644 index 0000000000..dce8632faa --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/TimeZoneInfo+AdjustmentRule.xml @@ -0,0 +1,218 @@ +<Type Name="TimeZoneInfo+AdjustmentRule" FullName="System.TimeZoneInfo+AdjustmentRule"> + <TypeSignature Language="C#" Value="public sealed class TimeZoneInfo.AdjustmentRule : IEquatable<TimeZoneInfo.AdjustmentRule>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable" /> + <TypeSignature Language="ILAsm" Value=".class nested public auto ansi serializable sealed beforefieldinit TimeZoneInfo/AdjustmentRule extends System.Object implements class System.IEquatable`1<class System.TimeZoneInfo/AdjustmentRule>, class System.Runtime.Serialization.IDeserializationCallback, class System.Runtime.Serialization.ISerializable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.IEquatable<System.TimeZoneInfo+AdjustmentRule></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Runtime.Serialization.IDeserializationCallback</InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="CreateAdjustmentRule"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo.AdjustmentRule CreateAdjustmentRule (DateTime dateStart, DateTime dateEnd, TimeSpan daylightDelta, TimeZoneInfo.TransitionTime daylightTransitionStart, TimeZoneInfo.TransitionTime daylightTransitionEnd);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.TimeZoneInfo/AdjustmentRule CreateAdjustmentRule(valuetype System.DateTime dateStart, valuetype System.DateTime dateEnd, valuetype System.TimeSpan daylightDelta, valuetype System.TimeZoneInfo/TransitionTime daylightTransitionStart, valuetype System.TimeZoneInfo/TransitionTime daylightTransitionEnd) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo+AdjustmentRule</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateStart" Type="System.DateTime" /> + <Parameter Name="dateEnd" Type="System.DateTime" /> + <Parameter Name="daylightDelta" Type="System.TimeSpan" /> + <Parameter Name="daylightTransitionStart" Type="System.TimeZoneInfo+TransitionTime" /> + <Parameter Name="daylightTransitionEnd" Type="System.TimeZoneInfo+TransitionTime" /> + </Parameters> + <Docs> + <param name="dateStart">To be added.</param> + <param name="dateEnd">To be added.</param> + <param name="daylightDelta">To be added.</param> + <param name="daylightTransitionStart">To be added.</param> + <param name="daylightTransitionEnd">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DateEnd"> + <MemberSignature Language="C#" Value="public DateTime DateEnd { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime DateEnd" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DateStart"> + <MemberSignature Language="C#" Value="public DateTime DateStart { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime DateStart" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DaylightDelta"> + <MemberSignature Language="C#" Value="public TimeSpan DaylightDelta { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeSpan DaylightDelta" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeSpan</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DaylightTransitionEnd"> + <MemberSignature Language="C#" Value="public TimeZoneInfo.TransitionTime DaylightTransitionEnd { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeZoneInfo/TransitionTime DaylightTransitionEnd" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo+TransitionTime</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DaylightTransitionStart"> + <MemberSignature Language="C#" Value="public TimeZoneInfo.TransitionTime DaylightTransitionStart { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeZoneInfo/TransitionTime DaylightTransitionStart" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo+TransitionTime</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Equals"> + <MemberSignature Language="C#" Value="public bool Equals (TimeZoneInfo.AdjustmentRule other);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(class System.TimeZoneInfo/AdjustmentRule other) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="other" Type="System.TimeZoneInfo+AdjustmentRule" /> + </Parameters> + <Docs> + <param name="other">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetHashCode"> + <MemberSignature Language="C#" Value="public override int GetHashCode ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Runtime.Serialization.IDeserializationCallback.OnDeserialization"> + <MemberSignature Language="C#" Value="void IDeserializationCallback.OnDeserialization (object sender);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object sender) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="sender" Type="System.Object" /> + </Parameters> + <Docs> + <param name="sender">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Runtime.Serialization.ISerializable.GetObjectData"> + <MemberSignature Language="C#" Value="void ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.ISerializable.GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> + <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> + </Parameters> + <Docs> + <param name="info">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/TimeZoneInfo+TransitionTime.xml b/mcs/class/corlib/Documentation/en/System/TimeZoneInfo+TransitionTime.xml new file mode 100644 index 0000000000..8b891c0b11 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/TimeZoneInfo+TransitionTime.xml @@ -0,0 +1,320 @@ +<Type Name="TimeZoneInfo+TransitionTime" FullName="System.TimeZoneInfo+TransitionTime"> + <TypeSignature Language="C#" Value="public struct TimeZoneInfo.TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable" /> + <TypeSignature Language="ILAsm" Value=".class nested public sequential ansi serializable sealed beforefieldinit TimeZoneInfo/TransitionTime extends System.ValueType implements class System.IEquatable`1<valuetype System.TimeZoneInfo/TransitionTime>, class System.Runtime.Serialization.IDeserializationCallback, class System.Runtime.Serialization.ISerializable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.ValueType</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.IEquatable<System.TimeZoneInfo+TransitionTime></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Runtime.Serialization.IDeserializationCallback</InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="CreateFixedDateRule"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo.TransitionTime CreateFixedDateRule (DateTime timeOfDay, int month, int day);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.TimeZoneInfo/TransitionTime CreateFixedDateRule(valuetype System.DateTime timeOfDay, int32 month, int32 day) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo+TransitionTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="timeOfDay" Type="System.DateTime" /> + <Parameter Name="month" Type="System.Int32" /> + <Parameter Name="day" Type="System.Int32" /> + </Parameters> + <Docs> + <param name="timeOfDay">To be added.</param> + <param name="month">To be added.</param> + <param name="day">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="CreateFloatingDateRule"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo.TransitionTime CreateFloatingDateRule (DateTime timeOfDay, int month, int week, DayOfWeek dayOfWeek);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.TimeZoneInfo/TransitionTime CreateFloatingDateRule(valuetype System.DateTime timeOfDay, int32 month, int32 week, valuetype System.DayOfWeek dayOfWeek) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo+TransitionTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="timeOfDay" Type="System.DateTime" /> + <Parameter Name="month" Type="System.Int32" /> + <Parameter Name="week" Type="System.Int32" /> + <Parameter Name="dayOfWeek" Type="System.DayOfWeek" /> + </Parameters> + <Docs> + <param name="timeOfDay">To be added.</param> + <param name="month">To be added.</param> + <param name="week">To be added.</param> + <param name="dayOfWeek">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Day"> + <MemberSignature Language="C#" Value="public int Day { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Day" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DayOfWeek"> + <MemberSignature Language="C#" Value="public DayOfWeek DayOfWeek { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.DayOfWeek DayOfWeek" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DayOfWeek</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Equals"> + <MemberSignature Language="C#" Value="public override bool Equals (object obj);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="obj" Type="System.Object" /> + </Parameters> + <Docs> + <param name="obj">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Equals"> + <MemberSignature Language="C#" Value="public bool Equals (TimeZoneInfo.TransitionTime other);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(valuetype System.TimeZoneInfo/TransitionTime other) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="other" Type="System.TimeZoneInfo+TransitionTime" /> + </Parameters> + <Docs> + <param name="other">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetHashCode"> + <MemberSignature Language="C#" Value="public override int GetHashCode ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsFixedDateRule"> + <MemberSignature Language="C#" Value="public bool IsFixedDateRule { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool IsFixedDateRule" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Month"> + <MemberSignature Language="C#" Value="public int Month { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Month" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="op_Equality"> + <MemberSignature Language="C#" Value="public static bool op_Equality (TimeZoneInfo.TransitionTime t1, TimeZoneInfo.TransitionTime t2);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Equality(valuetype System.TimeZoneInfo/TransitionTime t1, valuetype System.TimeZoneInfo/TransitionTime t2) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="t1" Type="System.TimeZoneInfo+TransitionTime" /> + <Parameter Name="t2" Type="System.TimeZoneInfo+TransitionTime" /> + </Parameters> + <Docs> + <param name="t1">To be added.</param> + <param name="t2">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="op_Inequality"> + <MemberSignature Language="C#" Value="public static bool op_Inequality (TimeZoneInfo.TransitionTime t1, TimeZoneInfo.TransitionTime t2);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Inequality(valuetype System.TimeZoneInfo/TransitionTime t1, valuetype System.TimeZoneInfo/TransitionTime t2) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="t1" Type="System.TimeZoneInfo+TransitionTime" /> + <Parameter Name="t2" Type="System.TimeZoneInfo+TransitionTime" /> + </Parameters> + <Docs> + <param name="t1">To be added.</param> + <param name="t2">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Runtime.Serialization.IDeserializationCallback.OnDeserialization"> + <MemberSignature Language="C#" Value="void IDeserializationCallback.OnDeserialization (object sender);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object sender) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="sender" Type="System.Object" /> + </Parameters> + <Docs> + <param name="sender">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Runtime.Serialization.ISerializable.GetObjectData"> + <MemberSignature Language="C#" Value="void ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.ISerializable.GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> + <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> + </Parameters> + <Docs> + <param name="info">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="TimeOfDay"> + <MemberSignature Language="C#" Value="public DateTime TimeOfDay { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime TimeOfDay" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Week"> + <MemberSignature Language="C#" Value="public int Week { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance int32 Week" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/TimeZoneInfo.xml b/mcs/class/corlib/Documentation/en/System/TimeZoneInfo.xml new file mode 100644 index 0000000000..c850baa866 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/TimeZoneInfo.xml @@ -0,0 +1,870 @@ +<Type Name="TimeZoneInfo" FullName="System.TimeZoneInfo"> + <TypeSignature Language="C#" Value="public sealed class TimeZoneInfo : IEquatable<TimeZoneInfo>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit TimeZoneInfo extends System.Object implements class System.IEquatable`1<class System.TimeZoneInfo>, class System.Runtime.Serialization.IDeserializationCallback, class System.Runtime.Serialization.ISerializable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.IEquatable<System.TimeZoneInfo></InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Runtime.Serialization.IDeserializationCallback</InterfaceName> + </Interface> + <Interface> + <InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName> + </Interface> + </Interfaces> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName="BaseUtcOffset"> + <MemberSignature Language="C#" Value="public TimeSpan BaseUtcOffset { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeSpan BaseUtcOffset" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeSpan</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ClearCachedData"> + <MemberSignature Language="C#" Value="public static void ClearCachedData ();" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig void ClearCachedData() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTime"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTime (DateTime dateTime, TimeZoneInfo destinationTimeZone);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTime(valuetype System.DateTime dateTime, class System.TimeZoneInfo destinationTimeZone) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + <Parameter Name="destinationTimeZone" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <param name="destinationTimeZone">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTime"> + <MemberSignature Language="C#" Value="public static DateTimeOffset ConvertTime (DateTimeOffset dateTimeOffset, TimeZoneInfo destinationTimeZone);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTimeOffset ConvertTime(valuetype System.DateTimeOffset dateTimeOffset, class System.TimeZoneInfo destinationTimeZone) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTimeOffset</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" /> + <Parameter Name="destinationTimeZone" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="dateTimeOffset">To be added.</param> + <param name="destinationTimeZone">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTime"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTime (DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTime(valuetype System.DateTime dateTime, class System.TimeZoneInfo sourceTimeZone, class System.TimeZoneInfo destinationTimeZone) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + <Parameter Name="sourceTimeZone" Type="System.TimeZoneInfo" /> + <Parameter Name="destinationTimeZone" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <param name="sourceTimeZone">To be added.</param> + <param name="destinationTimeZone">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTimeBySystemTimeZoneId"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTimeBySystemTimeZoneId (DateTime dateTime, string destinationTimeZoneId);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTimeBySystemTimeZoneId(valuetype System.DateTime dateTime, string destinationTimeZoneId) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + <Parameter Name="destinationTimeZoneId" Type="System.String" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <param name="destinationTimeZoneId">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTimeBySystemTimeZoneId"> + <MemberSignature Language="C#" Value="public static DateTimeOffset ConvertTimeBySystemTimeZoneId (DateTimeOffset dateTimeOffset, string destinationTimeZoneId);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTimeOffset ConvertTimeBySystemTimeZoneId(valuetype System.DateTimeOffset dateTimeOffset, string destinationTimeZoneId) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTimeOffset</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" /> + <Parameter Name="destinationTimeZoneId" Type="System.String" /> + </Parameters> + <Docs> + <param name="dateTimeOffset">To be added.</param> + <param name="destinationTimeZoneId">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTimeBySystemTimeZoneId"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTimeBySystemTimeZoneId (DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTimeBySystemTimeZoneId(valuetype System.DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + <Parameter Name="sourceTimeZoneId" Type="System.String" /> + <Parameter Name="destinationTimeZoneId" Type="System.String" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <param name="sourceTimeZoneId">To be added.</param> + <param name="destinationTimeZoneId">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTimeFromUtc"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTimeFromUtc (DateTime dateTime, TimeZoneInfo destinationTimeZone);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTimeFromUtc(valuetype System.DateTime dateTime, class System.TimeZoneInfo destinationTimeZone) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + <Parameter Name="destinationTimeZone" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <param name="destinationTimeZone">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTimeToUtc"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTimeToUtc (DateTime dateTime);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTimeToUtc(valuetype System.DateTime dateTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ConvertTimeToUtc"> + <MemberSignature Language="C#" Value="public static DateTime ConvertTimeToUtc (DateTime dateTime, TimeZoneInfo sourceTimeZone);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTime ConvertTimeToUtc(valuetype System.DateTime dateTime, class System.TimeZoneInfo sourceTimeZone) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.DateTime</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + <Parameter Name="sourceTimeZone" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <param name="sourceTimeZone">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="CreateCustomTimeZone"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo CreateCustomTimeZone (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.TimeZoneInfo CreateCustomTimeZone(string id, valuetype System.TimeSpan baseUtcOffset, string displayName, string standardDisplayName) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="id" Type="System.String" /> + <Parameter Name="baseUtcOffset" Type="System.TimeSpan" /> + <Parameter Name="displayName" Type="System.String" /> + <Parameter Name="standardDisplayName" Type="System.String" /> + </Parameters> + <Docs> + <param name="id">To be added.</param> + <param name="baseUtcOffset">To be added.</param> + <param name="displayName">To be added.</param> + <param name="standardDisplayName">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="CreateCustomTimeZone"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo CreateCustomTimeZone (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, TimeZoneInfo.AdjustmentRule[] adjustmentRules);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.TimeZoneInfo CreateCustomTimeZone(string id, valuetype System.TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, class System.TimeZoneInfo/AdjustmentRule[] adjustmentRules) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="id" Type="System.String" /> + <Parameter Name="baseUtcOffset" Type="System.TimeSpan" /> + <Parameter Name="displayName" Type="System.String" /> + <Parameter Name="standardDisplayName" Type="System.String" /> + <Parameter Name="daylightDisplayName" Type="System.String" /> + <Parameter Name="adjustmentRules" Type="System.TimeZoneInfo+AdjustmentRule[]" /> + </Parameters> + <Docs> + <param name="id">To be added.</param> + <param name="baseUtcOffset">To be added.</param> + <param name="displayName">To be added.</param> + <param name="standardDisplayName">To be added.</param> + <param name="daylightDisplayName">To be added.</param> + <param name="adjustmentRules">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="CreateCustomTimeZone"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo CreateCustomTimeZone (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, TimeZoneInfo.AdjustmentRule[] adjustmentRules, bool disableDaylightSavingTime);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.TimeZoneInfo CreateCustomTimeZone(string id, valuetype System.TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, class System.TimeZoneInfo/AdjustmentRule[] adjustmentRules, bool disableDaylightSavingTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="id" Type="System.String" /> + <Parameter Name="baseUtcOffset" Type="System.TimeSpan" /> + <Parameter Name="displayName" Type="System.String" /> + <Parameter Name="standardDisplayName" Type="System.String" /> + <Parameter Name="daylightDisplayName" Type="System.String" /> + <Parameter Name="adjustmentRules" Type="System.TimeZoneInfo+AdjustmentRule[]" /> + <Parameter Name="disableDaylightSavingTime" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="id">To be added.</param> + <param name="baseUtcOffset">To be added.</param> + <param name="displayName">To be added.</param> + <param name="standardDisplayName">To be added.</param> + <param name="daylightDisplayName">To be added.</param> + <param name="adjustmentRules">To be added.</param> + <param name="disableDaylightSavingTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DaylightName"> + <MemberSignature Language="C#" Value="public string DaylightName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string DaylightName" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="DisplayName"> + <MemberSignature Language="C#" Value="public string DisplayName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string DisplayName" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Equals"> + <MemberSignature Language="C#" Value="public override bool Equals (object obj);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="obj" Type="System.Object" /> + </Parameters> + <Docs> + <param name="obj">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Equals"> + <MemberSignature Language="C#" Value="public bool Equals (TimeZoneInfo other);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(class System.TimeZoneInfo other) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="other" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="other">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="FindSystemTimeZoneById"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo FindSystemTimeZoneById (string id);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.TimeZoneInfo FindSystemTimeZoneById(string id) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="id" Type="System.String" /> + </Parameters> + <Docs> + <param name="id">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="FromSerializedString"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo FromSerializedString (string source);" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.TimeZoneInfo FromSerializedString(string source) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="source" Type="System.String" /> + </Parameters> + <Docs> + <param name="source">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetAdjustmentRules"> + <MemberSignature Language="C#" Value="public TimeZoneInfo.AdjustmentRule[] GetAdjustmentRules ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.TimeZoneInfo/AdjustmentRule[] GetAdjustmentRules() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo+AdjustmentRule[]</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetAmbiguousTimeOffsets"> + <MemberSignature Language="C#" Value="public TimeSpan[] GetAmbiguousTimeOffsets (DateTime dateTime);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.TimeSpan[] GetAmbiguousTimeOffsets(valuetype System.DateTime dateTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeSpan[]</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetAmbiguousTimeOffsets"> + <MemberSignature Language="C#" Value="public TimeSpan[] GetAmbiguousTimeOffsets (DateTimeOffset dateTimeOffset);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.TimeSpan[] GetAmbiguousTimeOffsets(valuetype System.DateTimeOffset dateTimeOffset) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeSpan[]</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" /> + </Parameters> + <Docs> + <param name="dateTimeOffset">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetHashCode"> + <MemberSignature Language="C#" Value="public override int GetHashCode ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Int32</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetSystemTimeZones"> + <MemberSignature Language="C#" Value="public static System.Collections.ObjectModel.ReadOnlyCollection<TimeZoneInfo> GetSystemTimeZones ();" /> + <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.ObjectModel.ReadOnlyCollection`1<class System.TimeZoneInfo> GetSystemTimeZones() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Collections.ObjectModel.ReadOnlyCollection<System.TimeZoneInfo></ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetUtcOffset"> + <MemberSignature Language="C#" Value="public TimeSpan GetUtcOffset (DateTime dateTime);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.TimeSpan GetUtcOffset(valuetype System.DateTime dateTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeSpan</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetUtcOffset"> + <MemberSignature Language="C#" Value="public TimeSpan GetUtcOffset (DateTimeOffset dateTimeOffset);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.TimeSpan GetUtcOffset(valuetype System.DateTimeOffset dateTimeOffset) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeSpan</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" /> + </Parameters> + <Docs> + <param name="dateTimeOffset">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="HasSameRules"> + <MemberSignature Language="C#" Value="public bool HasSameRules (TimeZoneInfo other);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool HasSameRules(class System.TimeZoneInfo other) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="other" Type="System.TimeZoneInfo" /> + </Parameters> + <Docs> + <param name="other">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Id"> + <MemberSignature Language="C#" Value="public string Id { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string Id" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsAmbiguousTime"> + <MemberSignature Language="C#" Value="public bool IsAmbiguousTime (DateTime dateTime);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsAmbiguousTime(valuetype System.DateTime dateTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsAmbiguousTime"> + <MemberSignature Language="C#" Value="public bool IsAmbiguousTime (DateTimeOffset dateTimeOffset);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsAmbiguousTime(valuetype System.DateTimeOffset dateTimeOffset) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" /> + </Parameters> + <Docs> + <param name="dateTimeOffset">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDaylightSavingTime"> + <MemberSignature Language="C#" Value="public bool IsDaylightSavingTime (DateTime dateTime);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsDaylightSavingTime(valuetype System.DateTime dateTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsDaylightSavingTime"> + <MemberSignature Language="C#" Value="public bool IsDaylightSavingTime (DateTimeOffset dateTimeOffset);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsDaylightSavingTime(valuetype System.DateTimeOffset dateTimeOffset) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" /> + </Parameters> + <Docs> + <param name="dateTimeOffset">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="IsInvalidTime"> + <MemberSignature Language="C#" Value="public bool IsInvalidTime (DateTime dateTime);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsInvalidTime(valuetype System.DateTime dateTime) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="dateTime" Type="System.DateTime" /> + </Parameters> + <Docs> + <param name="dateTime">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Local"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo Local { get; }" /> + <MemberSignature Language="ILAsm" Value=".property class System.TimeZoneInfo Local" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="StandardName"> + <MemberSignature Language="C#" Value="public string StandardName { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance string StandardName" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SupportsDaylightSavingTime"> + <MemberSignature Language="C#" Value="public bool SupportsDaylightSavingTime { get; }" /> + <MemberSignature Language="ILAsm" Value=".property instance bool SupportsDaylightSavingTime" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Runtime.Serialization.IDeserializationCallback.OnDeserialization"> + <MemberSignature Language="C#" Value="void IDeserializationCallback.OnDeserialization (object sender);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object sender) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="sender" Type="System.Object" /> + </Parameters> + <Docs> + <param name="sender">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="System.Runtime.Serialization.ISerializable.GetObjectData"> + <MemberSignature Language="C#" Value="void ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.ISerializable.GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> + <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> + </Parameters> + <Docs> + <param name="info">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ToSerializedString"> + <MemberSignature Language="C#" Value="public string ToSerializedString ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance string ToSerializedString() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="ToString"> + <MemberSignature Language="C#" Value="public override string ToString ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.String</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Utc"> + <MemberSignature Language="C#" Value="public static TimeZoneInfo Utc { get; }" /> + <MemberSignature Language="ILAsm" Value=".property class System.TimeZoneInfo Utc" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.TimeZoneInfo</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/TimeZoneNotFoundException.xml b/mcs/class/corlib/Documentation/en/System/TimeZoneNotFoundException.xml new file mode 100644 index 0000000000..c42ff93059 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/TimeZoneNotFoundException.xml @@ -0,0 +1,88 @@ +<Type Name="TimeZoneNotFoundException" FullName="System.TimeZoneNotFoundException"> + <TypeSignature Language="C#" Value="public class TimeZoneNotFoundException : Exception" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit TimeZoneNotFoundException extends System.Exception" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Base> + <BaseTypeName>System.Exception</BaseTypeName> + </Base> + <Interfaces /> + <Attributes> + <Attribute> + <AttributeName>System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName> + </Attribute> + </Attributes> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public TimeZoneNotFoundException ();" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public TimeZoneNotFoundException (string message);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="message" Type="System.String" /> + </Parameters> + <Docs> + <param name="message">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="protected TimeZoneNotFoundException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> + <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> + </Parameters> + <Docs> + <param name="info">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public TimeZoneNotFoundException (string message, Exception innerException);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception innerException) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="message" Type="System.String" /> + <Parameter Name="innerException" Type="System.Exception" /> + </Parameters> + <Docs> + <param name="message">To be added.</param> + <param name="innerException">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/System/WeakReference`1.xml b/mcs/class/corlib/Documentation/en/System/WeakReference`1.xml new file mode 100644 index 0000000000..4089d8a1a4 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/System/WeakReference`1.xml @@ -0,0 +1,140 @@ +<Type Name="WeakReference<T>" FullName="System.WeakReference<T>"> + <TypeSignature Language="C#" Value="public sealed class WeakReference<T> : System.Runtime.Serialization.ISerializable where T : class" /> + <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit WeakReference`1<class T> extends System.Object implements class System.Runtime.Serialization.ISerializable" /> + <AssemblyInfo> + <AssemblyName>mscorlib</AssemblyName> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <TypeParameters> + <TypeParameter Name="T"> + <Constraints> + <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute> + </Constraints> + </TypeParameter> + </TypeParameters> + <Base> + <BaseTypeName>System.Object</BaseTypeName> + </Base> + <Interfaces> + <Interface> + <InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName> + </Interface> + </Interfaces> + <Docs> + <typeparam name="T">To be added.</typeparam> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + <Members> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public WeakReference (T target);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(!T target) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="target" Type="T" /> + </Parameters> + <Docs> + <param name="target">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName=".ctor"> + <MemberSignature Language="C#" Value="public WeakReference (T target, bool trackResurrection);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(!T target, bool trackResurrection) cil managed" /> + <MemberType>Constructor</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <Parameters> + <Parameter Name="target" Type="T" /> + <Parameter Name="trackResurrection" Type="System.Boolean" /> + </Parameters> + <Docs> + <param name="target">To be added.</param> + <param name="trackResurrection">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="Finalize"> + <MemberSignature Language="C#" Value="~WeakReference`1 ();" /> + <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters /> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="GetObjectData"> + <MemberSignature Language="C#" Value="public void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /> + <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /> + </Parameters> + <Docs> + <param name="info">To be added.</param> + <param name="context">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="SetTarget"> + <MemberSignature Language="C#" Value="public void SetTarget (T target);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetTarget(!T target) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Void</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="target" Type="T" /> + </Parameters> + <Docs> + <param name="target">To be added.</param> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> + </Member> + <Member MemberName="TryGetTarget"> + <MemberSignature Language="C#" Value="public bool TryGetTarget (out T target);" /> + <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TryGetTarget(!T target) cil managed" /> + <MemberType>Method</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Parameters> + <Parameter Name="target" Type="T&" RefType="out" /> + </Parameters> + <Docs> + <param name="target">To be added.</param> + <summary>To be added.</summary> + <returns>To be added.</returns> + <remarks>To be added.</remarks> + </Docs> + </Member> + </Members> +</Type> diff --git a/mcs/class/corlib/Documentation/en/ns-System.Runtime.ExceptionServices.xml b/mcs/class/corlib/Documentation/en/ns-System.Runtime.ExceptionServices.xml new file mode 100644 index 0000000000..26593774d9 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/ns-System.Runtime.ExceptionServices.xml @@ -0,0 +1,6 @@ +<Namespace Name="System.Runtime.ExceptionServices"> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Namespace> diff --git a/mcs/class/corlib/Documentation/en/ns-System.Runtime.InteropServices.WindowsRuntime.xml b/mcs/class/corlib/Documentation/en/ns-System.Runtime.InteropServices.WindowsRuntime.xml new file mode 100644 index 0000000000..206703d275 --- /dev/null +++ b/mcs/class/corlib/Documentation/en/ns-System.Runtime.InteropServices.WindowsRuntime.xml @@ -0,0 +1,6 @@ +<Namespace Name="System.Runtime.InteropServices.WindowsRuntime"> + <Docs> + <summary>To be added.</summary> + <remarks>To be added.</remarks> + </Docs> +</Namespace> diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile index 0cf61b786f..3000f81971 100644 --- a/mcs/class/corlib/Makefile +++ b/mcs/class/corlib/Makefile @@ -106,8 +106,8 @@ $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE): %.resources: %.resx TEST_RESOURCES = $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE) -satellite_assembly1 = es-ES/$(patsubst %.dll,%.Resources.dll,$(test_lib)) -satellite_assembly2 = nn-NO/$(patsubst %.dll,%.Resources.dll,$(test_lib)) +satellite_assembly1 = es-ES/$(patsubst %.dll,%.resources.dll,$(test_lib)) +satellite_assembly2 = nn-NO/$(patsubst %.dll,%.resources.dll,$(test_lib)) $(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) @@ -140,7 +140,9 @@ $(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe: $(vtsdir)/Bina $(vtsdir)/BinarySerializationOverVersions.cs -out:$@ @cp $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(vtsdir)/$(PROFILE)_TestLib -# Need to define MONO_PATH to an absolute dir since the test is ran from a subdir +# Need to define TEST_MONO_PATH to an absolute dir since the test is ran from a subdir +TEST_MONO_PATH=$(PWD)/../lib/$(PROFILE) + run-test-vts: test-vts @echo Running vts tests... PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) -noshadow \ diff --git a/mcs/class/corlib/System.Collections.Concurrent/ConcurrentDictionary.cs b/mcs/class/corlib/System.Collections.Concurrent/ConcurrentDictionary.cs index bb8e99f704..a52ced14f8 100644 --- a/mcs/class/corlib/System.Collections.Concurrent/ConcurrentDictionary.cs +++ b/mcs/class/corlib/System.Collections.Concurrent/ConcurrentDictionary.cs @@ -35,6 +35,7 @@ namespace System.Collections.Concurrent { [DebuggerDisplay ("Count={Count}")] [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))] + [Serializable] public class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable diff --git a/mcs/class/corlib/System.Collections.Generic/List.cs b/mcs/class/corlib/System.Collections.Generic/List.cs index 17056a1b21..840984f04f 100644 --- a/mcs/class/corlib/System.Collections.Generic/List.cs +++ b/mcs/class/corlib/System.Collections.Generic/List.cs @@ -69,7 +69,7 @@ namespace System.Collections.Generic { AddEnumerable (collection); } else { _size = c.Count; - _items = new T [Math.Max (_size, DefaultCapacity)]; + _items = new T [_size]; c.CopyTo (_items, 0); } } @@ -116,6 +116,18 @@ namespace System.Collections.Generic { throw new ArgumentException ("index and count exceed length of list"); } + void CheckRangeOutOfRange (int idx, int count) + { + if (idx < 0) + throw new ArgumentOutOfRangeException ("index"); + + if (count < 0) + throw new ArgumentOutOfRangeException ("count"); + + if ((uint) idx + (uint) count > (uint) _size) + throw new ArgumentOutOfRangeException ("index and count exceed length of list"); + } + void AddCollection (ICollection <T> collection) { int collectionCount = collection.Count; @@ -212,14 +224,27 @@ namespace System.Collections.Generic { public bool Exists (Predicate <T> match) { CheckMatch(match); - return GetIndex(0, _size, match) != -1; + + for (int i = 0; i < _size; i++) { + var item = _items [i]; + if (match (item)) + return true; + } + + return false; } public T Find (Predicate <T> match) { CheckMatch(match); - int i = GetIndex(0, _size, match); - return (i != -1) ? _items [i] : default (T); + + for (int i = 0; i < _size; i++) { + var item = _items [i]; + if (match (item)) + return item; + } + + return default (T); } static void CheckMatch (Predicate <T> match) @@ -296,68 +321,56 @@ namespace System.Collections.Generic { public int FindIndex (Predicate <T> match) { CheckMatch (match); - return GetIndex (0, _size, match); + return Array.GetIndex (_items, 0, _size, match); } public int FindIndex (int startIndex, Predicate <T> match) { CheckMatch (match); - CheckIndex (startIndex); - return GetIndex (startIndex, _size - startIndex, match); + CheckStartIndex (startIndex); + return Array.GetIndex (_items, startIndex, _size - startIndex, match); } public int FindIndex (int startIndex, int count, Predicate <T> match) { CheckMatch (match); - CheckRange (startIndex, count); - return GetIndex (startIndex, count, match); - } - int GetIndex (int startIndex, int count, Predicate <T> match) - { - int end = startIndex + count; - for (int i = startIndex; i < end; i ++) - if (match (_items [i])) - return i; - - return -1; + CheckRangeOutOfRange (startIndex, count); + return Array.GetIndex (_items, startIndex, count, match); } public T FindLast (Predicate <T> match) { CheckMatch (match); - int i = GetLastIndex (0, _size, match); + int i = Array.GetLastIndex (_items, 0, _size, match); return i == -1 ? default (T) : this [i]; } public int FindLastIndex (Predicate <T> match) { CheckMatch (match); - return GetLastIndex (0, _size, match); + return Array.GetLastIndex (_items, 0, _size, match); } public int FindLastIndex (int startIndex, Predicate <T> match) { CheckMatch (match); - CheckIndex (startIndex); - return GetLastIndex (0, startIndex + 1, match); + CheckStartIndex (startIndex); + return Array.GetLastIndex (_items, 0, startIndex + 1, match); } public int FindLastIndex (int startIndex, int count, Predicate <T> match) { CheckMatch (match); - int start = startIndex - count + 1; - CheckRange (start, count); - return GetLastIndex (start, count, match); - } + CheckStartIndex (startIndex); + + if (count < 0) + throw new ArgumentOutOfRangeException ("count"); - int GetLastIndex (int startIndex, int count, Predicate <T> match) - { - // unlike FindLastIndex, takes regular params for search range - for (int i = startIndex + count; i != startIndex;) - if (match (_items [--i])) - return i; - return -1; + if (startIndex - count + 1 < 0) + throw new ArgumentOutOfRangeException ("count must refer to a location within the collection"); + + return Array.GetLastIndex (_items, startIndex - count + 1, count, match); } - + public void ForEach (Action <T> action) { if (action == null) @@ -423,6 +436,12 @@ namespace System.Collections.Generic { if (index < 0 || (uint) index > (uint) _size) throw new ArgumentOutOfRangeException ("index"); } + + void CheckStartIndex (int index) + { + if (index < 0 || (uint) index > (uint) _size) + throw new ArgumentOutOfRangeException ("startIndex"); + } public void Insert (int index, T item) { diff --git a/mcs/class/corlib/System.Collections/CollectionBase.cs b/mcs/class/corlib/System.Collections/CollectionBase.cs index 75817380b1..d3f6a40ea9 100644 --- a/mcs/class/corlib/System.Collections/CollectionBase.cs +++ b/mcs/class/corlib/System.Collections/CollectionBase.cs @@ -37,6 +37,8 @@ namespace System.Collections { [ComVisible(true)] [Serializable] + [System.Diagnostics.DebuggerDisplay ("Count={Count}")] + [System.Diagnostics.DebuggerTypeProxy (typeof (CollectionDebuggerView))] #if INSIDE_CORLIB public #else diff --git a/mcs/class/corlib/System.Diagnostics/DebuggerTypeProxyAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggerTypeProxyAttribute.cs index 92ccb86c90..637636e75d 100644 --- a/mcs/class/corlib/System.Diagnostics/DebuggerTypeProxyAttribute.cs +++ b/mcs/class/corlib/System.Diagnostics/DebuggerTypeProxyAttribute.cs @@ -1,8 +1,9 @@ // // System.Diagnostics.DebuggerTypeProxyAttribute.cs // -// Author: +// Authors: // Chris Toshok (toshok@novell.com) +// Marek Safar (marek.safar@gmail.com) // // @@ -46,8 +47,12 @@ namespace System.Diagnostics { proxy_type_name = typeName; } - public DebuggerTypeProxyAttribute (Type type) { - proxy_type_name = type.Name; + public DebuggerTypeProxyAttribute (Type type) + { + if (type == null) + throw new ArgumentNullException ("type"); + + proxy_type_name = type.AssemblyQualifiedName; } public string ProxyTypeName { diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs index f93cac3933..131254f422 100644 --- a/mcs/class/corlib/System.Globalization/CultureInfo.cs +++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs @@ -44,7 +44,7 @@ namespace System.Globalization { static volatile CultureInfo invariant_culture_info = new CultureInfo (InvariantCultureId, false, true); static object shared_table_lock = new object (); - internal static int BootstrapCultureID; + static CultureInfo default_current_culture; #pragma warning disable 169, 649 bool m_isReadOnly; @@ -99,7 +99,7 @@ namespace System.Globalization // Used by Thread.set_CurrentCulture internal byte[] cached_serialized_form; - const int InvariantCultureId = 0x7F; + internal const int InvariantCultureId = 0x7F; const int CalendarTypeBits = 8; const string MSG_READONLY = "This instance is read only"; @@ -124,10 +124,24 @@ namespace System.Globalization internal static CultureInfo ConstructCurrentCulture () { - CultureInfo ci = new CultureInfo (); - if (!ConstructInternalLocaleFromCurrentLocale (ci)) + if (default_current_culture != null) + return default_current_culture; + + var locale_name = get_current_locale_name (); + CultureInfo ci = null; + try { + ci = CreateSpecificCulture (locale_name); + } catch { + } + + if (ci == null) { ci = InvariantCulture; - BootstrapCultureID = ci.cultureID; + } else { + ci.m_isReadOnly = true; + ci.m_useUserOverride = true; + } + + default_current_culture = ci; return ci; } @@ -535,9 +549,10 @@ namespace System.Globalization } } - public static CultureInfo InstalledUICulture - { - get { return GetCultureInfo (BootstrapCultureID); } + public static CultureInfo InstalledUICulture { + get { + return ConstructCurrentCulture (); + } } public bool IsReadOnly { @@ -568,24 +583,14 @@ namespace System.Globalization constructed = true; } - static bool ConstructInternalLocaleFromCurrentLocale (CultureInfo ci) - { - if (!construct_internal_locale_from_current_locale (ci)) - return false; - return true; - } - [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern bool construct_internal_locale_from_lcid (int lcid); [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern bool construct_internal_locale_from_name (string name); -// [MethodImplAttribute (MethodImplOptions.InternalCall)] -// private extern static bool construct_internal_locale_from_specific_name (CultureInfo ci, string name); - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern static bool construct_internal_locale_from_current_locale (CultureInfo ci); + private extern static string get_current_locale_name (); [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static CultureInfo [] internal_get_cultures (bool neutral, bool specific, bool installed); @@ -678,13 +683,7 @@ namespace System.Globalization } if (!construct_internal_locale_from_name (name.ToLowerInvariant ())) { -#if NET_4_0 - throw new CultureNotFoundException ("name", - "Culture name " + name + " is not supported."); -#else - throw new ArgumentException ("Culture name " + name + - " is not supported.", "name"); -#endif + throw CreateNotFoundException (name); } } @@ -789,28 +788,20 @@ namespace System.Globalization if (name.Length == 0) return InvariantCulture; - CultureInfo ci = null; - try { - ci = new CultureInfo (name); - } catch (Exception) { - // TODO: Use construct_internal_locale_from_name when it's not bound to constructor instead - // of try-catch + var src_name = name; + name = name.ToLowerInvariant (); + CultureInfo ci = new CultureInfo (); + + if (!ci.construct_internal_locale_from_name (name)) { int idx = name.IndexOf ('-'); - if (idx > 0) { - try { - ci = new CultureInfo (name.Substring (0, idx)); - } catch { - } - } - - if (ci == null) - throw; + if (idx < 1 || !ci.construct_internal_locale_from_name (name.Substring (0, idx))) + throw CreateNotFoundException (src_name); } - if (!ci.IsNeutralCulture) - return ci; + if (ci.IsNeutralCulture) + ci = CreateSpecificCultureFromNeutral (ci.Name); - return CreateSpecificCultureFromNeutral (ci.Name); + return ci; } // @@ -1007,25 +998,32 @@ namespace System.Globalization return CreateCalendar (1 << CalendarTypeBits); // return invariant calandar if not found return (Calendar) Activator.CreateInstance (type); } + + static Exception CreateNotFoundException (string name) + { +#if NET_4_0 + return new CultureNotFoundException ("name", "Culture name " + name + " is not supported."); +#else + return new ArgumentException ("Culture name " + name + " is not supported.", "name"); +#endif + } #if NET_4_5 - [MonoTODO] public static CultureInfo DefaultThreadCurrentCulture { get { - throw new NotImplementedException (); + return Thread.default_culture; } set { - throw new NotImplementedException (); + Thread.default_culture = value; } } - [MonoTODO] public static CultureInfo DefaultThreadCurrentUICulture { get { - throw new NotImplementedException (); + return Thread.default_ui_culture; } set { - throw new NotImplementedException (); + Thread.default_ui_culture = value; } } #endif diff --git a/mcs/class/corlib/System.Globalization/RegionInfo.cs b/mcs/class/corlib/System.Globalization/RegionInfo.cs index b6165a661d..4f11e37791 100644 --- a/mcs/class/corlib/System.Globalization/RegionInfo.cs +++ b/mcs/class/corlib/System.Globalization/RegionInfo.cs @@ -39,21 +39,15 @@ namespace System.Globalization { static RegionInfo currentRegion; - // This property is not synchronized with CurrentCulture, so - // we need to use bootstrap CurrentCulture LCID. public static RegionInfo CurrentRegion { get { if (currentRegion == null) { - // make sure to fill BootstrapCultureID. CultureInfo ci = CultureInfo.CurrentCulture; - // If current culture is invariant then region is not available. - if (ci != null && CultureInfo.BootstrapCultureID != 0x7F) - currentRegion = new RegionInfo (CultureInfo.BootstrapCultureID); - else + if (ci != null) + return currentRegion = new RegionInfo (ci); + #if MONOTOUCH - currentRegion = CreateFromNSLocale (); -#else - currentRegion = null; + currentRegion = CreateFromNSLocale (); #endif } return currentRegion; @@ -94,6 +88,26 @@ namespace System.Globalization throw new ArgumentException (String.Format ("Region name {0} is not supported.", name), "name"); } + RegionInfo (CultureInfo ci) + { + if (ci.LCID == CultureInfo.InvariantCultureId) { + regionId = 244; + iso2Name = "IV"; + iso3Name = "ivc"; + win3Name = "IVC"; + nativeName = englishName = "Invariant Country"; + currencySymbol = "\u00A4"; + isoCurrencySymbol ="XDR"; + currencyEnglishName = currencyNativeName = "International Monetary Fund"; + return; + } + + if (ci.Territory == null) + throw new NotImplementedException ("Neutral region info"); + + construct_internal_region_from_name (ci.Territory.ToUpperInvariant ()); + } + bool GetByTerritory (CultureInfo ci) { if (ci == null) diff --git a/mcs/class/corlib/System.Globalization/TextInfo.cs b/mcs/class/corlib/System.Globalization/TextInfo.cs index cd4b95be98..56493a3436 100644 --- a/mcs/class/corlib/System.Globalization/TextInfo.cs +++ b/mcs/class/corlib/System.Globalization/TextInfo.cs @@ -225,10 +225,12 @@ namespace System.Globalization { // then don't capitalize it. int saved = i; while (++i < str.Length) { - if (Char.IsWhiteSpace (str [i])) + var ch = str [i]; + var category = char.GetUnicodeCategory (ch); + if (IsSeparator (category)) break; - t = ToTitleCase (str [i]); - if (t != str [i]) { + t = ToTitleCase (ch); + if (t != ch) { allTitle = false; break; } @@ -242,9 +244,11 @@ namespace System.Globalization { // where we don't have to modify // the source word. while (++i < str.Length) { - if (Char.IsWhiteSpace (str [i])) + var ch = str [i]; + var category = char.GetUnicodeCategory (ch); + if (IsSeparator (category)) break; - if (ToLower (str [i]) != str [i]) { + if (ToLower (ch) != ch) { capitalize = true; i = saved; break; @@ -259,9 +263,11 @@ namespace System.Globalization { sb.Append (ToTitleCase (str [i])); start = i + 1; while (++i < str.Length) { - if (Char.IsWhiteSpace (str [i])) + var ch = str [i]; + var category = char.GetUnicodeCategory (ch); + if (IsSeparator (category)) break; - sb.Append (ToLower (str [i])); + sb.Append (ToLower (ch)); } start = i; } @@ -272,6 +278,27 @@ namespace System.Globalization { return sb != null ? sb.ToString () : str; } + static bool IsSeparator (UnicodeCategory category) + { + switch (category) { + case UnicodeCategory.SpaceSeparator: + case UnicodeCategory.LineSeparator: + case UnicodeCategory.ParagraphSeparator: + case UnicodeCategory.Control: + case UnicodeCategory.Format: + case UnicodeCategory.ConnectorPunctuation: + case UnicodeCategory.DashPunctuation: + case UnicodeCategory.OpenPunctuation: + case UnicodeCategory.ClosePunctuation: + case UnicodeCategory.InitialQuotePunctuation: + case UnicodeCategory.FinalQuotePunctuation: + case UnicodeCategory.OtherPunctuation: + return true; + } + + return false; + } + // Only Azeri and Turkish have their own special cases. // Other than them, all languages have common special case // (enumerable enough). diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs index 3eeb79195b..a1a6d12130 100644 --- a/mcs/class/corlib/System.IO/Path.cs +++ b/mcs/class/corlib/System.IO/Path.cs @@ -289,9 +289,8 @@ namespace System.IO { return fullpath; } - [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] // http://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.aspx - // http://www.codeproject.com/Tips/223321/Win32-API-GetFullPathName + [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] private static extern int GetFullPathName(string path, int numBufferChars, StringBuilder buffer, ref IntPtr lpFilePartOrNull); internal static string GetFullPathName(string path) diff --git a/mcs/class/corlib/System.IO/Stream.cs b/mcs/class/corlib/System.IO/Stream.cs index fecea2d8b7..d718e1fb05 100644 --- a/mcs/class/corlib/System.IO/Stream.cs +++ b/mcs/class/corlib/System.IO/Stream.cs @@ -303,7 +303,7 @@ namespace System.IO async Task CopyToAsync (Stream destination, byte[] buffer, CancellationToken cancellationToken) { int nread; - while ((nread = await ReadAsync (buffer, 0, buffer.Length).ConfigureAwait (false)) != 0) + while ((nread = await ReadAsync (buffer, 0, buffer.Length, cancellationToken).ConfigureAwait (false)) != 0) await destination.WriteAsync (buffer, 0, nread, cancellationToken).ConfigureAwait (false); } diff --git a/mcs/class/corlib/System.Reflection/MonoParameterInfo.cs b/mcs/class/corlib/System.Reflection/MonoParameterInfo.cs index 327166e448..ce4fdda324 100644 --- a/mcs/class/corlib/System.Reflection/MonoParameterInfo.cs +++ b/mcs/class/corlib/System.Reflection/MonoParameterInfo.cs @@ -236,5 +236,20 @@ namespace System.Reflection return Type.EmptyTypes; return types; } + +#if NET_4_5 + public override bool HasDefaultValue { + get { + object defaultValue = DefaultValue; + if (defaultValue == null) + return true; + + if (defaultValue.GetType () == typeof(DBNull) || defaultValue.GetType () == typeof(Missing)) + return false; + + return true; + } + } +#endif } } diff --git a/mcs/class/corlib/System.Reflection/MonoProperty.cs b/mcs/class/corlib/System.Reflection/MonoProperty.cs index eb1aa06efe..24dcf8b747 100644 --- a/mcs/class/corlib/System.Reflection/MonoProperty.cs +++ b/mcs/class/corlib/System.Reflection/MonoProperty.cs @@ -299,7 +299,7 @@ namespace System.Reflection { { if (index == null || index.Length == 0) { /*FIXME we should check if the number of arguments matches the expected one, otherwise the error message will be pretty criptic.*/ -#if !MONOTOUCH +#if !FULL_AOT_RUNTIME if (cached_getter == null) { MethodInfo method = GetGetMethod (true); if (!DeclaringType.IsValueType && !method.ContainsGenericParameters) { //FIXME find a way to build an invoke delegate for value types. diff --git a/mcs/class/corlib/System.Reflection/ParameterInfo.cs b/mcs/class/corlib/System.Reflection/ParameterInfo.cs index 890dffd3b2..1c00fb96c1 100644 --- a/mcs/class/corlib/System.Reflection/ParameterInfo.cs +++ b/mcs/class/corlib/System.Reflection/ParameterInfo.cs @@ -193,8 +193,7 @@ namespace System.Reflection public virtual IEnumerable<CustomAttributeData> CustomAttributes { get { return GetCustomAttributesData (); } } - - [MonoTODO] + public virtual bool HasDefaultValue { get { throw new NotImplementedException (); } } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs index 197ece5adc..cdb7a33db1 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs @@ -69,20 +69,15 @@ namespace System.Runtime.CompilerServices public static AsyncTaskMethodBuilder Create () { - var task = new Task<object> (TaskActionInvoker.Empty, null, CancellationToken.None, TaskCreationOptions.None, null); + var task = new Task<object> (TaskActionInvoker.Promise, null, CancellationToken.None, TaskCreationOptions.None, null); task.SetupScheduler (TaskScheduler.Current); return new AsyncTaskMethodBuilder (task); } public void SetException (Exception exception) { - if (exception is OperationCanceledException) { - if (Task.TrySetCanceled ()) - return; - } else { - if (Task.TrySetException (new AggregateException (exception))) - return; - } + if (Task.TrySetException (new AggregateException (exception), exception is OperationCanceledException, true)) + return; throw new InvalidOperationException ("The task has already completed"); } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs index f955d6b9fd..9d539dfc42 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs @@ -69,20 +69,15 @@ namespace System.Runtime.CompilerServices public static AsyncTaskMethodBuilder<TResult> Create () { - var task = new Task<TResult> (TaskActionInvoker.Empty, null, CancellationToken.None, TaskCreationOptions.None, null); + var task = new Task<TResult> (TaskActionInvoker.Promise, null, CancellationToken.None, TaskCreationOptions.None, null); task.SetupScheduler (TaskScheduler.Current); return new AsyncTaskMethodBuilder<TResult> (task); } public void SetException (Exception exception) { - if (exception is OperationCanceledException) { - if (Task.TrySetCanceled ()) - return; - } else { - if (Task.TrySetException (new AggregateException (exception))) - return; - } + if (Task.TrySetException (new AggregateException (exception), exception is OperationCanceledException, true)) + return; throw new InvalidOperationException ("The task has already completed"); } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs b/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs index 1252d062b5..838b31c55d 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs @@ -28,6 +28,7 @@ #if NET_4_5 +using System.Threading; using System.Threading.Tasks; using System.Runtime.ExceptionServices; @@ -54,6 +55,9 @@ namespace System.Runtime.CompilerServices public void GetResult () { + if (!task.IsCompleted) + task.WaitCore (Timeout.Infinite, CancellationToken.None, true); + if (task.Status != TaskStatus.RanToCompletion) ExceptionDispatchInfo.Capture (TaskAwaiter.HandleUnexpectedTaskResult (task)).Throw (); } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs b/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs index 380c05f3fe..b96b1cc6f3 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs @@ -28,6 +28,7 @@ #if NET_4_5 +using System.Threading; using System.Threading.Tasks; using System.Runtime.ExceptionServices; @@ -54,6 +55,9 @@ namespace System.Runtime.CompilerServices public TResult GetResult () { + if (!task.IsCompleted) + task.WaitCore (Timeout.Infinite, CancellationToken.None, true); + if (task.Status != TaskStatus.RanToCompletion) ExceptionDispatchInfo.Capture (TaskAwaiter.HandleUnexpectedTaskResult (task)).Throw (); diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs b/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs index ab2c8cadd6..5f857d2796 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs @@ -53,7 +53,7 @@ namespace System.Runtime.CompilerServices public void GetResult () { if (!task.IsCompleted) - task.WaitCore (Timeout.Infinite, CancellationToken.None); + task.WaitCore (Timeout.Infinite, CancellationToken.None, true); if (task.Status != TaskStatus.RanToCompletion) // Merge current and dispatched stack traces if there is any @@ -64,20 +64,47 @@ namespace System.Runtime.CompilerServices { switch (task.Status) { case TaskStatus.Canceled: + // Use original exception when we have one + if (task.ExceptionSlot.Exception != null) + goto case TaskStatus.Faulted; + return new TaskCanceledException (task); case TaskStatus.Faulted: - return task.Exception.InnerException; + return task.ExceptionSlot.Exception.InnerException; default: - throw new ArgumentException ("Should never be reached"); + throw new ArgumentException (string.Format ("Unexpected task `{0}' status `{1}'", task.Id, task.Status)); } } internal static void HandleOnCompleted (Task task, Action continuation, bool continueOnSourceContext, bool manageContext) { - if (continueOnSourceContext && SynchronizationContext.Current != null) { + if (continueOnSourceContext && SynchronizationContext.Current != null && SynchronizationContext.Current.GetType () != typeof (SynchronizationContext)) { task.ContinueWith (new SynchronizationContextContinuation (continuation, SynchronizationContext.Current)); } else { - task.ContinueWith (new ActionContinuation (continuation)); + IContinuation cont; + Task cont_task; + if (continueOnSourceContext && !TaskScheduler.IsDefault) { + cont_task = new Task (TaskActionInvoker.Create (continuation), null, CancellationToken.None, TaskCreationOptions.None, null); + cont_task.SetupScheduler (TaskScheduler.Current); + cont = new SchedulerAwaitContinuation (cont_task); + } else { + cont_task = null; + cont = new AwaiterActionContinuation (continuation); + } + + // + // This is awaiter continuation. For finished tasks we get false result and need to + // queue the continuation otherwise the task would block + // + if (task.ContinueWith (cont, false)) + return; + + if (cont_task == null) { + cont_task = new Task (TaskActionInvoker.Create (continuation), null, CancellationToken.None, TaskCreationOptions.None, null); + cont_task.SetupScheduler (TaskScheduler.Current); + } + + cont_task.Schedule (); } } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs b/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs index f12db5fe57..b59a0ef005 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs @@ -53,7 +53,7 @@ namespace System.Runtime.CompilerServices public TResult GetResult () { if (!task.IsCompleted) - task.WaitCore (Timeout.Infinite, CancellationToken.None); + task.WaitCore (Timeout.Infinite, CancellationToken.None, true); if (task.Status != TaskStatus.RanToCompletion) ExceptionDispatchInfo.Capture (TaskAwaiter.HandleUnexpectedTaskResult (task)).Throw (); diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/YieldAwaitable.cs b/mcs/class/corlib/System.Runtime.CompilerServices/YieldAwaitable.cs index 9376526952..3ba0446cd4 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/YieldAwaitable.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/YieldAwaitable.cs @@ -60,12 +60,12 @@ namespace System.Runtime.CompilerServices throw new ArgumentNullException ("continuation"); var ctx = SynchronizationContext.Current; - if (ctx != null) { + if (ctx != null && ctx.GetType () != typeof (SynchronizationContext)) { ctx.Post (l => ((Action) l) (), continuation); return; } - if (TaskScheduler.Current == TaskScheduler.Default) { + if (TaskScheduler.IsDefault) { // // Pass continuation as an argument to avoid allocating // hoisting class diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs new file mode 100644 index 0000000000..284839e093 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs @@ -0,0 +1,46 @@ +#if NET_4_5 +// +// DefaultInterfaceAttribute.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] + public sealed class DefaultInterfaceAttribute : Attribute + { + public Type DefaultInterface { + get; + private set; + } + + public DefaultInterfaceAttribute (Type defaultInterface) + { + DefaultInterface = defaultInterface; + } + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs new file mode 100644 index 0000000000..33dbc8343d --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs @@ -0,0 +1,53 @@ +#if NET_4_5 +// +// DesignerNamespaceResolveEventArgs.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Collections.ObjectModel; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [ComVisibleAttribute(false)] + public class DesignerNamespaceResolveEventArgs : EventArgs + { + public DesignerNamespaceResolveEventArgs (string namespaceName) + { + NamespaceName = namespaceName; + ResolvedAssemblyFiles = new Collection<string> (); + } + + public string NamespaceName { + get; + private set; + } + + public Collection<string> ResolvedAssemblyFiles { + get; + private set; + } + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs new file mode 100644 index 0000000000..35d4161d3c --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs @@ -0,0 +1,59 @@ +#if NET_4_5 +// +// EventRegistrationToken.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + public struct EventRegistrationToken + { +#pragma warning disable 0649 + long value; +#pragma warning restore 0649 + + public static bool operator == (EventRegistrationToken left, EventRegistrationToken right) + { + return left.value == right.value; + } + + public static bool operator != (EventRegistrationToken left, EventRegistrationToken right) + { + return left.value != right.value; + } + + public override bool Equals (object obj) + { + return ((EventRegistrationToken)obj).value == value; + } + + public override int GetHashCode () + { + return unchecked ((int)value); + } + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs new file mode 100644 index 0000000000..e4d7623f22 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs @@ -0,0 +1,68 @@ +#if NET_4_5 +// +// EventRegistrationTokenTable.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [MonoTODO] + public sealed class EventRegistrationTokenTable<T> + where T : class + { + public EventRegistrationTokenTable () + { + throw new NotImplementedException (); + } + + public T InvocationList { + get { throw new NotImplementedException (); } + set { throw new NotImplementedException (); } + } + + public EventRegistrationToken AddEventHandler (T handler) + { + throw new NotImplementedException (); + } + + public static EventRegistrationTokenTable<T> GetOrCreateEventRegistrationTokenTable(ref EventRegistrationTokenTable<T> refEventTable) + { + throw new NotImplementedException (); + } + + public void RemoveEventHandler (T handler) + { + throw new NotImplementedException (); + } + + public void RemoveEventHandler (EventRegistrationToken token) + { + throw new NotImplementedException (); + } + } +} +#endif + diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs new file mode 100644 index 0000000000..e7d010d1b7 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs @@ -0,0 +1,38 @@ +#if NET_4_5 +// +// IActivationFactory.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [Guid("00000035-0000-0000-C000-000000000046")] + public interface IActivationFactory + { + object ActivateInstance (); + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs new file mode 100644 index 0000000000..995019325e --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs @@ -0,0 +1,71 @@ +#if NET_4_5 +// +// InterfaceImplementedInVersionAttribute.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] + public sealed class InterfaceImplementedInVersionAttribute : Attribute + { + public InterfaceImplementedInVersionAttribute (Type interfaceType, byte majorVersion, byte minorVersion, + byte buildVersion, byte revisionVersion) + { + InterfaceType = interfaceType; + MajorVersion = majorVersion; + MinorVersion = minorVersion; + BuildVersion = buildVersion; + RevisionVersion = revisionVersion; + } + + public byte BuildVersion { + get; + private set; + } + + public Type InterfaceType { + get; + private set; + } + + public byte MajorVersion { + get; + private set; + } + + public byte MinorVersion { + get; + private set; + } + + public byte RevisionVersion { + get; + private set; + } + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs new file mode 100644 index 0000000000..f57569b2bb --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs @@ -0,0 +1,60 @@ +#if NET_4_5 +// +// NamespaceResolveEventArgs.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Reflection; +using System.Collections.ObjectModel; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [ComVisibleAttribute(false)] + public class NamespaceResolveEventArgs : EventArgs + { + public NamespaceResolveEventArgs (string namespaceName, Assembly requestingAssembly) + { + NamespaceName = namespaceName; + RequestingAssembly = requestingAssembly; + ResolvedAssemblies = new Collection<Assembly> (); + } + + public string NamespaceName { + get; + private set; + } + + public Assembly RequestingAssembly { + get; + private set; + } + + public Collection<Assembly> ResolvedAssemblies { + get; + private set; + } + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs new file mode 100644 index 0000000000..0c5ecc3d9e --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs @@ -0,0 +1,37 @@ +#if NET_4_5 +// +// ReadOnlyArrayAttribute.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)] + public sealed class ReadOnlyArrayAttribute : Attribute + { + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs new file mode 100644 index 0000000000..8fd0173157 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs @@ -0,0 +1,44 @@ +// +// ReturnValueNameAttribute.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [AttributeUsageAttribute(AttributeTargets.Delegate|AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = false)] + public sealed class ReturnValueNameAttribute : Attribute + { + public ReturnValueNameAttribute (string name) + { + Name = name; + } + + public string Name { + get; + private set; + } + } +} diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs new file mode 100644 index 0000000000..fc24594805 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs @@ -0,0 +1,72 @@ +#if NET_4_5 +// +// WindowsRuntimeMarshal.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [MonoTODO] + public static class WindowsRuntimeMarshal + { + public static void AddEventHandler<T> ( Func<T, EventRegistrationToken> addMethod, Action<EventRegistrationToken> removeMethod, T handler) + { + throw new NotImplementedException (); + } + + public static void FreeHString (IntPtr ptr) + { + throw new NotImplementedException (); + } + + public static IActivationFactory GetActivationFactory (Type type) + { + throw new NotImplementedException (); + } + + public static string PtrToStringHString (IntPtr ptr) + { + throw new NotImplementedException (); + } + + public static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod) + { + throw new NotImplementedException (); + } + + public static void RemoveEventHandler<T> (Action<EventRegistrationToken> removeMethod, T handler) + { + throw new NotImplementedException (); + } + + public static IntPtr StringToHString (string s) + { + throw new NotImplementedException (); + } + } +} +#endif + diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs new file mode 100644 index 0000000000..445733626c --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs @@ -0,0 +1,53 @@ +#if NET_4_5 +// +// WindowsRuntimeMetadata.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [MonoTODO] + public static class WindowsRuntimeMetadata + { + public static IEnumerable<string> ResolveNamespace (string namespaceName, IEnumerable<string> packageGraphFilePaths) + { + throw new NotImplementedException (); + } + + public static IEnumerable<string> ResolveNamespace (string namespaceName, string windowsSdkFilePath, IEnumerable<string> packageGraphFilePaths) + { + throw new NotImplementedException (); + } + +#pragma warning disable 0067 + public static event EventHandler<DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve; + public static event EventHandler<NamespaceResolveEventArgs> ReflectionOnlyNamespaceResolve; +#pragma warning restore 0067 + } +} +#endif + diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs new file mode 100644 index 0000000000..7d5e461494 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs @@ -0,0 +1,37 @@ +#if NET_4_5 +// +// WriteOnlyArrayAttribute.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.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. +using System; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.WindowsRuntime +{ + [AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)] + public sealed class WriteOnlyArrayAttribute : Attribute + { + } +} +#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs index a3134933a3..a66a8dc7ae 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs @@ -187,6 +187,12 @@ namespace System.Runtime.InteropServices throw new NotImplementedException (); } +#if NET_4_5 + public static IntPtr CreateAggregatedObject<T> (IntPtr pOuter, T o) { + return CreateAggregatedObject (pOuter, (object)o); + } +#endif + #if !FULL_AOT_RUNTIME public static object CreateWrapperOfType (object o, Type t) { @@ -204,12 +210,24 @@ namespace System.Runtime.InteropServices return ComInteropProxy.GetProxy (co.IUnknown, t).GetTransparentProxy (); } + +#if NET_4_5 + public static TWrapper CreateWrapperOfType<T, TWrapper> (T o) { + return (TWrapper)CreateWrapperOfType ((object)o, typeof (TWrapper)); + } +#endif #endif [MethodImplAttribute(MethodImplOptions.InternalCall)] [ComVisible (true)] public extern static void DestroyStructure (IntPtr ptr, Type structuretype); +#if NET_4_5 + public static void DestroyStructure<T> (IntPtr ptr) { + DestroyStructure (ptr, typeof (T)); + } +#endif + [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static void FreeBSTR (IntPtr ptr); @@ -329,6 +347,12 @@ namespace System.Runtime.InteropServices #endif } +#if NET_4_5 + public static IntPtr GetComInterfaceForObject<T, TInterface> (T o) { + return GetComInterfaceForObject ((object)o, typeof (T)); + } +#endif + [MonoTODO] public static IntPtr GetComInterfaceForObjectInContext (object o, Type t) { @@ -463,6 +487,12 @@ namespace System.Runtime.InteropServices Marshal.StructureToPtr(vt, pDstNativeVariant, false); } +#if NET_4_5 + public static void GetNativeVariantForObject<T> (T obj, IntPtr pDstNativeVariant) { + GetNativeVariantForObject ((object)obj, pDstNativeVariant); + } +#endif + #if !MOBILE [MethodImplAttribute (MethodImplOptions.InternalCall)] private static extern object GetObjectForCCW (IntPtr pUnk); @@ -489,6 +519,13 @@ namespace System.Runtime.InteropServices return vt.GetValue(); } +#if NET_4_5 + public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant) { + Variant vt = (Variant)Marshal.PtrToStructure(pSrcNativeVariant, typeof(Variant)); + return (T)vt.GetValue(); + } +#endif + public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars) { if (cVars < 0) @@ -500,6 +537,18 @@ namespace System.Runtime.InteropServices return objects; } +#if NET_4_5 + public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars) { + if (cVars < 0) + throw new ArgumentOutOfRangeException ("cVars", "cVars cannot be a negative number."); + T[] objects = new T[cVars]; + for (int i = 0; i < cVars; i++) + objects[i] = GetObjectForNativeVariant<T> ((IntPtr)(aSrcNativeVariant.ToInt64 () + + i * SizeOf (typeof(Variant)))); + return objects; + } +#endif + [MonoTODO] public static int GetStartComSlot (Type t) { @@ -639,6 +688,12 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static IntPtr OffsetOf (Type t, string fieldName); +#if NET_4_5 + public static IntPtr OffsetOf<T> (string fieldName) { + return OffsetOf (typeof (T), fieldName); + } +#endif + [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static void Prelink (MethodInfo m); @@ -687,6 +742,16 @@ namespace System.Runtime.InteropServices [ComVisible (true)] public extern static object PtrToStructure (IntPtr ptr, Type structureType); +#if NET_4_5 + public static void PtrToStructure<T> (IntPtr ptr, T structure) { + PtrToStructure (ptr, (object)structure); + } + + public static object PtrToStructure<T> (IntPtr ptr) { + return PtrToStructure (ptr, typeof (T)); + } +#endif + #if !MOBILE [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static int QueryInterfaceInternal (IntPtr pUnk, ref Guid iid, out IntPtr ppv); @@ -913,6 +978,16 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static int SizeOf (Type t); +#if NET_4_5 + public static int SizeOf<T> () { + return SizeOf (typeof (T)); + } + + public static int SizeOf<T> (T structure) { + return SizeOf (structure.GetType ()); + } +#endif + [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static IntPtr StringToBSTR (string s); @@ -1059,6 +1134,12 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static void StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld); +#if NET_4_5 + public static void StructureToPtr<T> (T structure, IntPtr ptr, bool fDeleteOld) { + StructureToPtr ((object)structure, ptr, fDeleteOld); + } +#endif + public static void ThrowExceptionForHR (int errorCode) { Exception ex = GetExceptionForHR (errorCode); if (ex != null) @@ -1074,6 +1155,12 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static IntPtr UnsafeAddrOfPinnedArrayElement (Array arr, int index); +#if NET_4_5 + public static IntPtr UnsafeAddrOfPinnedArrayElement<T> (T[] arr, int index) { + return UnsafeAddrOfPinnedArrayElement ((Array)arr, index); + } +#endif + public static void WriteByte (IntPtr ptr, byte val) { unsafe { @@ -1266,6 +1353,12 @@ namespace System.Runtime.InteropServices return GetDelegateForFunctionPointerInternal (ptr, t); } +#if NET_4_5 + public static Delegate GetDelegateForFunctionPointer<T> (IntPtr ptr) { + return GetDelegateForFunctionPointer (ptr, typeof (T)); + } +#endif + [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern IntPtr GetFunctionPointerForDelegateInternal (Delegate d); @@ -1276,5 +1369,14 @@ namespace System.Runtime.InteropServices return GetFunctionPointerForDelegateInternal (d); } + +#if NET_4_5 + public static IntPtr GetFunctionPointerForDelegate<TDelegate> (TDelegate d) { + if (d == null) + throw new ArgumentNullException ("d"); + + return GetFunctionPointerForDelegateInternal ((Delegate)(object)d); + } +#endif } } diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs index 4b5352a4ae..fad4eaf4e4 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs @@ -46,6 +46,7 @@ namespace System.Runtime.Remoting.Messaging public sealed class CallContext { [ThreadStatic] static Header [] Headers; + [ThreadStatic] static Hashtable logicalDatastore; [ThreadStatic] static Hashtable datastore; [ThreadStatic] static object hostContext; @@ -62,28 +63,37 @@ namespace System.Runtime.Remoting.Messaging public static void FreeNamedDataSlot (string name) { Datastore.Remove (name); + LogicalDatastore.Remove (name); } public static object GetData (string name) { - return Datastore [name]; + if (LogicalDatastore.ContainsKey (name)) { + return LogicalDatastore [name]; + } else { + return Datastore [name]; + } } public static void SetData (string name, object data) { - Datastore [name] = data; + if (data is ILogicalThreadAffinative) { + LogicalSetData (name, data); + } else { + LogicalDatastore.Remove (name); + Datastore [name] = data; + } } - - [MonoTODO] + public static object LogicalGetData (string name) { - throw new NotImplementedException (); + return LogicalDatastore [name]; } - - [MonoTODO] + public static void LogicalSetData (string name, object data) { - throw new NotImplementedException (); + Datastore.Remove (name); + LogicalDatastore [name] = data; } public static Header[] GetHeaders () @@ -99,12 +109,11 @@ namespace System.Runtime.Remoting.Messaging internal static LogicalCallContext CreateLogicalCallContext (bool createEmpty) { LogicalCallContext ctx = null; - if (datastore != null) { - foreach (DictionaryEntry entry in datastore) - if (entry.Value is ILogicalThreadAffinative) { - if (ctx == null) ctx = new LogicalCallContext (); - ctx.SetData ((string)entry.Key, entry.Value); - } + if (logicalDatastore != null) { + ctx = new LogicalCallContext (); + foreach (DictionaryEntry entry in logicalDatastore) { + ctx.SetData ((string)entry.Key, entry.Value); + } } if (ctx == null && createEmpty) @@ -115,26 +124,31 @@ namespace System.Runtime.Remoting.Messaging internal static object SetCurrentCallContext (LogicalCallContext ctx) { - object oldData = datastore; + object oldData = new object[] { datastore, logicalDatastore }; if (ctx != null && ctx.HasInfo) - datastore = (Hashtable) ctx.Datastore.Clone (); + logicalDatastore = (Hashtable) ctx.Datastore.Clone (); else - datastore = null; + logicalDatastore = null; return oldData; } - internal static void UpdateCurrentCallContext (LogicalCallContext ctx) + internal static void UpdateCurrentLogicalCallContext (LogicalCallContext ctx) { Hashtable data = ctx.Datastore; + if (data == null) + return; + foreach (DictionaryEntry entry in data) - SetData ((string)entry.Key, entry.Value); + LogicalSetData ((string)entry.Key, entry.Value); } internal static void RestoreCallContext (object oldContext) { - datastore = (Hashtable) oldContext; + object[] contextArray = (object[])oldContext; + datastore = (Hashtable)contextArray [0]; + logicalDatastore = (Hashtable)contextArray [1]; } private static Hashtable Datastore @@ -146,6 +160,16 @@ namespace System.Runtime.Remoting.Messaging return r; } } + + private static Hashtable LogicalDatastore + { + get { + Hashtable r = logicalDatastore; + if (r == null) + return logicalDatastore = new Hashtable (); + return r; + } + } } [System.Runtime.InteropServices.ComVisible (true)] diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs index 745c161344..d430e9ccc1 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs @@ -218,7 +218,7 @@ namespace System.Runtime.Remoting.Proxies } if (res_msg.LogicalCallContext != null && res_msg.LogicalCallContext.HasInfo) - CallContext.UpdateCurrentCallContext (res_msg.LogicalCallContext); + CallContext.UpdateCurrentLogicalCallContext (res_msg.LogicalCallContext); exc = res_msg.Exception; diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs index f4bab8d4ad..66ef9ce0e6 100644 --- a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs +++ b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs @@ -796,7 +796,7 @@ namespace System.Runtime.Remoting if (obj is CACD) { CACD cad = (CACD) obj; obj = cad.d; - CallContext.UpdateCurrentCallContext ((LogicalCallContext) cad.c); + CallContext.UpdateCurrentLogicalCallContext ((LogicalCallContext) cad.c); } return obj; } diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs index e2e5f793f3..8ca0307c4d 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs @@ -94,7 +94,7 @@ namespace System.Security.Cryptography.X509Certificates { public static X509Certificate CreateFromCertFile (string filename) { - byte[] data = Load (filename); + byte[] data = File.ReadAllBytes (filename); return new X509Certificate (data); } @@ -376,16 +376,6 @@ namespace System.Security.Cryptography.X509Certificates { return sb.ToString (); } - private static byte[] Load (string fileName) - { - byte[] data = null; - using (FileStream fs = File.OpenRead (fileName)) { - data = new byte [fs.Length]; - fs.Read (data, 0, data.Length); - fs.Close (); - } - return data; - } #if NET_4_0 protected static string FormatDate (DateTime date) { diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs index f3c4a8b277..7d5273ee11 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs @@ -6,6 +6,7 @@ // // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com) // Copyright (C) 2004-2006,2008 Novell, Inc (http://www.novell.com) +// Copyright 2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -27,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // - +using System.IO; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Text; @@ -199,6 +200,29 @@ namespace System.Security.Cryptography.X509Certificates { Import (rawData, (string)null, X509KeyStorageFlags.DefaultKeySet); } + private Mono.Security.X509.X509Certificate ImportPkcs12 (byte[] rawData, string password) + { + var pfx = (password == null) ? new Mono.Security.X509.PKCS12 (rawData) : new Mono.Security.X509.PKCS12 (rawData, password); + if (pfx.Certificates.Count == 0) { + // no certificate was found + return null; + } else if (pfx.Keys.Count == 0) { + // no key were found - pick the first certificate + return pfx.Certificates [0]; + } else { + // find the certificate that match the first key + var keypair = (pfx.Keys [0] as AsymmetricAlgorithm); + string pubkey = keypair.ToXmlString (false); + foreach (var c in pfx.Certificates) { + if ((c.RSA != null) && (pubkey == c.RSA.ToXmlString (false))) + return c; + if ((c.DSA != null) && (pubkey == c.DSA.ToXmlString (false))) + return c; + } + return pfx.Certificates [0]; // no match, pick first certificate without keys + } + } + [MonoTODO ("missing KeyStorageFlags support")] [ComVisible (false)] public virtual void Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags) @@ -210,11 +234,7 @@ namespace System.Security.Cryptography.X509Certificates { } catch (Exception e) { try { - PKCS12 pfx = new PKCS12 (rawData); - if (pfx.Certificates.Count > 0) - x509 = pfx.Certificates [0]; - else - x509 = null; + x509 = ImportPkcs12 (rawData, null); } catch { string msg = Locale.GetText ("Unable to decode certificate."); @@ -225,12 +245,7 @@ namespace System.Security.Cryptography.X509Certificates { } else { // try PKCS#12 try { - PKCS12 pfx = new PKCS12 (rawData, password); - if (pfx.Certificates.Count > 0) { - x509 = pfx.Certificates [0]; - } else { - x509 = null; - } + x509 = ImportPkcs12 (rawData, password); } catch { // it's possible to supply a (unrequired/unusued) password @@ -249,7 +264,7 @@ namespace System.Security.Cryptography.X509Certificates { [ComVisible (false)] public virtual void Import (string fileName) { - byte[] rawData = Load (fileName); + byte[] rawData = File.ReadAllBytes (fileName); Import (rawData, (string)null, X509KeyStorageFlags.DefaultKeySet); } @@ -257,14 +272,14 @@ namespace System.Security.Cryptography.X509Certificates { [ComVisible (false)] public virtual void Import (string fileName, string password, X509KeyStorageFlags keyStorageFlags) { - byte[] rawData = Load (fileName); + byte[] rawData = File.ReadAllBytes (fileName); Import (rawData, password, keyStorageFlags); } [MonoTODO ("SecureString support is incomplete, missing KeyStorageFlags support")] public virtual void Import (string fileName, SecureString password, X509KeyStorageFlags keyStorageFlags) { - byte[] rawData = Load (fileName); + byte[] rawData = File.ReadAllBytes (fileName); Import (rawData, (string)null, keyStorageFlags); } diff --git a/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs b/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs index 14f07dd98c..8c43151529 100644 --- a/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs +++ b/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs @@ -244,7 +244,7 @@ namespace System.Security.Principal { else { // validate token by getting name _name = GetTokenName (_token); - if ((_name == String.Empty) || (_name == null)) + if (_name == null) throw new SerializationException ("Token doesn't match a user."); } _type = _info.GetString ("m_type"); diff --git a/mcs/class/corlib/System.Text/UTF8Encoding.cs b/mcs/class/corlib/System.Text/UTF8Encoding.cs index bdd80e8a62..1aa56bc9f2 100644 --- a/mcs/class/corlib/System.Text/UTF8Encoding.cs +++ b/mcs/class/corlib/System.Text/UTF8Encoding.cs @@ -852,7 +852,14 @@ fail_no_space: if (charCount < 0) { throw new ArgumentOutOfRangeException ("charCount", _("ArgRange_NonNegative")); } - return charCount * 4; + + // Add 1 to charCount since there may be a lead surrogate left from the previous call to GetBytes/Encoder.Convert + charCount = charCount + 1; + if (EncoderFallback.MaxCharCount > 1) { + charCount = charCount * EncoderFallback.MaxCharCount; + } + + return charCount * 3; } // Get the maximum number of characters needed to decode a @@ -862,7 +869,14 @@ fail_no_space: if (byteCount < 0) { throw new ArgumentOutOfRangeException ("byteCount", _("ArgRange_NonNegative")); } - return byteCount; + + // Add 1 to byteCount since there may be the bytes from part of a surrogate pair left from the previous call to GetChars/Decoder.Convert + int maxCharCount = byteCount + 1; + if (DecoderFallback.MaxCharCount > 1) { + maxCharCount = maxCharCount * DecoderFallback.MaxCharCount; + } + + return maxCharCount; } // Get a UTF8-specific decoder that is attached to this instance. diff --git a/mcs/class/corlib/System.Threading.Tasks/Task.cs b/mcs/class/corlib/System.Threading.Tasks/Task.cs index 62aa14fddc..796b863336 100644 --- a/mcs/class/corlib/System.Threading.Tasks/Task.cs +++ b/mcs/class/corlib/System.Threading.Tasks/Task.cs @@ -49,8 +49,8 @@ namespace System.Threading.Tasks // parent is the outer task in which this task is created readonly Task parent; - // contAncestor is the Task on which this continuation was setup - readonly Task contAncestor; + // A reference to a Task on which this continuation is attached to + Task contAncestor; static int id = -1; static readonly TaskFactory defaultFactory = new TaskFactory (); @@ -182,6 +182,9 @@ namespace System.Threading.Tasks if (IsContinuation) throw new InvalidOperationException ("Start may not be called on a continuation task"); + if (IsPromise) + throw new InvalidOperationException ("Start may not be called on a promise-style task"); + SetupScheduler (scheduler); Schedule (); } @@ -208,6 +211,9 @@ namespace System.Threading.Tasks if (IsContinuation) throw new InvalidOperationException ("RunSynchronously may not be called on a continuation task"); + if (IsPromise) + throw new InvalidOperationException ("RunSynchronously may not be called on a promise-style task"); + RunSynchronouslyCore (scheduler); } @@ -220,11 +226,13 @@ namespace System.Threading.Tasks if (scheduler.RunInline (this, false)) return; } catch (Exception inner) { - throw new TaskSchedulerException (inner); + var ex = new TaskSchedulerException (inner); + TrySetException (new AggregateException (ex), false, true); + throw ex; } Schedule (); - Wait (); + WaitCore (Timeout.Infinite, CancellationToken.None, false); } #endregion @@ -330,18 +338,28 @@ namespace System.Threading.Tasks ContinueWith (new TaskContinuation (continuation, options)); } - internal void ContinueWith (IContinuation continuation) + internal bool ContinueWith (IContinuation continuation, bool canExecuteInline = true) { if (IsCompleted) { + if (!canExecuteInline) + return false; + continuation.Execute (); - return; + return true; } continuations.Add (continuation); // Retry in case completion was achieved but event adding was too late - if (IsCompleted && continuations.Remove (continuation)) + if (IsCompleted) { + continuations.Remove (continuation); + if (!canExecuteInline) + return false; + continuation.Execute (); + } + + return true; } internal void RemoveContinuation (IContinuation continuation) @@ -438,7 +456,7 @@ namespace System.Threading.Tasks return true; } - internal bool TrySetException (AggregateException aggregate) + internal bool TrySetException (AggregateException aggregate, bool cancellation, bool observed) { if (IsCompleted) return false; @@ -450,8 +468,19 @@ namespace System.Threading.Tasks return false; } - - HandleGenericException (aggregate); + + if (cancellation) { + ExceptionSlot.Exception = aggregate; + Thread.MemoryBarrier (); + + CancelReal (); + } else { + HandleGenericException (aggregate); + } + + if (observed) + exSlot.Observed = true; + return true; } @@ -500,7 +529,9 @@ namespace System.Threading.Tasks void InnerInvoke () { if (IsContinuation) { - invoker.Invoke (contAncestor, state, this); + var ancestor = contAncestor; + contAncestor = null; + invoker.Invoke (ancestor, state, this); } else { invoker.Invoke (this, state, this); } @@ -639,7 +670,7 @@ namespace System.Threading.Tasks if (millisecondsTimeout < -1) throw new ArgumentOutOfRangeException ("millisecondsTimeout"); - bool result = WaitCore (millisecondsTimeout, cancellationToken); + bool result = WaitCore (millisecondsTimeout, cancellationToken, true); if (IsCanceled) throw new AggregateException (new TaskCanceledException (this)); @@ -651,13 +682,13 @@ namespace System.Threading.Tasks return result; } - internal bool WaitCore (int millisecondsTimeout, CancellationToken cancellationToken) + internal bool WaitCore (int millisecondsTimeout, CancellationToken cancellationToken, bool runInline) { if (IsCompleted) return true; // If the task is ready to be run and we were supposed to wait on it indefinitely without cancellation, just run it - if (Status == TaskStatus.WaitingToRun && millisecondsTimeout == Timeout.Infinite && scheduler != null && !cancellationToken.CanBeCanceled) + if (runInline && Status == TaskStatus.WaitingToRun && millisecondsTimeout == Timeout.Infinite && scheduler != null && !cancellationToken.CanBeCanceled) scheduler.RunInline (this, true); bool result = true; @@ -957,11 +988,23 @@ namespace System.Threading.Tasks if (millisecondsDelay < -1) throw new ArgumentOutOfRangeException ("millisecondsDelay"); - var task = new Task (TaskActionInvoker.Delay, millisecondsDelay, cancellationToken, TaskCreationOptions.None, null, TaskConstants.Finished); + if (cancellationToken.IsCancellationRequested) + return TaskConstants.Canceled; + + var task = new Task (TaskActionInvoker.Empty, null, cancellationToken, TaskCreationOptions.None, null, null); task.SetupScheduler (TaskScheduler.Default); - - if (millisecondsDelay != Timeout.Infinite) - task.scheduler.QueueTask (task); + + if (millisecondsDelay != Timeout.Infinite) { + var timer = new Timer (delegate (object state) { + var t = (Task) state; + if (t.Status == TaskStatus.WaitingForActivation) { + t.Status = TaskStatus.Running; + t.Finish (); + } + }, task, millisecondsDelay, -1); + + task.ContinueWith (new DisposeContinuation (timer)); + } return task; } @@ -1068,6 +1111,9 @@ namespace System.Threading.Tasks internal static Task<TResult[]> WhenAllCore<TResult> (IList<Task<TResult>> tasks) { + if (tasks.Count == 0) + return FromResult(new TResult[0]); + foreach (var t in tasks) { if (t == null) throw new ArgumentException ("tasks", "the tasks argument contains a null element"); @@ -1228,7 +1274,7 @@ namespace System.Threading.Tasks public AggregateException Exception { get { - if (exSlot == null) + if (exSlot == null || !IsFaulted) return null; exSlot.Observed = true; return exSlot.Exception; @@ -1269,7 +1315,7 @@ namespace System.Threading.Tasks } } - TaskExceptionSlot ExceptionSlot { + internal TaskExceptionSlot ExceptionSlot { get { if (exSlot != null) return exSlot; @@ -1314,6 +1360,12 @@ namespace System.Threading.Tasks } } + bool IsPromise { + get { + return invoker == TaskActionInvoker.Promise; + } + } + internal Task ContinuationAncestor { get { return contAncestor; diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskActionInvoker.cs b/mcs/class/corlib/System.Threading.Tasks/TaskActionInvoker.cs index 513b09968b..72a486f7a8 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskActionInvoker.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskActionInvoker.cs @@ -35,6 +35,7 @@ namespace System.Threading.Tasks abstract class TaskActionInvoker { public static readonly TaskActionInvoker Empty = new EmptyTaskActionInvoker (); + public static readonly TaskActionInvoker Promise = new EmptyTaskActionInvoker (); public static readonly TaskActionInvoker Delay = new DelayTaskInvoker (); sealed class EmptyTaskActionInvoker : TaskActionInvoker @@ -290,12 +291,10 @@ namespace System.Threading.Tasks sealed class FuncTaskSelected<TResult> : TaskActionInvoker { readonly Func<Task, TResult> action; - readonly Task[] tasks; - public FuncTaskSelected (Func<Task, TResult> action, Task[] tasks) + public FuncTaskSelected (Func<Task, TResult> action) { this.action = action; - this.tasks = tasks; } public override Delegate Action { @@ -306,8 +305,8 @@ namespace System.Threading.Tasks public override void Invoke (Task owner, object state, Task context) { - var result = ((Task<int>) owner).Result; - ((Task<TResult>) context).Result = action (tasks[result]); + var result = ((Task<Task>) owner).Result; + ((Task<TResult>) context).Result = action (result); } } @@ -492,9 +491,9 @@ namespace System.Threading.Tasks return new ActionTaskSelected (action); } - public static TaskActionInvoker Create<TResult> (Func<Task, TResult> action, Task[] tasks) + public static TaskActionInvoker CreateSelected<TResult> (Func<Task, TResult> action) { - return new FuncTaskSelected<TResult> (action, tasks); + return new FuncTaskSelected<TResult> (action); } #endregion diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskCompletionSource.cs b/mcs/class/corlib/System.Threading.Tasks/TaskCompletionSource.cs index f4b3a3b81d..f0bc902310 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskCompletionSource.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskCompletionSource.cs @@ -113,7 +113,7 @@ namespace System.Threading.Tasks if (aggregate.InnerExceptions.Count == 0) throw new ArgumentNullException ("exceptions"); - return source.TrySetException (aggregate); + return source.TrySetException (aggregate, false, false); } public bool TrySetResult (TResult result) diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs b/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs index 8189df744b..12eaa8be19 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs @@ -110,18 +110,41 @@ namespace System.Threading.Tasks } } - class ActionContinuation : IContinuation + class AwaiterActionContinuation : IContinuation { readonly Action action; - public ActionContinuation (Action action) + public AwaiterActionContinuation (Action action) { this.action = action; } public void Execute () { - action (); + // + // Continuation can be inlined only when the current context allows it. This is different to awaiter setup + // because the context where the awaiter task is set to completed can be anywhere (due to TaskCompletionSource) + // + if ((SynchronizationContext.Current == null || SynchronizationContext.Current.GetType () == typeof (SynchronizationContext)) && TaskScheduler.IsDefault) { + action (); + } else { + ThreadPool.UnsafeQueueUserWorkItem (l => ((Action) l) (), action); + } + } + } + + class SchedulerAwaitContinuation : IContinuation + { + readonly Task task; + + public SchedulerAwaitContinuation (Task task) + { + this.task = task; + } + + public void Execute () + { + task.RunSynchronouslyCore (task.scheduler); } } @@ -179,7 +202,7 @@ namespace System.Threading.Tasks } if (exceptions != null) { - owner.TrySetException (new AggregateException (exceptions)); + owner.TrySetException (new AggregateException (exceptions), false, false); return; } @@ -239,7 +262,7 @@ namespace System.Threading.Tasks } if (exceptions != null) { - owner.TrySetException (new AggregateException (exceptions)); + owner.TrySetException (new AggregateException (exceptions), false, false); return; } @@ -316,6 +339,7 @@ namespace System.Threading.Tasks sealed class CountdownContinuation : IContinuation, IDisposable { readonly CountdownEvent evt; + bool disposed; public CountdownContinuation (int initialCount) { @@ -330,12 +354,33 @@ namespace System.Threading.Tasks public void Dispose () { + disposed = true; + Thread.MemoryBarrier (); + evt.Dispose (); } public void Execute () { - evt.Signal (); + // Guard against possible race when continuation is disposed and some tasks may still + // execute it (removal was late and the execution is slower than the Dispose thread) + if (!disposed) + evt.Signal (); + } + } + + sealed class DisposeContinuation : IContinuation + { + readonly IDisposable instance; + + public DisposeContinuation (IDisposable instance) + { + this.instance = instance; + } + + public void Execute () + { + instance.Dispose (); } } } diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskFactory.cs b/mcs/class/corlib/System.Threading.Tasks/TaskFactory.cs index 9330fd40a5..a558c622c5 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskFactory.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskFactory.cs @@ -214,9 +214,14 @@ namespace System.Threading.Tasks TaskCreationOptions creationOptions, TaskScheduler scheduler) { - Task<TResult> t = new Task<TResult> (function, state, cancellationToken, creationOptions); - t.Start (scheduler); + var t = new Task<TResult> (function, state, cancellationToken, creationOptions); + // + // Don't start cancelled task it would throw an exception + // + if (!t.IsCompleted) + t.Start (scheduler); + return t; } #endregion @@ -305,7 +310,7 @@ namespace System.Threading.Tasks { CheckContinueArguments (tasks, continuationFunction, continuationOptions, scheduler); - var cont = Task.WhenAnyCore (tasks).ContinueWith<TResult> (TaskActionInvoker.Create (continuationFunction, tasks), cancellationToken, continuationOptions, scheduler); + var cont = Task.WhenAnyCore (tasks).ContinueWith<TResult> (TaskActionInvoker.CreateSelected (continuationFunction), cancellationToken, continuationOptions, scheduler); return cont; } diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs b/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs index 618c185084..a4031c0a50 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs @@ -100,6 +100,12 @@ namespace System.Threading.Tasks return id; } } + + internal static bool IsDefault { + get { + return currentScheduler == null || currentScheduler == defaultScheduler; + } + } public virtual int MaximumConcurrencyLevel { get { diff --git a/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs b/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs index c38a566e2c..e1c9a6842c 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs @@ -50,7 +50,7 @@ namespace System.Threading.Tasks return; } - ThreadPool.UnsafeQueueUserWorkItem (callback, task); + ThreadPool.QueueWorkItem (callback, task); } static void TaskExecuterCallback (object obj) diff --git a/mcs/class/corlib/System.Threading/CancellationTokenSource.cs b/mcs/class/corlib/System.Threading/CancellationTokenSource.cs index b82e49f59b..59637dd0a3 100644 --- a/mcs/class/corlib/System.Threading/CancellationTokenSource.cs +++ b/mcs/class/corlib/System.Threading/CancellationTokenSource.cs @@ -133,7 +133,7 @@ namespace System.Threading try { Action cb; - for (int id = int.MinValue + 1; id <= currId; id++) { + for (int id = currId; id != int.MinValue; id--) { if (!callbacks.TryRemove (new CancellationTokenRegistration (id, this), out cb)) continue; if (cb == null) diff --git a/mcs/class/corlib/System.Threading/Monitor.cs b/mcs/class/corlib/System.Threading/Monitor.cs index 4a326041cb..d6a289e76b 100644 --- a/mcs/class/corlib/System.Threading/Monitor.cs +++ b/mcs/class/corlib/System.Threading/Monitor.cs @@ -227,10 +227,12 @@ namespace System.Threading #endif #if NET_4_5 - [MonoTODO] + [MethodImplAttribute(MethodImplOptions.InternalCall)] + extern static bool Monitor_test_owner (object obj); + public static bool IsEntered (object obj) { - throw new NotImplementedException (); + return Monitor_test_owner(obj); } #endif } diff --git a/mcs/class/corlib/System.Threading/NamedDataSlot.cs b/mcs/class/corlib/System.Threading/NamedDataSlot.cs index 9997be1f5d..4c9d31624a 100644 --- a/mcs/class/corlib/System.Threading/NamedDataSlot.cs +++ b/mcs/class/corlib/System.Threading/NamedDataSlot.cs @@ -64,6 +64,7 @@ namespace System.Threading LocalDataStoreSlot slot; if (!datastorehash.TryGetValue (name, out slot)) { slot = new LocalDataStoreSlot (true); + datastorehash.Add (name, slot); } return slot; diff --git a/mcs/class/corlib/System.Threading/SemaphoreSlim.cs b/mcs/class/corlib/System.Threading/SemaphoreSlim.cs index 3a75238f4d..bf5f3da002 100644 --- a/mcs/class/corlib/System.Threading/SemaphoreSlim.cs +++ b/mcs/class/corlib/System.Threading/SemaphoreSlim.cs @@ -171,9 +171,11 @@ namespace System.Threading if (stopCondition ()) return false; - if (wait.Count > spinCount) - handle.WaitOne (Math.Min (Math.Max (millisecondsTimeout - (int)sw.ElapsedMilliseconds, 1), deepSleepTime)); - else + if (wait.Count > spinCount) { + int timeout = millisecondsTimeout < 0 ? deepSleepTime : + Math.Min (Math.Max (millisecondsTimeout - (int)sw.ElapsedMilliseconds, 1), deepSleepTime); + handle.WaitOne (timeout); + } else wait.SpinOnce (); } } while (true); diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index 813c458f94..5af6800382 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -137,6 +137,8 @@ namespace System.Threading { IPrincipal principal; int principal_version; + bool current_culture_set; + bool current_ui_culture_set; CultureInfo current_culture; CultureInfo current_ui_culture; @@ -156,6 +158,9 @@ namespace System.Threading { static NamedDataSlot namedDataSlot; + static internal CultureInfo default_culture; + static internal CultureInfo default_ui_culture; + // can be both a ThreadStart and a ParameterizedThreadStart private MulticastDelegate threadstart; //private string thread_name=null; @@ -470,11 +475,13 @@ namespace System.Threading { public CultureInfo CurrentCulture { get { CultureInfo culture = current_culture; - if (culture != null) + if (current_culture_set && culture != null) return culture; + if (default_culture != null) + return default_culture; + current_culture = culture = CultureInfo.ConstructCurrentCulture (); - NumberFormatter.SetThreadCurrentCulture (culture); return culture; } @@ -485,16 +492,19 @@ namespace System.Threading { value.CheckNeutral (); current_culture = value; - NumberFormatter.SetThreadCurrentCulture (value); + current_culture_set = true; } } public CultureInfo CurrentUICulture { get { CultureInfo culture = current_ui_culture; - if (culture != null) + if (current_ui_culture_set && culture != null) return culture; + if (default_ui_culture != null) + return default_ui_culture; + current_ui_culture = culture = CultureInfo.ConstructCurrentUICulture (); return culture; } @@ -503,6 +513,7 @@ namespace System.Threading { if (value == null) throw new ArgumentNullException ("value"); current_ui_culture = value; + current_ui_culture_set = true; } } diff --git a/mcs/class/corlib/System.Threading/ThreadPool.cs b/mcs/class/corlib/System.Threading/ThreadPool.cs index 4d3f1c086c..204386f9f7 100644 --- a/mcs/class/corlib/System.Threading/ThreadPool.cs +++ b/mcs/class/corlib/System.Threading/ThreadPool.cs @@ -87,9 +87,6 @@ namespace System.Threading { if (ar == null) return false; } else { - if (!callBack.HasSingleTarget) - throw new Exception ("The delegate must have only one target"); - AsyncResult ares = new AsyncResult (callBack, state, true); pool_queue (ares); } @@ -99,6 +96,12 @@ namespace System.Threading { [MethodImplAttribute(MethodImplOptions.InternalCall)] static extern void pool_queue (AsyncResult ares); + // TODO: It should be interface interface only to avoid extra allocation + internal static void QueueWorkItem (WaitCallback callBack, object state) + { + pool_queue (new AsyncResult (callBack, state, false)); + } + public static RegisteredWaitHandle RegisterWaitForSingleObject (WaitHandle waitObject, WaitOrTimerCallback callBack, object state, @@ -168,11 +171,11 @@ namespace System.Threading { [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)] public static bool UnsafeQueueUserWorkItem (WaitCallback callBack, object state) { + if (callBack == null) + throw new ArgumentNullException ("callBack"); + // no stack propagation here (that's why it's unsafe and requires extra security permissions) if (!callBack.IsTransparentProxy ()) { - if (!callBack.HasSingleTarget) - throw new Exception ("The delegate must have only one target"); - AsyncResult ares = new AsyncResult (callBack, state, false); pool_queue (ares); return true; diff --git a/mcs/class/corlib/System.Threading/Timer.cs b/mcs/class/corlib/System.Threading/Timer.cs index 6335877605..dd32032436 100644 --- a/mcs/class/corlib/System.Threading/Timer.cs +++ b/mcs/class/corlib/System.Threading/Timer.cs @@ -337,7 +337,7 @@ namespace System.Threading list.RemoveAt (i); count--; i--; - ThreadPool.UnsafeQueueUserWorkItem (TimerCB, timer); + ThreadPool.QueueWorkItem (TimerCB, timer); long period = timer.period_ms; long due_time = timer.due_time_ms; bool no_more = (period == -1 || ((period == 0 || period == Timeout.Infinite) && due_time != Timeout.Infinite)); diff --git a/mcs/class/corlib/System/AggregateException.cs b/mcs/class/corlib/System/AggregateException.cs index 145319acdd..c0df741af1 100644 --- a/mcs/class/corlib/System/AggregateException.cs +++ b/mcs/class/corlib/System/AggregateException.cs @@ -163,7 +163,7 @@ namespace System public override Exception GetBaseException () { - if (innerExceptions == null || innerExceptions.Count == 0) + if (innerExceptions == null || innerExceptions.Count != 1) return this; return innerExceptions[0].GetBaseException (); } diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs index 91654019f1..756378c56d 100644 --- a/mcs/class/corlib/System/Array.cs +++ b/mcs/class/corlib/System/Array.cs @@ -2864,32 +2864,54 @@ namespace System { if (array == null) throw new ArgumentNullException ("array"); + + if (match == null) + throw new ArgumentNullException ("match"); - return FindLastIndex<T> (array, 0, array.Length, match); + return GetLastIndex (array, 0, array.Length, match); } public static int FindLastIndex<T> (T [] array, int startIndex, Predicate<T> match) { if (array == null) throw new ArgumentNullException (); + + if (startIndex < 0 || (uint) startIndex > (uint) array.Length) + throw new ArgumentOutOfRangeException ("startIndex"); + + if (match == null) + throw new ArgumentNullException ("match"); - return FindLastIndex<T> (array, startIndex, array.Length - startIndex, match); + return GetLastIndex (array, 0, startIndex + 1, match); } public static int FindLastIndex<T> (T [] array, int startIndex, int count, Predicate<T> match) { if (array == null) throw new ArgumentNullException ("array"); + if (match == null) throw new ArgumentNullException ("match"); + + if (startIndex < 0 || (uint) startIndex > (uint) array.Length) + throw new ArgumentOutOfRangeException ("startIndex"); - if (startIndex > array.Length || startIndex + count > array.Length) - throw new ArgumentOutOfRangeException (); - - for (int i = startIndex + count - 1; i >= startIndex; i--) - if (match (array [i])) + if (count < 0) + throw new ArgumentOutOfRangeException ("count"); + + if (startIndex - count + 1 < 0) + throw new ArgumentOutOfRangeException ("count must refer to a location within the array"); + + return GetLastIndex (array, startIndex - count + 1, count, match); + } + + internal static int GetLastIndex<T> (T[] array, int startIndex, int count, Predicate<T> match) + { + // unlike FindLastIndex, takes regular params for search range + for (int i = startIndex + count; i != startIndex;) + if (match (array [--i])) return i; - + return -1; } @@ -2897,16 +2919,25 @@ namespace System { if (array == null) throw new ArgumentNullException ("array"); + + if (match == null) + throw new ArgumentNullException ("match"); - return FindIndex<T> (array, 0, array.Length, match); + return GetIndex (array, 0, array.Length, match); } public static int FindIndex<T> (T [] array, int startIndex, Predicate<T> match) { if (array == null) throw new ArgumentNullException ("array"); - - return FindIndex<T> (array, startIndex, array.Length - startIndex, match); + + if (startIndex < 0 || (uint) startIndex > (uint) array.Length) + throw new ArgumentOutOfRangeException ("startIndex"); + + if (match == null) + throw new ArgumentNullException ("match"); + + return GetIndex (array, startIndex, array.Length - startIndex, match); } public static int FindIndex<T> (T [] array, int startIndex, int count, Predicate<T> match) @@ -2914,13 +2945,22 @@ namespace System if (array == null) throw new ArgumentNullException ("array"); - if (match == null) - throw new ArgumentNullException ("match"); + if (startIndex < 0) + throw new ArgumentOutOfRangeException ("startIndex"); - if (startIndex > array.Length || startIndex + count > array.Length) - throw new ArgumentOutOfRangeException (); - - for (int i = startIndex; i < startIndex + count; i ++) + if (count < 0) + throw new ArgumentOutOfRangeException ("count"); + + if ((uint) startIndex + (uint) count > (uint) array.Length) + throw new ArgumentOutOfRangeException ("index and count exceed length of list"); + + return GetIndex (array, startIndex, count, match); + } + + internal static int GetIndex<T> (T[] array, int startIndex, int count, Predicate<T> match) + { + int end = startIndex + count; + for (int i = startIndex; i < end; i ++) if (match (array [i])) return i; diff --git a/mcs/class/corlib/System/ArraySegment.cs b/mcs/class/corlib/System/ArraySegment.cs index 77d76ad069..612e603f60 100644 --- a/mcs/class/corlib/System/ArraySegment.cs +++ b/mcs/class/corlib/System/ArraySegment.cs @@ -134,13 +134,13 @@ namespace System T IList<T>.this[int index] { get { - if (index < 0 || count < index) + if (index < 0 || index >= count) throw new ArgumentOutOfRangeException ("index"); return array[offset + index]; } set { - if (index < 0 || count < index) + if (index < 0 || index >= count) throw new ArgumentOutOfRangeException ("index"); array[offset + index] = value; diff --git a/mcs/class/corlib/System/Attribute.cs b/mcs/class/corlib/System/Attribute.cs index 46d0b775db..be91a7a182 100644 --- a/mcs/class/corlib/System/Attribute.cs +++ b/mcs/class/corlib/System/Attribute.cs @@ -258,7 +258,7 @@ namespace System public override int GetHashCode () { - int result = TypeId.GetHashCode (); + int result = GetType ().GetHashCode (); FieldInfo[] fields = GetType ().GetFields (BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); foreach (FieldInfo field in fields) { diff --git a/mcs/class/corlib/System/ConsoleKeyInfo.cs b/mcs/class/corlib/System/ConsoleKeyInfo.cs index c62c8d0d03..961cb949d6 100644 --- a/mcs/class/corlib/System/ConsoleKeyInfo.cs +++ b/mcs/class/corlib/System/ConsoleKeyInfo.cs @@ -31,80 +31,83 @@ namespace System { [Serializable] public struct ConsoleKeyInfo { internal static ConsoleKeyInfo Empty = new ConsoleKeyInfo ('\0', 0, false, false, false); - ConsoleKey key; - char keychar; - ConsoleModifiers modifiers; + ConsoleKey _key; + char _keyChar; + ConsoleModifiers _mods; public ConsoleKeyInfo (char keyChar, ConsoleKey key, bool shift, bool alt, bool control) { - this.key = key; - this.keychar = keyChar; - modifiers = 0; + _key = key; + _keyChar = keyChar; + _mods = 0; SetModifiers (shift, alt, control); } internal ConsoleKeyInfo (ConsoleKeyInfo other) { - this.key = other.key; - this.keychar = other.keychar; - this.modifiers = other.modifiers; + _key = other._key; + _keyChar = other._keyChar; + _mods = other._mods; } internal void SetKey (ConsoleKey key) { - this.key = key; + _key = key; } internal void SetKeyChar (char keyChar) { - this.keychar = keyChar; + _keyChar = keyChar; } internal void SetModifiers (bool shift, bool alt, bool control) { - this.modifiers = (shift) ? ConsoleModifiers.Shift : 0; - this.modifiers |= (alt) ? ConsoleModifiers.Alt : 0; - this.modifiers |= (control) ? ConsoleModifiers.Control : 0; + _mods = (shift) ? ConsoleModifiers.Shift : 0; + _mods |= (alt) ? ConsoleModifiers.Alt : 0; + _mods |= (control) ? ConsoleModifiers.Control : 0; } - public ConsoleKey Key { - get { return key; } + public ConsoleKey Key + { + get { return _key; } } - public char KeyChar { - get { return keychar; } + public char KeyChar + { + get { return _keyChar; } } - public ConsoleModifiers Modifiers { - get { return modifiers; } + public ConsoleModifiers Modifiers + { + get { return _mods; } } - + public override bool Equals (object value) { if (!(value is ConsoleKeyInfo)) return false; + return Equals ((ConsoleKeyInfo) value); } - + public static bool operator == (ConsoleKeyInfo a, ConsoleKeyInfo b) { return a.Equals (b); } - + public static bool operator != (ConsoleKeyInfo a, ConsoleKeyInfo b) { return !a.Equals (b); } - + public bool Equals (ConsoleKeyInfo obj) { - return key == obj.key && obj.keychar == keychar && obj.modifiers == modifiers; + return _key == obj._key && _keyChar == obj._keyChar && _mods == obj._mods; } - + public override int GetHashCode () { - return key.GetHashCode () ^ keychar.GetHashCode () ^ modifiers.GetHashCode (); + return _key.GetHashCode () ^ _keyChar.GetHashCode () ^ _mods.GetHashCode (); } } } - diff --git a/mcs/class/corlib/System/Convert.cs b/mcs/class/corlib/System/Convert.cs index ae3b87120a..a17181f38b 100644 --- a/mcs/class/corlib/System/Convert.cs +++ b/mcs/class/corlib/System/Convert.cs @@ -1,12 +1,13 @@ // // System.Convert.cs // -// Author: +// Authors: // Derek Holden (dholden@draper.com) // Duncan Mak (duncan@ximian.com) +// Marek Safar (marek.safar@gmail.com) // // (C) Ximian, Inc. http://www.ximian.com -// +// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) // // System.Convert class. This was written word for word off the // Library specification for System.Convert in the ECMA TC39 TG2 @@ -2528,6 +2529,7 @@ namespace System { typeof (DateTime), // 16 TypeCode.DateTime null, // 17 null. typeof (String), // 18 TypeCode.String + typeof (Enum) }; // Function to convert an object to another type and return @@ -2561,67 +2563,69 @@ namespace System { if (value.GetType () == conversionType) return value; - if (value is IConvertible) { - IConvertible convertValue = (IConvertible) value; + IConvertible convertValue = value as IConvertible; + if (convertValue != null) { if (conversionType == conversionTable[0]) // 0 Empty throw new ArgumentNullException (); - else if (conversionType == conversionTable[1]) // 1 TypeCode.Object - return (object) value; + if (conversionType == conversionTable[1]) // 1 TypeCode.Object + return value; - else if (conversionType == conversionTable[2]) // 2 TypeCode.DBNull + if (conversionType == conversionTable[2]) // 2 TypeCode.DBNull throw new InvalidCastException ( "Cannot cast to DBNull, it's not IConvertible"); - else if (conversionType == conversionTable[3]) // 3 TypeCode.Boolean - return (object) convertValue.ToBoolean (provider); + if (conversionType == conversionTable[3]) // 3 TypeCode.Boolean + return convertValue.ToBoolean (provider); - else if (conversionType == conversionTable[4]) // 4 TypeCode.Char - return (object) convertValue.ToChar (provider); + if (conversionType == conversionTable[4]) // 4 TypeCode.Char + return convertValue.ToChar (provider); - else if (conversionType == conversionTable[5]) // 5 TypeCode.SByte - return (object) convertValue.ToSByte (provider); + if (conversionType == conversionTable[5]) // 5 TypeCode.SByte + return convertValue.ToSByte (provider); - else if (conversionType == conversionTable[6]) // 6 TypeCode.Byte - return (object) convertValue.ToByte (provider); + if (conversionType == conversionTable[6]) // 6 TypeCode.Byte + return convertValue.ToByte (provider); - else if (conversionType == conversionTable[7]) // 7 TypeCode.Int16 - return (object) convertValue.ToInt16 (provider); + if (conversionType == conversionTable[7]) // 7 TypeCode.Int16 + return convertValue.ToInt16 (provider); - else if (conversionType == conversionTable[8]) // 8 TypeCode.UInt16 - return (object) convertValue.ToUInt16 (provider); + if (conversionType == conversionTable[8]) // 8 TypeCode.UInt16 + return convertValue.ToUInt16 (provider); - else if (conversionType == conversionTable[9]) // 9 TypeCode.Int32 - return (object) convertValue.ToInt32 (provider); + if (conversionType == conversionTable[9]) // 9 TypeCode.Int32 + return convertValue.ToInt32 (provider); - else if (conversionType == conversionTable[10]) // 10 TypeCode.UInt32 - return (object) convertValue.ToUInt32 (provider); + if (conversionType == conversionTable[10]) // 10 TypeCode.UInt32 + return convertValue.ToUInt32 (provider); - else if (conversionType == conversionTable[11]) // 11 TypeCode.Int64 - return (object) convertValue.ToInt64 (provider); + if (conversionType == conversionTable[11]) // 11 TypeCode.Int64 + return convertValue.ToInt64 (provider); - else if (conversionType == conversionTable[12]) // 12 TypeCode.UInt64 - return (object) convertValue.ToUInt64 (provider); + if (conversionType == conversionTable[12]) // 12 TypeCode.UInt64 + return convertValue.ToUInt64 (provider); - else if (conversionType == conversionTable[13]) // 13 TypeCode.Single - return (object) convertValue.ToSingle (provider); + if (conversionType == conversionTable[13]) // 13 TypeCode.Single + return convertValue.ToSingle (provider); - else if (conversionType == conversionTable[14]) // 14 TypeCode.Double - return (object) convertValue.ToDouble (provider); + if (conversionType == conversionTable[14]) // 14 TypeCode.Double + return convertValue.ToDouble (provider); - else if (conversionType == conversionTable[15]) // 15 TypeCode.Decimal - return (object) convertValue.ToDecimal (provider); + if (conversionType == conversionTable[15]) // 15 TypeCode.Decimal + return convertValue.ToDecimal (provider); - else if (conversionType == conversionTable[16]) // 16 TypeCode.DateTime - return (object) convertValue.ToDateTime (provider); + if (conversionType == conversionTable[16]) // 16 TypeCode.DateTime + return convertValue.ToDateTime (provider); - else if (conversionType == conversionTable[18]) // 18 TypeCode.String - return (object) convertValue.ToString (provider); - else { - if (try_target_to_type) - return convertValue.ToType (conversionType, provider); - } + if (conversionType == conversionTable[18]) // 18 TypeCode.String + return convertValue.ToString (provider); + + if (conversionType == conversionTable[19] && value is Enum) // System.Enum + return value; + + if (try_target_to_type) + return convertValue.ToType (conversionType, provider); } // Not in the conversion table throw new InvalidCastException ((Locale.GetText ( diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index aa4301d016..507153c421 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -527,7 +527,7 @@ namespace System return source; if (source.GetType () != value.GetType ()) - throw new ArgumentException ("Delegate type mismatch"); + throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types. First is {0} second is {1}.", source.GetType ().FullName, value.GetType ().FullName)); return source.RemoveImpl (value); } diff --git a/mcs/class/corlib/System/Enum.cs b/mcs/class/corlib/System/Enum.cs index c16e604d97..ecf2ed1898 100644 --- a/mcs/class/corlib/System/Enum.cs +++ b/mcs/class/corlib/System/Enum.cs @@ -278,9 +278,8 @@ namespace System { if (targetType == null) throw new ArgumentNullException ("targetType"); - if (targetType == typeof (string)) - return ToString (provider); - return Convert.ToType (Value, targetType, provider, false); + + return Convert.ToType (this, targetType, provider, false); } ushort IConvertible.ToUInt16 (IFormatProvider provider) diff --git a/mcs/class/corlib/System/Environment.cs b/mcs/class/corlib/System/Environment.cs index d1b4015c03..13d63ccc12 100644 --- a/mcs/class/corlib/System/Environment.cs +++ b/mcs/class/corlib/System/Environment.cs @@ -56,7 +56,7 @@ namespace System { * of icalls, do not require an increment. */ #pragma warning disable 169 - private const int mono_corlib_version = 110; + private const int mono_corlib_version = 111; #pragma warning restore 169 [ComVisible (true)] diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs index ab7583652c..0550ff8284 100644 --- a/mcs/class/corlib/System/MulticastDelegate.cs +++ b/mcs/class/corlib/System/MulticastDelegate.cs @@ -43,19 +43,17 @@ namespace System [StructLayout (LayoutKind.Sequential)] public abstract class MulticastDelegate : Delegate { - private MulticastDelegate prev; - private MulticastDelegate kpm_next; + MulticastDelegate prev; + MulticastDelegate kpm_next; protected MulticastDelegate (object target, string method) : base (target, method) { - prev = null; } protected MulticastDelegate (Type target, string method) : base (target, method) { - prev = null; } public override void GetObjectData (SerializationInfo info, StreamingContext context) @@ -72,9 +70,6 @@ namespace System return base.DynamicInvokeImpl (args); } - internal bool HasSingleTarget { - get { return prev == null; } - } // <remarks> // Equals: two multicast delegates are equal if their base is equal // and their invocations list is equal. diff --git a/mcs/class/corlib/System/NumberFormatter.cs b/mcs/class/corlib/System/NumberFormatter.cs index 4f948aaf38..dc0fb5a1e1 100644 --- a/mcs/class/corlib/System/NumberFormatter.cs +++ b/mcs/class/corlib/System/NumberFormatter.cs @@ -557,9 +557,7 @@ namespace System private void Resize (int len) { - char[] newBuf = new char [len]; - Array.Copy (_cbuf, newBuf, _ind); - _cbuf = newBuf; + Array.Resize (ref _cbuf, len); } private void Append (char c) @@ -783,6 +781,7 @@ namespace System threadNumberFormatter = null; if (res == null) return new NumberFormatter (Thread.CurrentThread); + res.CurrentCulture = Thread.CurrentThread.CurrentCulture; return res; } @@ -791,12 +790,6 @@ namespace System threadNumberFormatter = this; } - internal static void SetThreadCurrentCulture (CultureInfo culture) - { - if (threadNumberFormatter != null) - threadNumberFormatter.CurrentCulture = culture; - } - public static string NumberToString (string format, sbyte value, IFormatProvider fp) { NumberFormatter inst = GetInstance(); diff --git a/mcs/class/corlib/System/Random.cs b/mcs/class/corlib/System/Random.cs index 1f84216ffe..0bf5c74627 100644 --- a/mcs/class/corlib/System/Random.cs +++ b/mcs/class/corlib/System/Random.cs @@ -4,13 +4,12 @@ // Authors: // Bob Smith (bob@thestuff.net) // Ben Maurer (bmaurer@users.sourceforge.net) +// Sebastien Pouliot <sebastien@xamarin.com> // // (C) 2001 Bob Smith. http://www.thestuff.net // (C) 2003 Ben Maurer -// - -// // Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright 2013 Xamarin Inc. (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -39,12 +38,11 @@ namespace System [ComVisible (true)] public class Random { - const int MBIG = int.MaxValue; - const int MSEED = 161803398; + uint x; + uint y; + uint z; + uint c; - int inext, inextp; - int [] SeedArray = new int [56]; - public Random () : this (Environment.TickCount) { @@ -52,75 +50,28 @@ namespace System public Random (int Seed) { - int ii; - int mj, mk; - - // Numerical Recipes in C online @ http://www.library.cornell.edu/nr/bookcpdf/c7-1.pdf - - // Math.Abs throws on Int32.MinValue, so we need to work around that case. - // Fixes: 605797 - if (Seed == Int32.MinValue) - mj = MSEED - Math.Abs (Int32.MinValue + 1); - else - mj = MSEED - Math.Abs (Seed); - - SeedArray [55] = mj; - mk = 1; - for (int i = 1; i < 55; i++) { // [1, 55] is special (Knuth) - ii = (21 * i) % 55; - SeedArray [ii] = mk; - mk = mj - mk; - if (mk < 0) - mk += MBIG; - mj = SeedArray [ii]; - } - for (int k = 1; k < 5; k++) { - for (int i = 1; i < 56; i++) { - SeedArray [i] -= SeedArray [1 + (i + 30) % 55]; - if (SeedArray [i] < 0) - SeedArray [i] += MBIG; - } - } - inext = 0; - inextp = 31; - } - - protected virtual double Sample () - { - int retVal; - - if (++inext >= 56) inext = 1; - if (++inextp >= 56) inextp = 1; - - retVal = SeedArray [inext] - SeedArray [inextp]; - - if (retVal < 0) - retVal += MBIG; - - SeedArray [inext] = retVal; - - return retVal * (1.0 / MBIG); - } - - public virtual int Next () - { - return (int)(Sample () * int.MaxValue); + x = (uint) Seed; + y = (uint) 987654321; + z = (uint) 43219876; + c = (uint) 6543217; } - public virtual int Next (int maxValue) + uint JKiss () { - if (maxValue < 0) - throw new ArgumentOutOfRangeException(Locale.GetText ( - "Max value is less than min value.")); - - return (int)(Sample () * maxValue); + x = 314527869 * x + 1234567; + y ^= y << 5; + y ^= y >> 7; + y ^= y << 22; + ulong t = ((ulong) 4294584393 * z + c); + c = (uint) (t >> 32); + z = (uint) t; + return (x + y + z); } public virtual int Next (int minValue, int maxValue) { if (minValue > maxValue) - throw new ArgumentOutOfRangeException (Locale.GetText ( - "Min value is greater than max value.")); + throw new ArgumentOutOfRangeException ("Maximum value is less than minimal value."); // special case: a difference of one (or less) will always return the minimum // e.g. -1,-1 or -1,0 will always return -1 @@ -128,7 +79,28 @@ namespace System if (diff <= 1) return minValue; - return (int)((uint)(Sample () * diff) + minValue); + return minValue + ((int) (JKiss () % diff)); + } + + public virtual int Next (int maxValue) + { + if (maxValue < 0) + throw new ArgumentOutOfRangeException ("Maximum value is less than minimal value."); + + return maxValue > 0 ? (int)(JKiss () % maxValue) : 0; + } + + public virtual int Next () + { + // returns a non-negative, [0 - Int32.MacValue], random number + // but we want to avoid calls to Math.Abs (call cost and branching cost it requires) + // and the fact it would throw for Int32.MinValue (so roughly 1 time out of 2^32) + int random = (int) JKiss (); + while (random == Int32.MinValue) + random = (int) JKiss (); + int mask = random >> 31; + random ^= mask; + return random + (mask & 1); } public virtual void NextBytes (byte [] buffer) @@ -136,14 +108,39 @@ namespace System if (buffer == null) throw new ArgumentNullException ("buffer"); - for (int i = 0; i < buffer.Length; i++) { - buffer [i] = (byte)(Sample () * (byte.MaxValue + 1)); + // each random `int` can fill 4 bytes + int p = 0; + uint random; + for (int i = 0; i < (buffer.Length >> 2); i++) { + random = JKiss (); + buffer [p++] = (byte) (random >> 24); + buffer [p++] = (byte) (random >> 16); + buffer [p++] = (byte) (random >> 8); + buffer [p++] = (byte) random; + } + if (p == buffer.Length) + return; + + // complete the array + random = JKiss (); + while (p < buffer.Length) { + buffer [p++] = (byte) random; + random >>= 8; } } public virtual double NextDouble () { - return this.Sample (); + // return a double value between [0,1] + return Sample (); + } + + protected virtual double Sample () + { + // a single 32 bits random value is not enough to create a random double value + uint a = JKiss () >> 6; // Upper 26 bits + uint b = JKiss () >> 5; // Upper 27 bits + return (a * 134217728.0 + b) / 9007199254740992.0; } } -} +}
\ No newline at end of file diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs index d30735f9bd..1d32ab6d41 100644 --- a/mcs/class/corlib/System/String.cs +++ b/mcs/class/corlib/System/String.cs @@ -2710,9 +2710,7 @@ namespace System if (values == null) throw new ArgumentNullException ("values"); - var stringList = new List<string> (); - foreach (var v in values) - stringList.Add (v); + var stringList = new List<string> (values); return JoinUnchecked (separator, stringList.ToArray (), 0, stringList.Count); } @@ -2743,11 +2741,13 @@ namespace System if (values == null) throw new ArgumentNullException ("values"); - var stringList = new List<string> (); - foreach (var v in values) - stringList.Add (v.ToString ()); + var stringList = values as IList<T> ?? new List<T> (values); + var strCopy = new string [stringList.Count]; + int i = 0; + foreach (var v in stringList) + strCopy [i++] = v.ToString (); - return JoinUnchecked (separator, stringList.ToArray (), 0, stringList.Count); + return JoinUnchecked (separator, strCopy, 0, strCopy.Length); } public static bool IsNullOrWhiteSpace (string value) diff --git a/mcs/class/corlib/System/TimeZone.cs b/mcs/class/corlib/System/TimeZone.cs index 316e99ce44..5e11d8d53d 100644 --- a/mcs/class/corlib/System/TimeZone.cs +++ b/mcs/class/corlib/System/TimeZone.cs @@ -357,12 +357,22 @@ namespace System if (time.Kind == DateTimeKind.Utc) return TimeSpan.Zero; - if (IsDaylightSavingTime (time)) + if (IsDaylightSavingTime (time) && !IsAmbiguousTime (time)) return utcOffsetWithDLS; return utcOffsetWithOutDLS; } + private bool IsAmbiguousTime (DateTime time) + { + if (time.Kind == DateTimeKind.Utc) + return false; + + DaylightTime changes = GetDaylightChanges (time.Year); + + return time < changes.End && time >= changes.End - changes.Delta; + } + void IDeserializationCallback.OnDeserialization (object sender) { OnDeserialization (null); diff --git a/mcs/class/corlib/System/Tuples.cs b/mcs/class/corlib/System/Tuples.cs index ac15adfec6..a9631dbbda 100644 --- a/mcs/class/corlib/System/Tuples.cs +++ b/mcs/class/corlib/System/Tuples.cs @@ -48,23 +48,20 @@ namespace System this.item7 = item7; this.rest = rest; - bool ok = true; - if (!typeof (TRest).IsGenericType) - ok = false; - if (ok) { - Type t = typeof (TRest).GetGenericTypeDefinition (); - if (!(t == typeof (Tuple<>) || t == typeof (Tuple<,>) || t == typeof (Tuple<,,>) || t == typeof (Tuple<,,,>) || t == typeof (Tuple<,,,,>) || t == typeof (Tuple <,,,,,>) || t == typeof (Tuple<,,,,,,>) || t == typeof (Tuple<,,,,,,,>))) - ok = false; - } - if (!ok) + if (!(rest is ITuple)) throw new ArgumentException ("rest", "The last element of an eight element tuple must be a Tuple."); } } + interface ITuple + { + string ToString (); + } + /* The rest is generated by the script at the bottom */ [Serializable] - public class Tuple<T1> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; @@ -117,14 +114,19 @@ namespace System return comparer.GetHashCode (item1); } + string ITuple.ToString () + { + return String.Format ("{0}", item1); + } + public override string ToString () { - return String.Format ("({0})", item1); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public class Tuple<T1, T2> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1, T2> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -183,19 +185,25 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - return h; + int h0; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}", item1, item2); } public override string ToString () { - return String.Format ("({0}, {1})", item1, item2); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public class Tuple<T1, T2, T3> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1, T2, T3> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -263,20 +271,26 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - h = (h << 5) - h + comparer.GetHashCode (item3); - return h; + int h0; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item3); + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}, {2}", item1, item2, item3); } public override string ToString () { - return String.Format ("({0}, {1}, {2})", item1, item2, item3); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public class Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -353,21 +367,28 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - h = (h << 5) - h + comparer.GetHashCode (item3); - h = (h << 5) - h + comparer.GetHashCode (item4); - return h; + int h0, h1; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + h1 = comparer.GetHashCode (item3); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item4); + h0 = (h0 << 5) + h0 ^ h1; + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}, {2}, {3}", item1, item2, item3, item4); } public override string ToString () { - return String.Format ("({0}, {1}, {2}, {3})", item1, item2, item3, item4); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public class Tuple<T1, T2, T3, T4, T5> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1, T2, T3, T4, T5> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -453,22 +474,29 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - h = (h << 5) - h + comparer.GetHashCode (item3); - h = (h << 5) - h + comparer.GetHashCode (item4); - h = (h << 5) - h + comparer.GetHashCode (item5); - return h; + int h0, h1; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + h1 = comparer.GetHashCode (item3); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item4); + h0 = (h0 << 5) + h0 ^ h1; + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item5); + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}, {2}, {3}, {4}", item1, item2, item3, item4, item5); } public override string ToString () { - return String.Format ("({0}, {1}, {2}, {3}, {4})", item1, item2, item3, item4, item5); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public class Tuple<T1, T2, T3, T4, T5, T6> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1, T2, T3, T4, T5, T6> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -563,23 +591,31 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - h = (h << 5) - h + comparer.GetHashCode (item3); - h = (h << 5) - h + comparer.GetHashCode (item4); - h = (h << 5) - h + comparer.GetHashCode (item5); - h = (h << 5) - h + comparer.GetHashCode (item6); - return h; + int h0, h1; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + h1 = comparer.GetHashCode (item3); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item4); + h0 = (h0 << 5) + h0 ^ h1; + h1 = comparer.GetHashCode (item5); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item6); + h0 = (h0 << 5) + h0 ^ h1; + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}, {2}, {3}, {4}, {5}", item1, item2, item3, item4, item5, item6); } public override string ToString () { - return String.Format ("({0}, {1}, {2}, {3}, {4}, {5})", item1, item2, item3, item4, item5, item6); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public class Tuple<T1, T2, T3, T4, T5, T6, T7> : IStructuralEquatable, IStructuralComparable, IComparable + public class Tuple<T1, T2, T3, T4, T5, T6, T7> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -683,24 +719,32 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - h = (h << 5) - h + comparer.GetHashCode (item3); - h = (h << 5) - h + comparer.GetHashCode (item4); - h = (h << 5) - h + comparer.GetHashCode (item5); - h = (h << 5) - h + comparer.GetHashCode (item6); - h = (h << 5) - h + comparer.GetHashCode (item7); - return h; + int h0, h1; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + h1 = comparer.GetHashCode (item3); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item4); + h0 = (h0 << 5) + h0 ^ h1; + h1 = comparer.GetHashCode (item5); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item6); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item7); + h0 = (h0 << 5) + h0 ^ h1; + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}, {2}, {3}, {4}, {5}, {6}", item1, item2, item3, item4, item5, item6, item7); } public override string ToString () { - return String.Format ("({0}, {1}, {2}, {3}, {4}, {5}, {6})", item1, item2, item3, item4, item5, item6, item7); + return "(" + ((ITuple) this).ToString () + ")"; } } [Serializable] - public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IStructuralEquatable, IStructuralComparable, IComparable + public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple { T1 item1; T2 item2; @@ -801,20 +845,29 @@ namespace System int IStructuralEquatable.GetHashCode (IEqualityComparer comparer) { - int h = comparer.GetHashCode (item1); - h = (h << 5) - h + comparer.GetHashCode (item2); - h = (h << 5) - h + comparer.GetHashCode (item3); - h = (h << 5) - h + comparer.GetHashCode (item4); - h = (h << 5) - h + comparer.GetHashCode (item5); - h = (h << 5) - h + comparer.GetHashCode (item6); - h = (h << 5) - h + comparer.GetHashCode (item7); - h = (h << 5) - h + comparer.GetHashCode (rest); - return h; + int h0, h1, h2; + h0 = comparer.GetHashCode (item1); + h0 = (h0 << 5) + h0 ^ comparer.GetHashCode (item2); + h1 = comparer.GetHashCode (item3); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item4); + h0 = (h0 << 5) + h0 ^ h1; + h1 = comparer.GetHashCode (item5); + h1 = (h1 << 5) + h1 ^ comparer.GetHashCode (item6); + h2 = comparer.GetHashCode (item7); + h2 = (h2 << 5) + h2 ^ comparer.GetHashCode (rest); + h1 = (h1 << 5) + h1 ^ h2; + h0 = (h0 << 5) + h0 ^ h1; + return h0; + } + + string ITuple.ToString () + { + return String.Format ("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", item1, item2, item3, item4, item5, item6, item7, ((ITuple)rest).ToString ()); } public override string ToString () { - return String.Format ("({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", item1, item2, item3, item4, item5, item6, item7, rest); + return "(" + ((ITuple) this).ToString () + ")"; } } @@ -840,11 +893,11 @@ public class TupleGen Console.WriteLine ("\t[Serializable]"); Console.Write ("\tpublic {0}class ", arity < 8 ? null : "partial "); Console.Write (type_name); - Console.WriteLine (" : IStructuralEquatable, IStructuralComparable, IComparable"); + Console.WriteLine (" : IStructuralEquatable, IStructuralComparable, IComparable, ITuple"); Console.WriteLine ("\t{"); for (int i = 1; i <= arity; ++i) Console.WriteLine ("\t\t{0} {1};", GetItemTypeName (i), GetItemName (i)); - + if (arity < 8) { Console.WriteLine (); Console.Write ("\t\tpublic Tuple ("); @@ -874,17 +927,17 @@ public class TupleGen Console.WriteLine ("\t\t{"); Console.WriteLine ("\t\t\treturn ((IStructuralComparable) this).CompareTo (obj, Comparer<object>.Default);"); Console.WriteLine ("\t\t}"); - + Console.WriteLine (); Console.WriteLine ("\t\tint IStructuralComparable.CompareTo (object other, IComparer comparer)"); Console.WriteLine ("\t\t{"); Console.WriteLine ("\t\t\tvar t = other as {0};", type_name); Console.WriteLine ("\t\t\tif (t == null) {"); Console.WriteLine ("\t\t\t\tif (other == null) return 1;"); - Console.WriteLine ("\t\t\t\tthrow new ArgumentException ("other");"); + Console.WriteLine ("\t\t\t\tthrow new ArgumentException (\"other\");"); Console.WriteLine ("\t\t\t}"); Console.WriteLine (); - + for (int i = 1; i < arity; ++i) { Console.Write ("\t\t\t"); if (i == 1) @@ -894,14 +947,14 @@ public class TupleGen Console.WriteLine ("\t\t\tif (res != 0) return res;"); } Console.WriteLine ("\t\t\treturn comparer.Compare ({0}, t.{0});", GetItemName (arity)); - Console.WriteLine ("\t\t}"); - + Console.WriteLine ("\t\t}"); + Console.WriteLine (); Console.WriteLine ("\t\tpublic override bool Equals (object obj)"); Console.WriteLine ("\t\t{"); Console.WriteLine ("\t\t\treturn ((IStructuralEquatable) this).Equals (obj, EqualityComparer<object>.Default);"); Console.WriteLine ("\t\t}"); - + Console.WriteLine (); Console.WriteLine ("\t\tbool IStructuralEquatable.Equals (object other, IEqualityComparer comparer)"); Console.WriteLine ("\t\t{"); @@ -910,7 +963,7 @@ public class TupleGen Console.WriteLine ("\t\t\t\treturn false;"); Console.WriteLine (); Console.Write ("\t\t\treturn"); - + for (int i = 1; i <= arity; ++i) { if (i == 1) Console.Write (" "); @@ -924,49 +977,91 @@ public class TupleGen Console.WriteLine (";"); } Console.WriteLine ("\t\t}"); - + Console.WriteLine (); Console.WriteLine ("\t\tpublic override int GetHashCode ()"); Console.WriteLine ("\t\t{"); Console.WriteLine ("\t\t\treturn ((IStructuralEquatable) this).GetHashCode (EqualityComparer<object>.Default);"); Console.WriteLine ("\t\t}"); - + Console.WriteLine (); Console.WriteLine ("\t\tint IStructuralEquatable.GetHashCode (IEqualityComparer comparer)"); Console.WriteLine ("\t\t{"); if (arity == 1) { Console.WriteLine ("\t\t\treturn comparer.GetHashCode ({0});", GetItemName (arity)); } else { - Console.WriteLine ("\t\t\tint h = comparer.GetHashCode ({0});", GetItemName (1)); - for (int i = 2; i <= arity; ++i) - Console.WriteLine ("\t\t\th = (h << 5) - h + comparer.GetHashCode ({0});", GetItemName (i)); - Console.WriteLine ("\t\t\treturn h;"); + int varnum = IntLog2 (arity); + Console.Write ("\t\t\tint h0"); + for (int i = 1; i < varnum; ++i) + Console.Write (", h{0}", i); + Console.WriteLine (";"); + + WriteHash (0, 1, arity); + + Console.WriteLine ("\t\t\treturn h0;"); } Console.WriteLine ("\t\t}"); Console.WriteLine (); - Console.WriteLine ("\t\tpublic override string ToString ()"); + Console.WriteLine ("\t\tstring ITuple.ToString ()"); Console.WriteLine ("\t\t{"); - Console.Write ("\t\t\treturn String.Format (\"("); + Console.Write ("\t\t\treturn String.Format (\""); for (int i = 1; i <= arity; ++i) { Console.Write ("{" + (i - 1) + "}"); if (i < arity) Console.Write (", "); } - Console.Write (")\", "); + Console.Write ("\", "); for (int i = 1; i <= arity; ++i) { - Console.Write (GetItemName (i)); + var item_name = GetItemName (i); + Console.Write (i == 8 ? "((ITuple){0}).ToString ()" : "{0}", item_name); if (i < arity) Console.Write (", "); } Console.WriteLine (");"); Console.WriteLine ("\t\t}"); + Console.WriteLine (); + Console.WriteLine ("\t\tpublic override string ToString ()"); + Console.WriteLine ("\t\t{"); + Console.WriteLine ("\t\t\treturn \"(\" + ((ITuple) this).ToString () + \")\";"); + Console.WriteLine ("\t\t}"); + Console.WriteLine ("\t}\n"); } } + static int IntLog2 (int n) + { + int r = -1; + + while (n != 0) { + n >>= 1; + r++; + } + + return r; + } + + static void WriteHash (int destVar, int start, int count) + { + if (count == 1) { + Console.WriteLine ("\t\t\th{0} = comparer.GetHashCode ({1});", destVar, GetItemName (start)); + } else { + int subCount = 1 << IntLog2 (count - 1); + WriteHash (destVar, start, subCount); + start += subCount; + count -= subCount; + if (count == 1) { + Console.WriteLine ("\t\t\th{0} = (h{0} << 5) + h{0} ^ comparer.GetHashCode ({1});", destVar, GetItemName (start)); + } else { + WriteHash (destVar + 1, start, count); + Console.WriteLine ("\t\t\th{0} = (h{0} << 5) + h{0} ^ h{1};", destVar, destVar + 1); + } + } + } + static string GetTypeName (int arity) { StringBuilder sb = new StringBuilder (); @@ -977,19 +1072,20 @@ public class TupleGen sb.Append (", "); } sb.Append (">"); - + return sb.ToString (); } - + static string GetItemName (int arity) { return arity < 8 ? "item" + arity.ToString () : "rest"; } - + static string GetItemTypeName (int arity) { return arity < 8 ? "T" + arity.ToString () : "TRest"; } } + #endif diff --git a/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs b/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs index a2c030c0c9..3bffaf3b83 100644..100755 --- a/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs +++ b/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs @@ -2201,6 +2201,8 @@ namespace MonoTests.Microsoft.Win32 } [Test] + // This hangs on windows + [Category ("NotWorking")] public void OpenRemoteBaseKey_MachineName_DoesNotExist () { // access to registry of remote machines is not implemented on unix diff --git a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs index cb5b9f7cf1..9ac58e0fdd 100644 --- a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs @@ -30,8 +30,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; using System.Collections.Generic; @@ -286,6 +284,10 @@ namespace MonoTests.System.Collections.Generic { Assert.AreEqual (l1.Count, l1.Capacity); for (int i = 0; i < l1.Count; i++) Assert.AreEqual (_list1 [i], l1 [i]); + + var input = new [] { "a", "b", "c" }; + var l2 = new List<string>(input); + Assert.AreEqual (3, l2.Capacity); } [Test, ExpectedException (typeof (ArgumentNullException))] @@ -555,12 +557,55 @@ namespace MonoTests.System.Collections.Generic { i = _list1.FindIndex (FindMultipleOfTwelve); Assert.AreEqual (-1, i); + + var a = new List<int> () { 2, 2, 2, 3, 2 }; + Assert.AreEqual (2, a.FindIndex (2, 2, l => true)); } - [Test, ExpectedException (typeof (ArgumentNullException))] - public void FindIndexNullTest () + [Test] + public void FindIndex_Invalid () { - int i = _list1.FindIndex (null); + try { + _list1.FindIndex (null); + Assert.Fail ("#1"); + } catch (ArgumentNullException) { + } + + try { + _list1.FindIndex (-1, l => true); + Assert.Fail ("#2"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindIndex (-1, 0, l => true); + Assert.Fail ("#2b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindIndex (0, -1, l => true); + Assert.Fail ("#3"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindIndex (100, l => true); + Assert.Fail ("#4"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindIndex (100, 0, l => true); + Assert.Fail ("#4b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindIndex (7, 2, l => true); + Assert.Fail ("#5"); + } catch (ArgumentOutOfRangeException) { + } } [Test] @@ -579,8 +624,6 @@ namespace MonoTests.System.Collections.Generic { int i = _list1.FindLast (null); } - // FIXME currently generates Invalid IL Code error - /* [Test] public void ForEachTest () { @@ -589,7 +632,7 @@ namespace MonoTests.System.Collections.Generic { Assert.AreEqual (418, i); } - */ + [Test] public void FindLastIndexTest () { @@ -601,12 +644,56 @@ namespace MonoTests.System.Collections.Generic { i = _list1.FindIndex (FindMultipleOfTwelve); Assert.AreEqual (-1, i); + + Assert.AreEqual (2, _list1.FindLastIndex (2, 3, l => true)); + Assert.AreEqual (2, _list1.FindLastIndex (2, 2, l => true)); + Assert.AreEqual (1, _list1.FindLastIndex (1, 2, l => true)); } - [Test, ExpectedException (typeof (ArgumentNullException))] - public void FindLastIndexNullTest () + [Test] + public void FindLastIndex_Invalid () { - int i = _list1.FindLastIndex (null); + try { + _list1.FindLastIndex (null); + Assert.Fail ("#1"); + } catch (ArgumentNullException) { + } + + try { + _list1.FindLastIndex (-1, l => true); + Assert.Fail ("#2"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindLastIndex (-1, 0, l => true); + Assert.Fail ("#2b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindLastIndex (0, -1, l => true); + Assert.Fail ("#3"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindLastIndex (100, l => true); + Assert.Fail ("#4"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindLastIndex (100, 0, l => true); + Assert.Fail ("#4b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + _list1.FindLastIndex (2, 4, l => true); + Assert.Fail ("#5"); + } catch (ArgumentOutOfRangeException) { + } } [Test] @@ -1464,5 +1551,4 @@ namespace MonoTests.System.Collections.Generic { } } -#endif diff --git a/mcs/class/corlib/Test/System.Diagnostics/DebuggerDisplayAttributeTest.cs b/mcs/class/corlib/Test/System.Diagnostics/DebuggerDisplayAttributeTest.cs index 3dbcccdf29..5564e47a36 100644 --- a/mcs/class/corlib/Test/System.Diagnostics/DebuggerDisplayAttributeTest.cs +++ b/mcs/class/corlib/Test/System.Diagnostics/DebuggerDisplayAttributeTest.cs @@ -1,5 +1,5 @@ // -// MonoTests.System.Diagnostics.DebuggerDisplayAttributeTest.cs +// DebuggerDisplayAttributeTest.cs // // Author: // Rolf Bjarne Kvinge (RKvinge@novell.com) @@ -7,8 +7,6 @@ // (C) 2007 // -#if NET_2_0 - using System; using System.Diagnostics; using NUnit.Framework; @@ -172,5 +170,3 @@ namespace MonoTests.System.Diagnostics } } } - -#endif
\ No newline at end of file diff --git a/mcs/class/corlib/Test/System.Diagnostics/DebuggerTypeProxyAttribute.cs b/mcs/class/corlib/Test/System.Diagnostics/DebuggerTypeProxyAttribute.cs new file mode 100644 index 0000000000..bd3297d3cb --- /dev/null +++ b/mcs/class/corlib/Test/System.Diagnostics/DebuggerTypeProxyAttribute.cs @@ -0,0 +1,56 @@ +// +// DecoupledTask.cs +// +// Authors: +// Marek Safar <marek.safar@gmail.com> +// +// Copyright 2013 Xamarin Inc (http://www.xamarin.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. +// +// + +using System; +using System.Diagnostics; +using NUnit.Framework; + +namespace MonoTests.System.Diagnostics +{ + [TestFixture] + public class DebuggerTypeProxyAttributeTest + { + [Test] + public void Constructor_Type () + { + var dtp = new DebuggerTypeProxyAttribute (typeof (string)); + Assert.IsNull (dtp.Target, "#1"); + Assert.AreEqual (typeof (string).AssemblyQualifiedName, dtp.ProxyTypeName, "#2"); + } + + [Test] + public void Constructor_Type_Invalid () + { + try { + new DebuggerTypeProxyAttribute (null as Type); + Assert.Fail (); + } catch (ArgumentNullException) { + } + } + } +} diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs index 033cc08539..0f7646b036 100644 --- a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs +++ b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs @@ -42,6 +42,7 @@ namespace MonoTests.System.Diagnostics /// Tests whether getting file name works. /// </summary> [Test] + [Category("LLVMNotWorking")] public void TestGetFileName () { Assert.AreEqual ("dir/someFile", @@ -57,6 +58,7 @@ namespace MonoTests.System.Diagnostics /// Tests whether getting file line number works. /// </summary> [Test] + [Category("LLVMNotWorking")] public void TestGetFileLineNumber () { Assert.AreEqual (13, @@ -152,6 +154,7 @@ namespace MonoTests.System.Diagnostics } [Test] + [Category ("LLVMNotWorking")] public void TestGetFileName2 () { Assert.IsNotNull (frame2.GetFileName (), "File name not null"); @@ -164,13 +167,14 @@ namespace MonoTests.System.Diagnostics /// Tests whether getting file line number works. /// </summary> [Test] + [Category ("LLVMNotWorking")] public void TestGetFileLineNumber () { Assert.AreEqual (0, frame1.GetFileLineNumber (), "Line number (1)"); - Assert.AreEqual (132, + Assert.AreEqual (134, frame2.GetFileLineNumber (), "Line number (2)"); @@ -280,6 +284,7 @@ namespace MonoTests.System.Diagnostics /// Tests whether getting file name works. /// </summary> [Test] + [Category ("LLVMNotWorking")] public void TestGetFileName () { Assert.IsNull (frame1.GetFileName (), @@ -299,13 +304,14 @@ namespace MonoTests.System.Diagnostics #if ONLY_1_1 [Category ("NotDotNet")] // .NET 1.1 is off by one #endif + [Category ("LLVMNotWorking")] public void TestGetFileLineNumber () { Assert.AreEqual (0, frame1.GetFileLineNumber (), "Line number (1)"); - Assert.AreEqual (260, + Assert.AreEqual (264, frame2.GetFileLineNumber (), "Line number (2)"); } diff --git a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs index 7714f53ab3..45fd5d0e99 100644 --- a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs @@ -599,5 +599,122 @@ namespace MonoTests.System.Globalization // https://bugzilla.xamarin.com/show_bug.cgi?id=3471 new CultureInfo ("en-HK"); } + +#if NET_4_5 + CountdownEvent barrier = new CountdownEvent (3); + AutoResetEvent[] evt = new AutoResetEvent [] { new AutoResetEvent (false), new AutoResetEvent (false), new AutoResetEvent (false)}; + + CultureInfo[] initial_culture = new CultureInfo[3]; + CultureInfo[] changed_culture = new CultureInfo[3]; + CultureInfo[] changed_culture2 = new CultureInfo[3]; + CultureInfo alternative_culture = new CultureInfo("pt-BR"); + + void StepAllPhases (int index) + { + initial_culture [index] = CultureInfo.CurrentCulture; + /*Phase 1 - we witness the original value */ + barrier.Signal (); + + /*Phase 2 - main thread changes culture */ + evt [index].WaitOne (); + + /*Phase 3 - we witness the new value */ + changed_culture [index] = CultureInfo.CurrentCulture; + barrier.Signal (); + + /* Phase 4 - main thread changes culture back */ + evt [index].WaitOne (); + + /*Phase 5 - we witness the new value */ + changed_culture2 [index] = CultureInfo.CurrentCulture; + barrier.Signal (); + } + + void ThreadWithoutChange () { + StepAllPhases (0); + } + + void ThreadWithChange () { + Thread.CurrentThread.CurrentCulture = alternative_culture; + StepAllPhases (1); + } + + void ThreadPoolWithoutChange () { + StepAllPhases (2); + } + + [Test] + public void DefaultThreadCurrentCulture () { + var orig_culture = CultureInfo.CurrentCulture; + var new_culture = new CultureInfo("fr-FR"); + + // The test doesn't work if the current culture is already set + if (orig_culture != CultureInfo.InvariantCulture) + return; + + /* Phase 0 - warm up */ + new Thread (ThreadWithoutChange).Start (); + new Thread (ThreadWithChange).Start (); + Action x = ThreadPoolWithoutChange; + x.BeginInvoke (null, null); + + /* Phase 1 - let everyone witness initial values */ + initial_culture [0] = CultureInfo.CurrentCulture; + barrier.Wait (); + barrier.Reset (); + + /* Phase 2 - change the default culture*/ + CultureInfo.DefaultThreadCurrentCulture = new_culture; + evt [0].Set (); + evt [1].Set (); + evt [2].Set (); + /* Phase 3 - let everyone witness the new value */ + changed_culture [0] = CultureInfo.CurrentCulture; + barrier.Wait (); + barrier.Reset (); + + /* Phase 4 - revert the default culture back to null */ + CultureInfo.DefaultThreadCurrentCulture = null; + evt [0].Set (); + evt [1].Set (); + evt [2].Set (); + + /* Phase 5 - let everyone witness the new value */ + changed_culture2 [0] = CultureInfo.CurrentCulture; + barrier.Wait (); + barrier.Reset (); + + CultureInfo.DefaultThreadCurrentCulture = null; + + Assert.AreEqual (orig_culture, initial_culture [0], "#2"); + Assert.AreEqual (alternative_culture, initial_culture [1], "#3"); + Assert.AreEqual (orig_culture, initial_culture [2], "#4"); + + Assert.AreEqual (new_culture, changed_culture [0], "#6"); + Assert.AreEqual (alternative_culture, changed_culture [1], "#7"); + Assert.AreEqual (new_culture, changed_culture [2], "#8"); + + Assert.AreEqual (orig_culture, changed_culture2 [0], "#10"); + Assert.AreEqual (alternative_culture, changed_culture2 [1], "#11"); + Assert.AreEqual (orig_culture, changed_culture2 [2], "#12"); + } + + [Test] + public void DefaultThreadCurrentCultureAndNumberFormaters () { + string us_str = null; + string br_str = null; + var thread = new Thread (() => { + CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); + us_str = 100000.ToString ("C"); + CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("pt-BR"); + br_str = 100000.ToString ("C"); + }); + thread.Start (); + thread.Join (); + CultureInfo.DefaultThreadCurrentCulture = null; + Assert.AreEqual ("$100,000.00", us_str, "#1"); + Assert.AreEqual ("R$ 100.000,00", br_str, "#2"); + } +#endif } } diff --git a/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs index d3d388f670..e0230b788a 100644 --- a/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs @@ -94,11 +94,11 @@ namespace MonoTests.System.Globalization { CultureInfo ci = new CultureInfo ("es-ES"); DateTimeFormatInfo di = ci.DateTimeFormat; - Assert.AreEqual ("dddd, dd' de 'MMMM' de 'yyyy", di.LongDatePattern, "#1"); + Assert.AreEqual ("dddd, d' de 'MMMM' de 'yyyy", di.LongDatePattern, "#1"); Assert.AreEqual ("H:mm:ss", di.LongTimePattern, "#2"); - Assert.AreEqual ("dddd, dd' de 'MMMM' de 'yyyy H:mm:ss", di.FullDateTimePattern, "#3"); + Assert.AreEqual ("dddd, d' de 'MMMM' de 'yyyy H:mm:ss", di.FullDateTimePattern, "#3"); Assert.AreEqual ("MMMM' de 'yyyy", di.YearMonthPattern, "#4"); - Assert.AreEqual ("dd MMMM", di.MonthDayPattern, "#5"); + Assert.AreEqual ("d' de 'MMMM", di.MonthDayPattern, "#5"); } [Test] diff --git a/mcs/class/corlib/Test/System.Globalization/NumberFormatInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/NumberFormatInfoTest.cs new file mode 100644 index 0000000000..a195c28f72 --- /dev/null +++ b/mcs/class/corlib/Test/System.Globalization/NumberFormatInfoTest.cs @@ -0,0 +1,57 @@ +// +// NumberFormatInfoTest.cs +// +// Authors: +// Marek Safar (marek.safar@gmail.com) +// +// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.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. +// + + +using NUnit.Framework; +using System; +using System.Globalization; + +namespace MonoTests.System.Globalization +{ + [TestFixture] + public class NumberFormatInfoTest + { + [Test] + public void CurrencyDecimalDigits () + { + CultureInfo c; + + c = CultureInfo.GetCultureInfo ("id-ID"); + Assert.AreEqual (0, c.NumberFormat.CurrencyDecimalDigits, "#1"); + + c = CultureInfo.GetCultureInfo ("is-IS"); + Assert.AreEqual (0, c.NumberFormat.CurrencyDecimalDigits, "#2"); + + c = CultureInfo.InvariantCulture; + Assert.AreEqual (2, c.NumberFormat.CurrencyDecimalDigits, "#3"); + + } + } +} + + diff --git a/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs index 5113cc5e98..9629dacf4b 100644 --- a/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs @@ -24,10 +24,11 @@ public class TextInfoTest { { TextInfo ti = new CultureInfo ("en-US", false).TextInfo; - Assert.AreEqual (" The Dog", ti.ToTitleCase (" the dog")); - Assert.AreEqual (" The Dude", ti.ToTitleCase (" The Dude")); - Assert.AreEqual ("La Guerra Yla Paz", ti.ToTitleCase ("la Guerra yLa pAz")); - Assert.AreEqual ("\tTab\tAnd\tPeace", ti.ToTitleCase ("\ttab\taNd\tpeaCE")); + Assert.AreEqual (" The Dog", ti.ToTitleCase (" the dog"), "#1"); + Assert.AreEqual (" The Dude", ti.ToTitleCase (" The Dude"), "#2"); + Assert.AreEqual ("La Guerra Yla Paz", ti.ToTitleCase ("la Guerra yLa pAz"), "#3"); + Assert.AreEqual ("\tTab\tAnd\tPeace", ti.ToTitleCase ("\ttab\taNd\tpeaCE"), "#4"); + Assert.AreEqual ("This_Is\uFE58A\u0095String\u06D4With\uFE33Separators", ti.ToTitleCase ("this_is\uFE58a\u0095string\u06D4with\uFE33separators"), "#5"); } [Test] diff --git a/mcs/class/corlib/Test/System.IO/FileTest.cs b/mcs/class/corlib/Test/System.IO/FileTest.cs index 6267439aed..112978ae8b 100644 --- a/mcs/class/corlib/Test/System.IO/FileTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileTest.cs @@ -2760,5 +2760,53 @@ namespace MonoTests.System.IO } } #endif + + void MoveTest (FileAccess acc, FileShare share, bool works) + { + var file = "kk597rfdnllh89"; + + File.Delete (file + ".old"); + using (var v = File.Create (file)) { } + + using (var stream = new FileStream(file, FileMode.Open, acc, share, 4096, FileOptions.SequentialScan)) { + try { + File.Move(file, file + ".old"); + if (!works) + Assert.Fail ("Move with ({0}) and ({1}) did not fail", acc, share); + } catch (IOException) { + if (works) + Assert.Fail ("Move with ({0}) and ({1}) did fail", acc, share); + } + } + } + + [Test] + public void MoveTest () + { + MoveTest (FileAccess.Read, FileShare.None, false); + MoveTest (FileAccess.Read, FileShare.Read, false); + MoveTest (FileAccess.Read, FileShare.Write, false); + MoveTest (FileAccess.Read, FileShare.ReadWrite, false); + MoveTest (FileAccess.Read, FileShare.Delete, true); + MoveTest (FileAccess.Read, FileShare.Read | FileShare.Delete, true); + MoveTest (FileAccess.Read, FileShare.Write | FileShare.Delete, true); + MoveTest (FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, true); + MoveTest (FileAccess.Write, FileShare.None, false); + MoveTest (FileAccess.Write, FileShare.Read, false); + MoveTest (FileAccess.Write, FileShare.Write, false); + MoveTest (FileAccess.Write, FileShare.ReadWrite, false); + MoveTest (FileAccess.Write, FileShare.Delete, true); + MoveTest (FileAccess.Write, FileShare.Read | FileShare.Delete, true); + MoveTest (FileAccess.Write, FileShare.Write | FileShare.Delete, true); + MoveTest (FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, true); + MoveTest (FileAccess.ReadWrite, FileShare.None, false); + MoveTest (FileAccess.ReadWrite, FileShare.Read, false); + MoveTest (FileAccess.ReadWrite, FileShare.Write, false); + MoveTest (FileAccess.ReadWrite, FileShare.ReadWrite, false); + MoveTest (FileAccess.ReadWrite, FileShare.Delete, true); + MoveTest (FileAccess.ReadWrite, FileShare.Read | FileShare.Delete, true); + MoveTest (FileAccess.ReadWrite, FileShare.Write | FileShare.Delete, true); + MoveTest (FileAccess.ReadWrite, FileShare.ReadWrite | FileShare.Delete, true); + } } } diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs index 692a735950..7953d46250 100644 --- a/mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs +++ b/mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs @@ -11074,5 +11074,53 @@ namespace MonoTests.System.Reflection.Emit Activator.CreateInstance (t, new object[] { "string"}); } + public interface IFace16096 { + object Bar (); + } + + [Test] + public void MemberRef_Caching_16096 () { + var outer_class = module.DefineType( + "container", + TypeAttributes.Class | TypeAttributes.Public, + typeof(object)); + + var builder = outer_class.DefineNestedType( + "bind@32-1", + TypeAttributes.Class | TypeAttributes.Public, + typeof(object)); + + builder.AddInterfaceImplementation (typeof (IFace16096)); + + var ctor = builder.DefineDefaultConstructor (MethodAttributes.Public); + var field = builder.DefineField ("Field", typeof (object), FieldAttributes.Public); + var g_args = builder.DefineGenericParameters("b","a"); + var method = builder.DefineMethod ("Bar", MethodAttributes.Public | MethodAttributes.Virtual, typeof (object), new Type [0]); + + var il = method.GetILGenerator(); + il.Emit (OpCodes.Ldarg_0); + il.Emit (OpCodes.Ldfld, TypeBuilder.GetField (builder.MakeGenericType (g_args), field)); + il.Emit (OpCodes.Pop); + il.Emit (OpCodes.Newobj, TypeBuilder.GetConstructor (builder.MakeGenericType (g_args), ctor)); + il.Emit (OpCodes.Ret); + + var type = builder.CreateType (); + + /*Build a gshared instance. */ + var ginst = type.MakeGenericType (typeof (List<char>), typeof (object)); + var ins = (IFace16096)Activator.CreateInstance (ginst); + + /* This will trigger the runtime to cache the MEMBER_REF to the .ctor as it won't have a context. */ + var ins2 = ins.Bar (); + Assert.IsNotNull (ins2); + + /* Build an unsharable version. */ + var ginst2 = type.MakeGenericType (typeof (List<char>), typeof (char)); + var ins3 = (IFace16096)Activator.CreateInstance (ginst2); + + /* This will trigger the runtime to use the cached version, which is wrong as it's an open type. */ + var ins4 = ins3.Bar (); + Assert.IsNotNull (ins4); + } } } diff --git a/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs b/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs index fc36438b45..0e26ea1770 100644 --- a/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs @@ -1177,9 +1177,7 @@ public class AssemblyNameTest { Assert.AreEqual (an.HashAlgorithm, clone.HashAlgorithm, "HashAlgorithm"); Assert.AreEqual (an.KeyPair, clone.KeyPair, "KeyPair"); Assert.AreEqual (an.Name, clone.Name, "Name"); -#if NET_2_0 - Assert.AreEqual (an.ProcessorArchitecture, clone.ProcessorArchitecture, "PA"); -#endif + //Assert.AreEqual (an.ProcessorArchitecture, clone.ProcessorArchitecture, "PA"); Assert.AreEqual (an.Version, clone.Version, "Version"); Assert.AreEqual (an.VersionCompatibility, clone.VersionCompatibility, "VersionCompatibility"); Assert.AreEqual (an.GetPublicKey (), clone.GetPublicKey (), "GetPublicKey"); diff --git a/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs index ff1d915632..b22f46f365 100644 --- a/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs @@ -98,6 +98,15 @@ namespace MonoTests.System.Reflection Assert.AreEqual (ParamEnum.Foo, info [5].DefaultValue, "#2"); } +#if NET_4_5 + [Test] + public void HasDefaultValueEnum () { + ParameterInfo[] info = typeof (ParameterInfoTest).GetMethod ("paramMethod").GetParameters (); + + Assert.IsTrue (info [5].HasDefaultValue); + } +#endif + public static void Sample2 ([DecimalConstantAttribute(2,2,2,2,2)] decimal a, [DateTimeConstantAttribute(123456)] DateTime b) {} [Test] @@ -117,7 +126,19 @@ namespace MonoTests.System.Reflection Assert.AreEqual (pi [1].DefaultValue.GetType (), typeof (Missing), "#2"); } - public void Sample (int a, [Optional] int b) +#if NET_4_5 + [Test] + public void TestHasDefaultValues () + { + ParameterInfo [] pi = typeof (ParameterInfoTest).GetMethod ("Sample").GetParameters (); + + Assert.IsFalse (pi [0].HasDefaultValue, "#1"); + Assert.IsFalse (pi [1].HasDefaultValue, "#2"); + Assert.IsTrue (pi [2].HasDefaultValue, "#3"); + } +#endif + + public void Sample (int a, [Optional] int b, object c = null) { } @@ -235,6 +256,14 @@ namespace MonoTests.System.Reflection Assert.AreEqual (decimal.MaxValue, info [0].DefaultValue); } +#if NET_4_5 + [Test] + public void HasDefaultValueDecimal () { + var info = typeof (ParameterInfoTest).GetMethod ("TestC").GetParameters (); + Assert.IsTrue (info [0].HasDefaultValue); + } +#endif + class MyParameterInfo2 : ParameterInfo { public ParameterAttributes MyAttrsImpl; diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest.cs b/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest.cs index 48f629adfa..18b2099b8d 100644 --- a/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest.cs +++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest.cs @@ -33,12 +33,45 @@ using System.Threading; using System.Threading.Tasks; using NUnit.Framework; using System.Runtime.CompilerServices; +using System.Collections.Generic; namespace MonoTests.System.Runtime.CompilerServices { [TestFixture] public class TaskAwaiterTest { + class Scheduler : TaskScheduler + { + string name; + + public Scheduler (string name) + { + this.name = name; + } + + public int InlineCalls { get; set; } + public int QueueCalls { get; set; } + + protected override IEnumerable<Task> GetScheduledTasks () + { + throw new NotImplementedException (); + } + + protected override void QueueTask (Task task) + { + ++QueueCalls; + ThreadPool.QueueUserWorkItem (o => { + TryExecuteTask (task); + }); + } + + protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued) + { + ++InlineCalls; + return false; + } + } + [Test] public void GetResultFaulted () { @@ -85,6 +118,72 @@ namespace MonoTests.System.Runtime.CompilerServices awaiter.GetResult (); Assert.AreEqual (TaskStatus.RanToCompletion, task.Status); } + + [Test] + public void CustomScheduler () + { + // some test runners (e.g. Touch.Unit) will execute this on the main thread and that would lock them + if (!Thread.CurrentThread.IsBackground) + return; + + var a = new Scheduler ("a"); + var b = new Scheduler ("b"); + + var t = TestCS (a, b); + Assert.IsTrue (t.Wait (3000), "#0"); + Assert.AreEqual (0, t.Result, "#1"); + Assert.AreEqual (1, a.InlineCalls, "#2a"); + Assert.AreEqual (0, b.InlineCalls, "#2b"); + Assert.AreEqual (2, a.QueueCalls, "#3a"); + Assert.AreEqual (1, b.QueueCalls, "#3b"); + } + + static async Task<int> TestCS (TaskScheduler schedulerA, TaskScheduler schedulerB) + { + var res = await Task.Factory.StartNew (async () => { + if (TaskScheduler.Current != schedulerA) + return 1; + + await Task.Factory.StartNew ( + () => { + if (TaskScheduler.Current != schedulerB) + return 2; + + return 0; + }, CancellationToken.None, TaskCreationOptions.None, schedulerB); + + if (TaskScheduler.Current != schedulerA) + return 3; + + return 0; + }, CancellationToken.None, TaskCreationOptions.None, schedulerA); + + return res.Result; + } + + [Test] + public void FinishedTaskOnCompleted () + { + var mres = new ManualResetEvent (false); + var mres2 = new ManualResetEvent (false); + + var tcs = new TaskCompletionSource<object> (); + tcs.SetResult (null); + var task = tcs.Task; + + var awaiter = task.GetAwaiter (); + Assert.IsTrue (awaiter.IsCompleted, "#1"); + + awaiter.OnCompleted(() => { + if (mres.WaitOne (1000)) + mres2.Set (); + }); + + mres.Set (); + // this will only terminate correctly if the test was not executed from the main thread + // e.g. Touch.Unit defaults to run tests on the main thread and this will return false + Assert.AreEqual (Thread.CurrentThread.IsBackground, mres2.WaitOne (2000), "#2");; + } } } diff --git a/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs b/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs index d3a1e2de3c..4c84824c91 100644 --- a/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs +++ b/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs @@ -213,9 +213,6 @@ namespace MonoTests.System.Security.Principal { } [Test] -#if __IOS__ - [Ignore ("https://bugzilla.xamarin.com/show_bug.cgi?id=12789")] -#endif public void SerializeRoundTrip () { WindowsIdentity wi = WindowsIdentity.GetCurrent (); diff --git a/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs b/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs index 1f53af7e3e..91a465c13d 100644 --- a/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs +++ b/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs @@ -125,34 +125,36 @@ namespace MonoTests.System.Text } [Test] -#if NET_2_0 - [Category ("NotWorking")] -#endif public void TestMaxCharCount() { UTF8Encoding UTF8enc = new UTF8Encoding (); -#if NET_2_0 - // hmm, where is this extra 1 coming from? + Encoding UTF8encWithBOM = new UTF8Encoding(true); Assert.AreEqual (51, UTF8enc.GetMaxCharCount(50), "UTF #1"); -#else - Assert.AreEqual (50, UTF8enc.GetMaxCharCount(50), "UTF #1"); -#endif + Assert.AreEqual (UTF8enc.GetMaxByteCount(50), UTF8encWithBOM.GetMaxByteCount(50), "UTF #2"); + } + + [Test] + public void TestMaxCharCountWithCustomFallback() + { + Encoding encoding = Encoding.GetEncoding("utf-8", new EncoderReplacementFallback("\u2047\u2047"), new DecoderReplacementFallback("\u2047\u2047")); + Assert.AreEqual (102, encoding.GetMaxCharCount(50), "UTF #1"); } [Test] -#if NET_2_0 - [Category ("NotWorking")] -#endif public void TestMaxByteCount() { UTF8Encoding UTF8enc = new UTF8Encoding (); -#if NET_2_0 - // maybe under .NET 2.0 insufficient surrogate pair is - // just not handled, and 3 is Preamble size. + Encoding UTF8encWithBOM = new UTF8Encoding(true); + Assert.AreEqual (153, UTF8enc.GetMaxByteCount(50), "UTF #1"); -#else - Assert.AreEqual (200, UTF8enc.GetMaxByteCount(50), "UTF #1"); -#endif + Assert.AreEqual (UTF8enc.GetMaxByteCount(50), UTF8encWithBOM.GetMaxByteCount(50), "UTF #2"); + } + + [Test] + public void TestMaxByteCountWithCustomFallback() + { + Encoding encoding = Encoding.GetEncoding("utf-8", new EncoderReplacementFallback("\u2047\u2047"), new DecoderReplacementFallback("?")); + Assert.AreEqual (306, encoding.GetMaxByteCount(50), "UTF #1"); } // regression for bug #59648 diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs index 16db84cb41..857841e326 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs @@ -282,6 +282,16 @@ namespace MonoTests.System.Threading.Tasks } [Test] + public void ContinueWhenAny_WithResult () + { + var tcs = new TaskCompletionSource<int>(); + tcs.SetResult(1); + Task[] tasks = new[] { tcs.Task }; + var res = Task.Factory.ContinueWhenAny (tasks, l => 4); + Assert.AreEqual (4, res.Result); + } + + [Test] public void ContinueWhenAny_InvalidArguments () { try { @@ -594,16 +604,24 @@ namespace MonoTests.System.Threading.Tasks [Test] public void StartNewCancelled () { - var cts = new CancellationTokenSource (); - cts.Cancel (); + var ct = new CancellationToken (true); - var task = factory.StartNew (() => Assert.Fail ("Should never be called"), cts.Token); + var task = factory.StartNew (() => Assert.Fail ("Should never be called"), ct); try { task.Start (); + Assert.Fail ("#1"); } catch (InvalidOperationException) { } Assert.IsTrue (task.IsCanceled, "#2"); + + task = factory.StartNew (() => { }, ct); + try { + task.Wait (); + } catch (AggregateException e) { + Assert.IsTrue (task.IsCanceled, "#3"); + Assert.That (e.InnerException, Is.TypeOf (typeof (TaskCanceledException)), "#4"); + } } } } diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs index 0c30a093b0..ff964bb9cf 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs @@ -33,6 +33,9 @@ using System.Threading; using System.Threading.Tasks; using NUnit.Framework; +#if !MOBILE +using NUnit.Framework.SyntaxHelpers; +#endif namespace MonoTests.System.Threading.Tasks { @@ -249,6 +252,29 @@ namespace MonoTests.System.Threading.Tasks Assert.AreEqual ("1", task.Result, "#2"); } + [Test] + public void StartNewCancelled () + { + var ct = new CancellationToken (true); + var factory = new TaskFactory<int> (); + + var task = factory.StartNew (() => { Assert.Fail ("Should never be called"); return 1; }, ct); + try { + task.Start (); + Assert.Fail ("#1"); + } catch (InvalidOperationException) { + } + + Assert.IsTrue (task.IsCanceled, "#2"); + + task = factory.StartNew (() => 1, ct); + try { + task.Wait (); + } catch (AggregateException e) { + Assert.IsTrue (task.IsCanceled, "#3"); + Assert.That (e.InnerException, Is.TypeOf (typeof (TaskCanceledException)), "#4"); + } + } } } diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs index d9811306fb..1f3c156d77 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs @@ -838,6 +838,23 @@ namespace MonoTests.System.Threading.Tasks } [Test] + public void RunSynchronously_SchedulerException () + { + var scheduler = new MockScheduler (); + scheduler.TryExecuteTaskInlineHandler += (task, b) => { + throw new ApplicationException (); + }; + + Task t = new Task (() => { }); + try { + t.RunSynchronously (scheduler); + Assert.Fail (); + } catch (Exception e) { + Assert.AreEqual (t.Exception.InnerException, e); + } + } + + [Test] public void RunSynchronouslyWithAttachedChildren () { var result = false; @@ -1126,6 +1143,15 @@ namespace MonoTests.System.Threading.Tasks } [Test] + public void Delay_TimeManagement () + { + var delay1 = Task.Delay(50); + var delay2 = Task.Delay(25); + Assert.IsTrue (Task.WhenAny(new[] { delay1, delay2 }).Wait (1000)); + Assert.AreEqual (TaskStatus.RanToCompletion, delay2.Status); + } + + [Test] public void WaitAny_WithNull () { var tasks = new [] { @@ -1141,6 +1167,16 @@ namespace MonoTests.System.Threading.Tasks } [Test] + public void WhenAll_Empty () + { + var tasks = new Task[0]; + + Task t = Task.WhenAll(tasks); + + Assert.IsTrue(t.Wait(1000), "#1"); + } + + [Test] public void WhenAll_WithNull () { var tasks = new[] { @@ -1266,6 +1302,18 @@ namespace MonoTests.System.Threading.Tasks } [Test] + public void WhenAllResult_Empty () + { + var tasks = new Task<int>[0]; + + Task<int[]> t = Task.WhenAll(tasks); + + Assert.IsTrue(t.Wait(1000), "#1"); + Assert.IsNotNull(t.Result, "#2"); + Assert.AreEqual(t.Result.Length, 0, "#3"); + } + + [Test] public void WhenAllResult_WithNull () { var tasks = new[] { diff --git a/mcs/class/corlib/Test/System.Threading/AutoResetEventTest.cs b/mcs/class/corlib/Test/System.Threading/AutoResetEventTest.cs index 6f9c23fc5f..df0a77631c 100644 --- a/mcs/class/corlib/Test/System.Threading/AutoResetEventTest.cs +++ b/mcs/class/corlib/Test/System.Threading/AutoResetEventTest.cs @@ -66,6 +66,8 @@ namespace MonoTests.System.Threading } [Test] // bug #81529 + // Causes a Attempting to unref unused handle 0x2 warning + [Category ("NotWorking")] public void Handle_Valid () { AutoResetEvent are1 = new AutoResetEvent (false); diff --git a/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs b/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs index 644d0c5049..24534c3fd8 100644 --- a/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs +++ b/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs @@ -132,6 +132,20 @@ namespace MonoTests.System.Threading [Test] + public void Cancel_Order () + { + var cts = new CancellationTokenSource (); + var current = 0; + Action<object> a = x => { Assert.AreEqual(current, x); current++; }; + + cts.Token.Register (a, 2); + cts.Token.Register (a, 1); + cts.Token.Register (a, 0); + cts.Cancel (); + } + + + [Test] public void CancelWithDispose () { CancellationTokenSource cts = new CancellationTokenSource (); @@ -193,6 +207,25 @@ namespace MonoTests.System.Threading } [Test] + public void Cancel_ExceptionOrder () + { + var cts = new CancellationTokenSource (); + + cts.Token.Register (() => { throw new ApplicationException ("1"); }); + cts.Token.Register (() => { throw new ApplicationException ("2"); }); + cts.Token.Register (() => { throw new ApplicationException ("3"); }); + + try { + cts.Cancel (); + } catch (AggregateException e) { + Assert.AreEqual (3, e.InnerExceptions.Count, "#2"); + Assert.AreEqual ("3", e.InnerExceptions[0].Message, "#3"); + Assert.AreEqual ("2", e.InnerExceptions[1].Message, "#4"); + Assert.AreEqual ("1", e.InnerExceptions[2].Message, "#5"); + } + } + + [Test] public void Cancel_MultipleException_Recursive () { CancellationTokenSource cts = new CancellationTokenSource (); @@ -375,10 +408,9 @@ namespace MonoTests.System.Threading var source = new CancellationTokenSource (); var token = source.Token; - var reg = new CancellationTokenRegistration (); Console.WriteLine ("Test1"); + var reg = token.Register (() => unregister = true); token.Register (() => reg.Dispose ()); - reg = token.Register (() => unregister = true); token.Register (() => { Console.WriteLine ("Gnyah"); token.Register (() => register = true); }); source.Cancel (); diff --git a/mcs/class/corlib/Test/System.Threading/ExecutionContextTest.cs b/mcs/class/corlib/Test/System.Threading/ExecutionContextTest.cs index 9e79512002..2fa3d91a04 100644 --- a/mcs/class/corlib/Test/System.Threading/ExecutionContextTest.cs +++ b/mcs/class/corlib/Test/System.Threading/ExecutionContextTest.cs @@ -67,6 +67,66 @@ namespace MonoTests.System.Threading { { if (ExecutionContext.IsFlowSuppressed ()) ExecutionContext.RestoreFlow (); + + CallContext.FreeNamedDataSlot ("testlc"); + } + + [Test] + [Category("MobileNotWorking")] + public void LogicalGetData_SetData() + { + var value = "a"; + + CallContext.SetData ("testlc", value); + var capturedValue = CallContext.LogicalGetData ("testlc"); + + Assert.IsNull (capturedValue); + } + + [Test] + [Category("MobileNotWorking")] + public void LogicalGetData_SetDataLogicalThreadAffinative() + { + var value = new CallContextValue ("a"); + + CallContext.SetData ("testlc", value); + var capturedValue = CallContext.LogicalGetData ("testlc"); + + Assert.AreEqual (value, capturedValue); + } + + [Test] + [Category("MobileNotWorking")] + public void GetData_SetLogicalData() + { + var value = "a"; + + CallContext.LogicalSetData ("testlc", value); + var capturedValue = CallContext.GetData ("testlc"); + + Assert.AreEqual (value, capturedValue); + } + + [Test] + [Category("MobileNotWorking")] + public void CaptureLogicalCallContext() + { + var value = "Tester"; + object capturedValue = null; + + CallContext.LogicalSetData ("testlc", value); + + ExecutionContext ec = ExecutionContext.Capture (); + Assert.IsNotNull (ec, "Capture"); + Assert.AreEqual (value, CallContext.LogicalGetData ("testlc")); + CallContext.LogicalSetData ("testlc", null); + + ExecutionContext.Run (ec, new ContextCallback (new Action<object> ((data) => { + capturedValue = CallContext.LogicalGetData ("testlc"); + })), null); + + Assert.AreEqual (value, capturedValue); + Assert.AreNotEqual (value, CallContext.LogicalGetData ("testlc")); } [Test] @@ -92,6 +152,7 @@ namespace MonoTests.System.Threading { } [Test] + [Category("MobileNotWorking")] public void Capture () { ExecutionContext ec = ExecutionContext.Capture (); @@ -109,6 +170,7 @@ namespace MonoTests.System.Threading { } [Test] + [Category("MobileNotWorking")] public void Copy () { ExecutionContext ec = ExecutionContext.Capture (); @@ -138,6 +200,7 @@ namespace MonoTests.System.Threading { } [Test] + [Category("MobileNotWorking")] public void IsFlowSuppressed () { Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1"); @@ -151,12 +214,14 @@ namespace MonoTests.System.Threading { [Test] [ExpectedException (typeof (InvalidOperationException))] + [Category("MobileNotWorking")] public void RestoreFlow_None () { ExecutionContext.RestoreFlow (); } [Test] + [Category("MobileNotWorking")] public void RestoreFlow_SuppressFlow () { Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1"); @@ -177,6 +242,7 @@ namespace MonoTests.System.Threading { [Test] [ExpectedException (typeof (InvalidOperationException))] + [Category("MobileNotWorking")] public void Run_SuppressFlow () { Assert.IsFalse (ExecutionContext.IsFlowSuppressed ()); @@ -191,6 +257,7 @@ namespace MonoTests.System.Threading { } [Test] + [Category("MobileNotWorking")] public void SuppressFlow () { Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1"); @@ -204,6 +271,7 @@ namespace MonoTests.System.Threading { [Test] [ExpectedException (typeof (InvalidOperationException))] + [Category("MobileNotWorking")] public void SuppressFlow_Two_Undo () { Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1"); diff --git a/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs b/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs index 951e41ee1a..88803e5c2d 100644 --- a/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs +++ b/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs @@ -49,6 +49,37 @@ namespace MonoTests.System.Threading Assert.Fail ("#2"); } catch (ArgumentNullException) { } - } + } + + [Test] + public void UnsafeQueueUserWorkItem_InvalidArguments () + { + try { + ThreadPool.UnsafeQueueUserWorkItem (null, 1); + Assert.Fail ("#1"); + } catch (ArgumentNullException) { + } + } + +#if NET_4_0 + event WaitCallback e; + + [Test] + public void UnsafeQueueUserWorkItem_MulticastDelegate () + { + CountdownEvent ev = new CountdownEvent (2); + + e += delegate { + ev.Signal (); + }; + + e += delegate { + ev.Signal (); + }; + + ThreadPool.UnsafeQueueUserWorkItem (e, null); + Assert.IsTrue (ev.Wait (3000)); + } +#endif } }
\ No newline at end of file diff --git a/mcs/class/corlib/Test/System.Threading/ThreadTest.cs b/mcs/class/corlib/Test/System.Threading/ThreadTest.cs index 7d483e6703..ca5489ef0d 100644 --- a/mcs/class/corlib/Test/System.Threading/ThreadTest.cs +++ b/mcs/class/corlib/Test/System.Threading/ThreadTest.cs @@ -837,6 +837,13 @@ namespace MonoTests.System.Threading } } + [Test] + public void GetNamedDataSlotTest () + { + Assert.IsNotNull (Thread.GetNamedDataSlot ("te#st"), "#1"); + Assert.AreSame (Thread.GetNamedDataSlot ("te#st"), Thread.GetNamedDataSlot ("te#st"), "#2"); + } + void CheckIsRunning (string s, Thread t) { int c = counter; diff --git a/mcs/class/corlib/Test/System.Threading/TimerTest.cs b/mcs/class/corlib/Test/System.Threading/TimerTest.cs index 2c05538c72..ee60eb53aa 100644 --- a/mcs/class/corlib/Test/System.Threading/TimerTest.cs +++ b/mcs/class/corlib/Test/System.Threading/TimerTest.cs @@ -60,11 +60,11 @@ namespace MonoTests.System.Threading { Timer t = new Timer (new TimerCallback (Callback), bucket, 10, 10); Thread.Sleep (500); int c = bucket.count; - Assert.IsTrue(c > 20, "#1"); + Assert.IsTrue (c > 20, "#1 " + c.ToString ()); t.Change (100, 100); c = bucket.count; Thread.Sleep (500); - Assert.IsTrue(bucket.count <= c + 20, "#2"); + Assert.IsTrue (bucket.count <= c + 20, "#2 " + c.ToString ()); t.Dispose (); } @@ -193,8 +193,7 @@ namespace MonoTests.System.Threading { Thread.Sleep(100); t.Change (int.MaxValue, Timeout.Infinite); // since period is 0 the callback should happen once (bug #340212) - Assert.IsTrue(b.count == 1); - + Assert.AreEqual (1, b.count, "only once"); } [Test] diff --git a/mcs/class/corlib/Test/System/AggregateExceptionTests.cs b/mcs/class/corlib/Test/System/AggregateExceptionTests.cs index bc91e12686..d133a82cd8 100644 --- a/mcs/class/corlib/Test/System/AggregateExceptionTests.cs +++ b/mcs/class/corlib/Test/System/AggregateExceptionTests.cs @@ -108,6 +108,17 @@ namespace MonoTests.System } } + [Test] + public void GetBaseWithInner () + { + var ae = new AggregateException ("x", new [] { new ArgumentException (), new ArgumentNullException () }); + Assert.AreEqual (ae, ae.GetBaseException (), "#1"); + + var expected = new ArgumentException (); + var ae2 = new AggregateException ("x", new AggregateException (expected, new Exception ())); + Assert.AreEqual (expected, ae2.GetBaseException ().InnerException, "#2"); + } + static void Throws (Type t, Action action) { Exception e = null; diff --git a/mcs/class/corlib/Test/System/AppDomainTest.cs b/mcs/class/corlib/Test/System/AppDomainTest.cs index 1d88666538..8772d7afde 100644 --- a/mcs/class/corlib/Test/System/AppDomainTest.cs +++ b/mcs/class/corlib/Test/System/AppDomainTest.cs @@ -2073,7 +2073,6 @@ namespace MonoTests.System AppDomain.CurrentDomain.ExecuteAssembly ( assembly.Location); Assert.Fail ("#1"); -#if NET_2_0 } catch (MissingMethodException ex) { // Entry point not found in assembly '...' Assert.AreEqual (typeof (MissingMethodException), ex.GetType (), "#2"); @@ -2081,15 +2080,6 @@ namespace MonoTests.System Assert.IsNotNull (ex.Message, "#4"); Assert.IsTrue (ex.Message.IndexOf (assembly.FullName) != -1, "#5"); } -#else - } catch (COMException ex) { - // Unspecified error - Assert.AreEqual (typeof (COMException), ex.GetType (), "#2"); - Assert.AreEqual (-2147467259, ex.ErrorCode, "#3"); - Assert.IsNull (ex.InnerException, "#4"); - Assert.IsNotNull (ex.Message, "#5"); - } -#endif } [Test] // ExecuteAssembly (String, Evidence) @@ -2102,7 +2092,6 @@ namespace MonoTests.System assembly.Location, (Evidence) null); Assert.Fail ("#1"); -#if NET_2_0 } catch (MissingMethodException ex) { // Entry point not found in assembly '...' Assert.AreEqual (typeof (MissingMethodException), ex.GetType (), "#2"); @@ -2110,15 +2099,6 @@ namespace MonoTests.System Assert.IsNotNull (ex.Message, "#4"); Assert.IsTrue (ex.Message.IndexOf (assembly.FullName) != -1, "#5"); } -#else - } catch (COMException ex) { - // Unspecified error - Assert.AreEqual (typeof (COMException), ex.GetType (), "#2"); - Assert.AreEqual (-2147467259, ex.ErrorCode, "#3"); - Assert.IsNull (ex.InnerException, "#4"); - Assert.IsNotNull (ex.Message, "#5"); - } -#endif } [Test] // ExecuteAssembly (String, Evidence, String []) @@ -2132,7 +2112,6 @@ namespace MonoTests.System (Evidence) null, new string [0]); Assert.Fail ("#1"); -#if NET_2_0 } catch (MissingMethodException ex) { // Entry point not found in assembly '...' Assert.AreEqual (typeof (MissingMethodException), ex.GetType (), "#2"); @@ -2140,15 +2119,6 @@ namespace MonoTests.System Assert.IsNotNull (ex.Message, "#4"); Assert.IsTrue (ex.Message.IndexOf (assembly.FullName) != -1, "#5"); } -#else - } catch (COMException ex) { - // Unspecified error - Assert.AreEqual (typeof (COMException), ex.GetType (), "#2"); - Assert.AreEqual (-2147467259, ex.ErrorCode, "#3"); - Assert.IsNull (ex.InnerException, "#4"); - Assert.IsNotNull (ex.Message, "#5"); - } -#endif } [Test] // ExecuteAssembly (String, Evidence, String [], Byte [], AssemblyHashAlgorithm) @@ -2165,7 +2135,6 @@ namespace MonoTests.System (byte []) null, AssemblyHashAlgorithm.SHA1); Assert.Fail ("#1"); -#if NET_2_0 } catch (MissingMethodException ex) { // Entry point not found in assembly '...' Assert.AreEqual (typeof (MissingMethodException), ex.GetType (), "#2"); @@ -2173,15 +2142,6 @@ namespace MonoTests.System Assert.IsNotNull (ex.Message, "#4"); Assert.IsTrue (ex.Message.IndexOf (assembly.FullName) != -1, "#5"); } -#else - } catch (COMException ex) { - // Unspecified error - Assert.AreEqual (typeof (COMException), ex.GetType (), "#2"); - Assert.AreEqual (-2147467259, ex.ErrorCode, "#3"); - Assert.IsNull (ex.InnerException, "#4"); - Assert.IsNotNull (ex.Message, "#5"); - } -#endif } [Test] // bug #79720 @@ -3044,14 +3004,9 @@ namespace MonoTests.System try { AppDomain.CurrentDomain.Load (aname); Assert.Fail ("#C9"); -#if NET_2_0 } catch (SecurityException) { // Invalid assembly public key } -#else - } catch (FileLoadException) { - } -#endif aname = new AssemblyName (); aname.Name = "bug79522C"; @@ -3212,6 +3167,30 @@ namespace MonoTests.System // we have no public way to get the default appdomain } + static bool resolve_called; + + [Test] + public void AssemblyResolveParseError () + { + AppDomain currentDomain = AppDomain.CurrentDomain; + ResolveEventHandler d = ParseErrorResolve; + currentDomain.AssemblyResolve += d; + try { + resolve_called = false; + var a = Assembly.Load ("MyDynamicType, 1.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"); + Assert.Fail (); + } catch (FileNotFoundException) { + Assert.IsTrue (resolve_called); + } + currentDomain.AssemblyResolve -= d; + } + + static Assembly ParseErrorResolve (object sender, ResolveEventArgs args) + { + resolve_called = true; + return null; + } + [Test] public void ReflectionOnlyGetAssemblies () { @@ -3329,6 +3308,14 @@ namespace MonoTests.System TestSerialization (tester, typeof (StuffToPick<int>).GetMethod ("GenericMethod").MakeGenericMethod (typeof (int))); } + [Test] + public void ShadowCopyTypeGetTypeMissingAssemblyTest () + { + ad = CreateShadowCopyAppDomain (tempDir, true); + CrossDomainTester tester = CreateCrossDomainTester (ad); + tester.AssertLoadMissingAssemblyType (); + } + private static AppDomain CreateTestDomain (string baseDirectory, bool assemblyResolver) { AppDomainSetup setup = new AppDomainSetup (); @@ -3337,6 +3324,15 @@ namespace MonoTests.System return CreateTestDomain (setup, assemblyResolver); } + private static AppDomain CreateShadowCopyAppDomain (string baseDirectory, bool assemblyResolver) + { + AppDomainSetup setup = new AppDomainSetup (); + setup.ApplicationBase = baseDirectory; + setup.ApplicationName = "testdomain"; + setup.ShadowCopyFiles = "true"; + return CreateTestDomain (setup, assemblyResolver); + } + private static AppDomain CreateTestDomain (AppDomainSetup setup, bool assemblyResolver) { AppDomain ad = AppDomain.CreateDomain ("testdomain", @@ -3444,22 +3440,17 @@ namespace MonoTests.System } } - public bool AssertFileLoadException (AssemblyName assemblyRef) + public void AssertLoadMissingAssemblyType () { - try { - AppDomain.CurrentDomain.Load (assemblyRef); - return false; - } catch (FileLoadException) { - return true; - } + Assert.IsNull (Type.GetType ("A.B.C, MissingAssembly")); } - public bool AssertFileNotFoundException (AssemblyName assemblyRef) + public bool AssertFileLoadException (AssemblyName assemblyRef) { try { AppDomain.CurrentDomain.Load (assemblyRef); return false; - } catch (FileNotFoundException) { + } catch (FileLoadException) { return true; } } @@ -3629,4 +3620,4 @@ namespace MonoTests.System } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/corlib/Test/System/ArraySegmentTest.cs b/mcs/class/corlib/Test/System/ArraySegmentTest.cs index 6a4d8ae78f..28588f8e00 100644 --- a/mcs/class/corlib/Test/System/ArraySegmentTest.cs +++ b/mcs/class/corlib/Test/System/ArraySegmentTest.cs @@ -260,6 +260,24 @@ namespace MonoTests.System s[1] = -3; Assert.AreEqual (-3, s[1], "#2a"); } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void IList_IndexerErrorTest1 () + { + byte[] arr = new byte[4]; + IList<byte> seg = new ArraySegment<byte> (arr, 1, 2); + seg[-1] = 3; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void IList_IndexerErrorTest2 () + { + byte[] arr = new byte[4]; + IList<byte> seg = new ArraySegment<byte> (arr); + seg[4] = 3; + } #endif } } diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs index 4c74ee9d3d..ef41ce1794 100644 --- a/mcs/class/corlib/Test/System/ArrayTest.cs +++ b/mcs/class/corlib/Test/System/ArrayTest.cs @@ -1618,6 +1618,126 @@ public class ArrayTest } } + + [Test] + public void FindIndexTest () + { + var a = new int[] { 2, 2, 2, 3, 2 }; + Assert.AreEqual (2, Array.FindIndex (a, 2, 2, l => true)); + } + + [Test] + public void FindIndex_Invalid () + { + var array = new int [] { 1, 2, 3, 4, 5 }; + + try { + Array.FindIndex (array, null); + Assert.Fail ("#1"); + } catch (ArgumentNullException) { + } + + try { + Array.FindIndex (array, -1, l => true); + Assert.Fail ("#2"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindIndex (array, -1, 0, l => true); + Assert.Fail ("#2b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindIndex (array, 0, -1, l => true); + Assert.Fail ("#3"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindIndex (array, 100, l => true); + Assert.Fail ("#4"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindIndex (array, 100, 0, l => true); + Assert.Fail ("#4b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindIndex (array, 7, 2, l => true); + Assert.Fail ("#5"); + } catch (ArgumentOutOfRangeException) { + } + } + + [Test, ExpectedException (typeof (ArgumentNullException))] + public void FindLastNullTest () + { + var array = new int [] { 1, 2, 3, 4, 5 }; + Array.FindLast (array, null); + } + + [Test] + public void FindLastIndexTest () + { + var array = new int [] { 1, 2, 3, 4, 5 }; + + Assert.AreEqual (2, Array.FindLastIndex (array, 2, 3, l => true)); + Assert.AreEqual (2, Array.FindLastIndex (array, 2, 2, l => true)); + Assert.AreEqual (1, Array.FindLastIndex (array, 1, 2, l => true)); + } + + [Test] + public void FindLastIndex_Invalid () + { + var array = new int [] { 1, 2, 3, 4, 5 }; + try { + Array.FindLastIndex (array, null); + Assert.Fail ("#1"); + } catch (ArgumentNullException) { + } + + try { + Array.FindLastIndex (array, -1, l => true); + Assert.Fail ("#2"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindLastIndex (array, -1, 0, l => true); + Assert.Fail ("#2b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindLastIndex (array, 0, -1, l => true); + Assert.Fail ("#3"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindLastIndex (array, 100, l => true); + Assert.Fail ("#4"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindLastIndex (array, 100, 0, l => true); + Assert.Fail ("#4b"); + } catch (ArgumentOutOfRangeException) { + } + + try { + Array.FindLastIndex (array, 2, 4, l => true); + Assert.Fail ("#5"); + } catch (ArgumentOutOfRangeException) { + } + } + [Test] public void TestReverse() { { diff --git a/mcs/class/corlib/Test/System/AttributeTest.cs b/mcs/class/corlib/Test/System/AttributeTest.cs index f8fe8cd7a0..10fb4fcbce 100644 --- a/mcs/class/corlib/Test/System/AttributeTest.cs +++ b/mcs/class/corlib/Test/System/AttributeTest.cs @@ -88,6 +88,13 @@ namespace MonoTests.System class MyDerivedClassNoAttribute : MyClass { } + + internal class AttributeWithTypeId : Attribute + { + public override object TypeId { + get { return this; } + } + } } [TestFixture] @@ -998,6 +1005,14 @@ namespace MonoTests.System MyOwnCustomAttribute b1 = new MyOwnCustomAttribute (null); Assert.AreNotEqual (a1.GetHashCode (), b1.GetHashCode (), "non-identical-types"); } + + [Test] + public void GetHashCodeWithOverriddenTypeId () + { + //check for not throwing stack overflow exception + AttributeWithTypeId a = new AttributeWithTypeId (); + a.GetHashCode (); + } } namespace ParamNamespace { diff --git a/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs b/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs index df685fc0dd..3bc65a8204 100644 --- a/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs +++ b/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs @@ -163,7 +163,7 @@ namespace MonoTests.System { Assert.AreEqual (dto.ToString ("r", new CultureInfo ("en-us")), dto.ToString ("R", new CultureInfo ("en-us"))); Assert.AreEqual ("2007-10-31T21:00:00", dto.ToString ("s", new CultureInfo ("en-us"))); Assert.AreEqual ("2007-11-01 05:00:00Z", dto.ToString ("u", new CultureInfo ("en-us"))); - Assert.AreEqual ("October, 2007", dto.ToString ("Y", new CultureInfo ("en-us"))); + Assert.AreEqual ("October 2007", dto.ToString ("Y", new CultureInfo ("en-us"))); Assert.AreEqual (dto.ToString ("y", new CultureInfo ("en-us")), dto.ToString ("Y", new CultureInfo ("en-us"))); } diff --git a/mcs/class/corlib/Test/System/DateTimeTest.cs b/mcs/class/corlib/Test/System/DateTimeTest.cs index 72da88876a..30de11b489 100644 --- a/mcs/class/corlib/Test/System/DateTimeTest.cs +++ b/mcs/class/corlib/Test/System/DateTimeTest.cs @@ -2476,11 +2476,11 @@ namespace MonoTests.System } [Test] - public void Foo () + public void GenitiveMonth () { var ci = new CultureInfo ("ru-RU"); var dt = new DateTime (2012, 9, 15); - Assert.AreEqual ("сентября 15", dt.ToString ("m", ci)); + Assert.AreEqual ("15 сентября", dt.ToString ("m", ci)); } } } diff --git a/mcs/class/corlib/Test/System/EnumTest.cs b/mcs/class/corlib/Test/System/EnumTest.cs index f6c0dca2a5..973b068e82 100644 --- a/mcs/class/corlib/Test/System/EnumTest.cs +++ b/mcs/class/corlib/Test/System/EnumTest.cs @@ -849,9 +849,12 @@ namespace MonoTests.System } [Test] - public void ConvertToStringType () + public void IConvertible_Valid () { - Assert.AreEqual ("This", ((IConvertible) TestingEnum.This).ToType (typeof (string), null)); + IConvertible ic = TestingEnum.This; + Assert.AreEqual ("This", ic.ToType (typeof (string), null), "#1"); + Assert.AreEqual (TestingEnum.This, ic.ToType (typeof (TestingEnum), null), "#2"); + Assert.AreEqual (TestingEnum.This, ic.ToType (typeof (Enum), null), "#3"); } [Test] diff --git a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs b/mcs/class/corlib/Test/System/IntegerFormatterTest.cs index 8873f308cd..a09e98a1b4 100644 --- a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs +++ b/mcs/class/corlib/Test/System/IntegerFormatterTest.cs @@ -123,7 +123,10 @@ public class IntegerFormatterTest } - private static string tutti = "Int32\n" + + private static string tutti = tutti_1 + tutti_2; + + const string tutti_1 = + "Int32\n" + "(-2147483648) (C) (($2,147,483,648.00))\n" + "(-2147483648) (C0) (($2,147,483,648))\n" + "(-2147483648) (C1) (($2,147,483,648.0))\n" + @@ -852,7 +855,9 @@ public class IntegerFormatterTest "(9223372036854775807) (X8) (7FFFFFFFFFFFFFFF)\n" + "(9223372036854775807) (X9) (7FFFFFFFFFFFFFFF)\n" + "(9223372036854775807) (X10) (7FFFFFFFFFFFFFFF)\n" + -"(9223372036854775807) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFFFFFFFFFF)\n" + +"(9223372036854775807) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFFFFFFFFFF)\n"; + +const string tutti_2 = "(0) (C) ($0.00)\n" + "(0) (C0) ($0)\n" + "(0) (C1) ($0.0)\n" + @@ -2000,6 +2005,5 @@ public class IntegerFormatterTest "(100) (X10) (0000000064)\n" + "(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n"; } - } diff --git a/mcs/class/corlib/Test/System/RandomTest.cs b/mcs/class/corlib/Test/System/RandomTest.cs index a18524968f..5e49ac3866 100644 --- a/mcs/class/corlib/Test/System/RandomTest.cs +++ b/mcs/class/corlib/Test/System/RandomTest.cs @@ -3,9 +3,10 @@ // // Authors: // Bob Smith <bob@thestuff.net> -// Sebastien Pouliot <sebastien@ximian.com> +// Sebastien Pouliot <sebastien@xamarin.com> // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright 2013 Xamarin Inc. (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -29,44 +30,21 @@ using NUnit.Framework; using System; +using System.Reflection; namespace MonoTests.System { [TestFixture] public class RandomTest { -#if false - // - // This test will fail, given enough runs. - // - // It is an ad-hoc test for distribution, and does not work - // 100% of the time. - // - [Test] - public void NextDouble () - { - Random r = new Random (); - int i; - double c=0; - for (i=0; i<20; i++) - c += r.NextDouble (); - c/=i; - Assert.IsTrue (c.ToString () + " is out of range.", c < .7 && c > .3); - } - -#endif - [Test] public void CompareStreamWithSameSeed () { Random r = new Random (42); Random r2 = new Random (42); - double c=0, c2=0; for (int i=0; i<20; i++) { - c += r.NextDouble (); - c2 += r2.NextDouble (); + Assert.AreEqual (r.NextDouble (), r2.NextDouble (), i.ToString ()); } - Assert.AreEqual (c, c2, "Compare"); } [Test] @@ -80,6 +58,13 @@ namespace MonoTests.System { } [Test] + public void NextZero () + { + Random r = new Random (); + Assert.AreEqual (0, r.Next (0),"Next(0) failed"); + } + + [Test] public void NextMax() { Random r = new Random(); @@ -109,23 +94,124 @@ namespace MonoTests.System { } } -/* Mono implementation is now compatible with Knuth (not MS) implementation (choice of constants) + class RandomSampleOverride : Random { + + protected override double Sample () + { + throw new NotImplementedException (); + } + } + [Test] - public void CompareWithMS () + public void Base_Int () { - string[] r = new string [4]; - byte[] buffer = new byte [8]; - int x = 4; - while (x-- > 0) { - int seed = (x << x); - Random random = new Random (seed); - random.NextBytes (buffer); - r [x] = BitConverter.ToString (buffer); + var random = new RandomSampleOverride (); + // from 2.0+ Next(), Next(int,int) and NextBytes(byte[]) do not call Sample + // see MSDN's Notes to Inheritors + random.Next (); + random.Next (Int32.MinValue, Int32.MaxValue); + random.NextBytes (new byte[1]); + } + + [Test] + [ExpectedException (typeof (NotImplementedException))] + public void Base_Double () + { + var random = new RandomSampleOverride (); + random.NextDouble (); + } + + // generate values (one for each 1024 returned values) from the original C implementation + static uint[] jkiss_values = { + 560241513, /* 0 */ + 1281708802, /* 1024 */ + 1571324528, /* 2048 */ + 1565809406, /* 3072 */ + 1010890569, /* 4096 */ + 1778803435, /* 5120 */ + 903613637, /* 6144 */ + 3496059008, /* 7168 */ + 108603163, /* 8192 */ + 1854081276, /* 9216 */ + 3703232459, /* 10240 */ + 2191562138, /* 11264 */ + 337995793, /* 12288 */ + 1340840062, /* 13312 */ + 2364148985, /* 14336 */ + 2549812361, /* 15360 */ + 563432369, /* 16384 */ + 229365487, /* 17408 */ + 1821397325, /* 18432 */ + 3246092454, /* 19456 */ + 691032417, /* 20480 */ + 86951316, /* 21504 */ + 3029975455, /* 22528 */ + 1261370163, /* 23552 */ + 2539815382, /* 24576 */ + 3017891647, /* 25600 */ + 3877215120, /* 26624 */ + 3142958765, /* 27648 */ + 1080903191, /* 28672 */ + 2837464745, /* 29696 */ + 614275602, /* 30720 */ + 2250626199, /* 31744 */ + 729001311, /* 32768 */ + 3313769017, /* 33792 */ + 2408398670, /* 34816 */ + 3123583383, /* 35840 */ + 3346590423, /* 36864 */ + 1629546563, /* 37888 */ + 251343753, /* 38912 */ + 2695793631, /* 39936 */ + 2768993787, /* 40960 */ + 3688573224, /* 41984 */ + 2897218561, /* 43008 */ + 2725058810, /* 44032 */ + 2142061914, /* 45056 */ + 3983217096, /* 46080 */ + 3609758190, /* 47104 */ + 842060935, /* 48128 */ + 2893482035, /* 49152 */ + 2290461665, /* 50176 */ + 1709481476, /* 51200 */ + 3633857838, /* 52224 */ + 332645044, /* 53248 */ + 3522654497, /* 54272 */ + 2501348469, /* 55296 */ + 1644344287, /* 56320 */ + 3081428084, /* 57344 */ + 3114560766, /* 58368 */ + 489030597, /* 59392 */ + 367291591, /* 60416 */ + 106358682, /* 61440 */ + 3020781303, /* 62464 */ + 1209590375, /* 63488 */ + 1833282169, /* 64512 */ + 61543407, /* 65536 */ + }; + + [Test] + public void JKISS () + { + // Random.Next() returns a non-negative *signed* integer value - so it can't be used for testing + var next = typeof(Random).GetMethod ("JKiss", BindingFlags.Instance | BindingFlags.NonPublic); + + // if the method is not present, e.g. on MS.NET, skip this test + if (next == null) + return; + + // ensure we match the original JKISS random stream + // first 64KB but without checking every value (one each KB) + Random r = new Random (123456789); + int n = 0; + int j = 0; + while (j < 64 * 1024) { + uint random = (uint) next.Invoke (r, null); + if (j++ % 1024 == 0) { + Assert.AreEqual (random, jkiss_values [n], n.ToString ()); + n++; + } } - Assert.AreEqual ("43-DB-8B-AE-0A-88-A8-7B", r [3], "Seed(24)"); - Assert.AreEqual ("E7-2A-5C-44-D1-8C-7D-74", r [2], "Seed(8)"); - Assert.AreEqual ("C5-67-2A-FC-1B-4E-CD-72", r [1], "Seed(2)"); - Assert.AreEqual ("B9-D1-C4-8E-34-8F-E7-71", r [0], "Seed(0)"); - }*/ + } } -} +}
\ No newline at end of file diff --git a/mcs/class/corlib/Test/System/TimeZoneTest.cs b/mcs/class/corlib/Test/System/TimeZoneTest.cs index 4d675d51e6..4403fd6346 100644 --- a/mcs/class/corlib/Test/System/TimeZoneTest.cs +++ b/mcs/class/corlib/Test/System/TimeZoneTest.cs @@ -122,6 +122,32 @@ public class TimeZoneTest { Assert.AreEqual(0L, t1.GetUtcOffset (d5).Ticks, "D14"); } + private void NZST(TimeZone t1) { + Assert.AreEqual("NZST", t1.StandardName, "E01"); + Assert.AreEqual("NZDT", t1.DaylightName, "E02"); + + DaylightTime d1 = t1.GetDaylightChanges (2013); + Assert.AreEqual("09/29/2013 02:00:00", d1.Start.ToString ("G"), "E03"); + Assert.AreEqual("04/07/2013 03:00:00", d1.End.ToString ("G"), "E04"); + Assert.AreEqual(36000000000L, d1.Delta.Ticks, "E05"); + + DaylightTime d2 = t1.GetDaylightChanges (2001); + Assert.AreEqual("10/07/2001 02:00:00", d2.Start.ToString ("G"), "E06"); + Assert.AreEqual("03/18/2001 03:00:00", d2.End.ToString ("G"), "E07"); + Assert.AreEqual(36000000000L, d2.Delta.Ticks, "E08"); + + DateTime d3 = new DateTime(2013,02,15); + Assert.AreEqual(true, t1.IsDaylightSavingTime (d3), "E09"); + DateTime d4 = new DateTime(2013,04,30); + Assert.AreEqual(false, t1.IsDaylightSavingTime (d4), "E10"); + DateTime d5 = new DateTime(2013,11,03); + Assert.AreEqual(true, t1.IsDaylightSavingTime (d5), "E11"); + + Assert.AreEqual(36000000000L /*hour*/ * 13L, t1.GetUtcOffset (d3).Ticks, "E12"); + Assert.AreEqual(36000000000L /*hour*/ * 12L, t1.GetUtcOffset (d4).Ticks, "E13"); + Assert.AreEqual(36000000000L /*hour*/ * 13L, t1.GetUtcOffset (d5).Ticks, "E14"); + } + [Test] [Culture ("")] public void TestCtors () @@ -141,6 +167,9 @@ public class TimeZoneTest { case "GMT": GMT (t1); break; + case "NZST": + NZST (t1); + break; default: NUnit.Framework.Assert.Ignore ("Your time zone (" + t1.StandardName + ") isn't defined in the test case"); break; @@ -252,6 +281,45 @@ public class TimeZoneTest { } [Test] + public void GetUtcOffsetAtDSTBoundary () + { + /* + * Getting a definitive list of timezones which do or don't observe Daylight + * Savings is difficult (can't say America's or USA definitively) and lengthy see + * + * http://en.wikipedia.org/wiki/Daylight_saving_time_by_country + * + * as a good starting point for a list. + * + * The following are SOME of the timezones/regions which do support daylight savings. + * + * Pacific/Auckland + * Pacific/Sydney + * USA (EST, CST, MST, PST, AKST) note this does not cover all states or regions + * Europe/London (GMT) + * CET (member states of the European Union) + * + * This test should work in all the above timezones + */ + + + TimeZone tz = TimeZone.CurrentTimeZone; + DaylightTime daylightChanges = tz.GetDaylightChanges(2007); + DateTime dst_end = daylightChanges.End; + + if (dst_end == DateTime.MinValue) + Assert.Ignore (tz.StandardName + " did not observe daylight saving time during 2007."); + + var standardOffset = tz.GetUtcOffset(daylightChanges.Start.AddMinutes(-1)); + + Assert.AreEqual(standardOffset, tz.GetUtcOffset (dst_end)); + Assert.AreEqual(standardOffset, tz.GetUtcOffset (dst_end.Add (daylightChanges.Delta.Negate ().Add (TimeSpan.FromSeconds(1))))); + Assert.AreEqual(standardOffset, tz.GetUtcOffset (dst_end.Add(daylightChanges.Delta.Negate ()))); + Assert.AreNotEqual(standardOffset, tz.GetUtcOffset (dst_end.Add(daylightChanges.Delta.Negate ().Add (TimeSpan.FromSeconds(-1))))); + } + + + [Test] public void StaticProperties () { Assert.IsNotNull (TimeZoneInfo.Local, "Local"); diff --git a/mcs/class/corlib/Test/System/TupleTest.cs b/mcs/class/corlib/Test/System/TupleTest.cs new file mode 100644 index 0000000000..cf410e7855 --- /dev/null +++ b/mcs/class/corlib/Test/System/TupleTest.cs @@ -0,0 +1,63 @@ +// +// TupleTest.cs +// +// Authors: +// Marek Safar <marek.safar@gmail.com> +// +// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.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_4_0 + +using System; +using NUnit.Framework; + +namespace MonoTests.System +{ + [TestFixture] + public class TupleTest + { + [Test] + [ExpectedException (typeof (ArgumentException))] + public void TupleWithRest_Invalid () + { + new Tuple<int, int, int, int, int, int, int, int> (1, 2, 3, 4, 5, 6, 7, 8); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void TupleWithRest_InvalidDueToNull () + { + new Tuple<int, object, int, int, int, int, int, Tuple<string, string>> (1, null, 3, 4, 5, 6, 7, null); + } + + [Test] + public void ToStringTest () + { + var t1 = new Tuple<int, object, int, int, int, int, int, Tuple<string, string>> (1, null, 3, 4, 5, 6, 7, new Tuple<string, string> (null, null)); + + Assert.AreEqual ("(1, , 3, 4, 5, 6, 7, , )", t1.ToString (), "#1"); + } + } +} + +#endif
\ No newline at end of file diff --git a/mcs/class/corlib/Test/System/TypeTest.cs b/mcs/class/corlib/Test/System/TypeTest.cs index bc726ce38f..8972880062 100644 --- a/mcs/class/corlib/Test/System/TypeTest.cs +++ b/mcs/class/corlib/Test/System/TypeTest.cs @@ -4024,6 +4024,25 @@ PublicKeyToken=b77a5c561934e089")); } #endif + [Test] + public void GetTypeParseGenericCorrectly () { //Bug #15124 + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1"), typeof (Foo<>), "#1"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32]"), typeof (Foo<int>), "#2"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[[System.Int32]]"), typeof (Foo<int>), "#3"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32][]"), typeof (Foo<int>[]), "#4"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[][System.Int32]"), null, "#5"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32][,]"), typeof (Foo<int>[,]), "#6"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[]"), typeof (Foo<>).MakeArrayType(), "#7"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[,]"), typeof (Foo<>).MakeArrayType (2), "#8"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[][]"), typeof (Foo<>).MakeArrayType ().MakeArrayType (), "#9"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1["), null, "#10"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[["), null, "#11"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[[]"), null, "#12"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[,"), null, "#13"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[*"), null, "#14"); + Assert.AreEqual (Type.GetType ("MonoTests.System.Foo`1[System.Int32"), null, "#15"); + } + public abstract class Stream : IDisposable { public void Dispose () diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index f581c0d5e5..3bab3edb7f 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -925,6 +925,18 @@ System.Runtime.InteropServices.ComTypes/VARDESC.cs System.Runtime.InteropServices.ComTypes/VARFLAGS.cs System.Runtime.InteropServices.ComTypes/VARKIND.cs System.Runtime.InteropServices.Expando/IExpando.cs +System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs +System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs +System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs +System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs +System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs +System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs +System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs +System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs System.Runtime.Remoting/ActivatedClientTypeEntry.cs System.Runtime.Remoting/ActivatedServiceTypeEntry.cs System.Runtime.Remoting/CustomErrorsModes.cs diff --git a/mcs/class/corlib/corlib_test.dll.sources b/mcs/class/corlib/corlib_test.dll.sources index 51c354cc22..3308dd5899 100644 --- a/mcs/class/corlib/corlib_test.dll.sources +++ b/mcs/class/corlib/corlib_test.dll.sources @@ -25,6 +25,7 @@ System/ModuleHandleTest.cs System/ObsoleteAttributeTest.cs System/IntegerTryParse.cs System/LazyTest.cs +System/TupleTest.cs System.Collections/ArrayListTest.cs System.Collections/BitArrayTest.cs System.Collections/CaseInsensitiveComparerTest.cs @@ -56,6 +57,7 @@ System/DecimalFormatterTest.cs System/DecimalTest2.cs System/DecimalTest.cs System.Diagnostics/DebuggerDisplayAttributeTest.cs +System.Diagnostics/DebuggerTypeProxyAttribute.cs System.Diagnostics/StackFrameTest.cs System.Diagnostics/StackTraceTest.cs System.Diagnostics.Contracts/ContractAssertTest.cs @@ -79,6 +81,7 @@ System.Globalization/DateTimeFormatInfoTest.cs System.Globalization/DaylightTimeTest.cs System.Globalization/EastAsianLunisolarCalendarTest.cs System.Globalization/IdnMappingTest.cs +System.Globalization/NumberFormatInfoTest.cs System.Globalization/RegionInfoTest.cs System.Globalization/SortKeyTest.cs System.Globalization/StringInfoTest.cs diff --git a/mcs/class/dlr/Runtime/Microsoft.Dynamic/DebugOptions.cs b/mcs/class/dlr/Runtime/Microsoft.Dynamic/DebugOptions.cs new file mode 100644 index 0000000000..a3aac34473 --- /dev/null +++ b/mcs/class/dlr/Runtime/Microsoft.Dynamic/DebugOptions.cs @@ -0,0 +1,76 @@ +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System.Security; +using System; + +namespace Microsoft.Scripting { + + /// <summary> + /// This class holds onto internal debugging options used in this assembly. + /// These options can be set via environment variables DLR_{option-name}. + /// Boolean options map "true" to true and other values to false. + /// + /// These options are for internal debugging only, and should not be + /// exposed through any public APIs. + /// </summary> + internal static class DebugOptions { + + private static bool ReadOption(string name) { +#if SILVERLIGHT + return false; +#else + string envVar = ReadString(name); + return envVar != null && envVar.ToLowerInvariant() == "true"; +#endif + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "name")] + private static bool ReadDebugOption(string name) { +#if DEBUG + return ReadOption(name); +#else + return false; +#endif + } + + private static string ReadString(string name) { +#if FEATURE_PROCESS + try { + return Environment.GetEnvironmentVariable("DLR_" + name); + } catch (SecurityException) { + return null; + } +#else + return null; +#endif + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "name")] + private static string ReadDebugString(string name) { +#if DEBUG + return ReadString(name); +#else + return null; +#endif + } + + private readonly static bool _trackPerformance = ReadDebugOption("TrackPerformance"); + + internal static bool TrackPerformance { + get { return _trackPerformance; } + } + } +}
\ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Dynamic/MultiRuntimeAwareAttribute.cs b/mcs/class/dlr/Runtime/Microsoft.Dynamic/MultiRuntimeAwareAttribute.cs new file mode 100644 index 0000000000..3b0cc25069 --- /dev/null +++ b/mcs/class/dlr/Runtime/Microsoft.Dynamic/MultiRuntimeAwareAttribute.cs @@ -0,0 +1,34 @@ +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System; +using System.Diagnostics; + +namespace Microsoft.Scripting { + /// <summary> + /// marks a field, class, or struct as being safe to have statics which can be accessed + /// from multiple runtimes. + /// + /// Static fields which are not read-only or marked with this attribute will be flagged + /// by a test which looks for state being shared between runtimes. Before applying this + /// attribute you should ensure that it is safe to share the state. This is typically + /// state which is lazy initialized or state which is caching values which are identical + /// in all runtimes and are immutable. + /// </summary> + [Conditional("DEBUG")] + [AttributeUsage(AttributeTargets.Field)] + public sealed class MultiRuntimeAwareAttribute : Attribute { + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Dynamic/PerfTrack.cs b/mcs/class/dlr/Runtime/Microsoft.Dynamic/PerfTrack.cs new file mode 100644 index 0000000000..622e41d092 --- /dev/null +++ b/mcs/class/dlr/Runtime/Microsoft.Dynamic/PerfTrack.cs @@ -0,0 +1,185 @@ +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +#if FEATURE_CORE_DLR +using System.Linq.Expressions; +#else +using Microsoft.Scripting.Ast; +#endif + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Microsoft.Scripting.Utils; +using System.Dynamic; +using System.IO; + +namespace Microsoft.Scripting { + /// <summary> + /// This class is useful for quickly collecting performance counts for expensive + /// operations. Usually this means operations involving either reflection or + /// code gen. Long-term we need to see if this can be plugged better into the + /// standard performance counter architecture. + /// </summary> + public static class PerfTrack { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1717:OnlyFlagsEnumsShouldHavePluralNames")] // TODO: fix + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] // TODO: fix + public enum Categories { + /// <summary> + /// temporary categories for quick investigation, use a custom key if you + /// need to track multiple items, and if you want to keep it then create + /// a new Categories entry and rename all your temporary entries. + /// </summary> + Temporary, + ReflectedTypes, + Exceptions, // exceptions thrown + Properties, // properties got or set + Fields, // fields got or set + Methods, // methods called through MethodBase.Invoke()... + Compiler, // Methods compiled via the ReflectOptimizer + DelegateCreate, // we've created a new method for delegates + DictInvoke, // Dictionary accesses + OperatorInvoke, // Invoking an operator against a type + OverAllocate, // a spot where we have an un-ideal algorithm that needs to allocate more than necessary + Rules, // related to rules / actions. + RuleEvaluation, // a rule was evaluated + Binding, // a rule was bound + BindingSlow, + BindingFast, + BindingTarget, // a rule was bound against a target of a specific type + Count + } + + [MultiRuntimeAware] + private static int totalEvents; + private static readonly Dictionary<Categories, Dictionary<string, int>> _events = MakeEventsDictionary(); + private static readonly Dictionary<Categories, int> summaryStats = new Dictionary<Categories, int>(); + + private static Dictionary<Categories, Dictionary<string, int>> MakeEventsDictionary() { + Dictionary<Categories, Dictionary<string, int>> result = new Dictionary<Categories, Dictionary<string, int>>(); + + // We do not use Enum.GetValues here since it is not available in SILVERLIGHT + for (int i = 0; i <= (int)Categories.Count; i++) { + result[(Categories)i] = new Dictionary<string, int>(); + } + + return result; + } + +#if FEATURE_BASIC_CONSOLE + public static void DumpHistogram<TKey>(IDictionary<TKey, int> histogram) { + DumpHistogram(histogram, Console.Out); + } + + public static void DumpStats() { + DumpStats(Console.Out); + } +#endif + + public static void DumpHistogram<TKey>(IDictionary<TKey, int> histogram, TextWriter output) { + var keys = ArrayUtils.MakeArray(histogram.Keys); + var values = ArrayUtils.MakeArray(histogram.Values); + +#if !WIN8 // TODO: + Array.Sort(values, keys); +#endif + for (int i = 0; i < keys.Length; i++) { + output.WriteLine("{0} {1}", keys[i], values[i]); + } + } + + public static void AddHistograms<TKey>(IDictionary<TKey, int> result, IDictionary<TKey, int> addend) { + foreach (var entry in addend) { + int value; + result[entry.Key] = entry.Value + (result.TryGetValue(entry.Key, out value) ? value : 0); + } + } + + public static void IncrementEntry<TKey>(IDictionary<TKey, int> histogram, TKey key) { + int value; + histogram.TryGetValue(key, out value); + histogram[key] = value + 1; + } + + public static void DumpStats(TextWriter output) { + if (totalEvents == 0) return; + + // numbers from AMD Opteron 244 1.8 Ghz, 2.00GB of ram, + // running on IronPython 1.0 Beta 4 against Whidbey RTM. + const double CALL_TIME = 0.0000051442355; + const double THROW_TIME = 0.000025365656; + const double FIELD_TIME = 0.0000018080093; + + output.WriteLine(); + output.WriteLine("---- Performance Details ----"); + output.WriteLine(); + + foreach (KeyValuePair<Categories, Dictionary<string, int>> kvpCategories in _events) { + if (kvpCategories.Value.Count > 0) { + output.WriteLine("Category : " + kvpCategories.Key); + DumpHistogram(kvpCategories.Value, output); + output.WriteLine(); + } + } + + output.WriteLine(); + output.WriteLine("---- Performance Summary ----"); + output.WriteLine(); + double knownTimes = 0; + foreach (KeyValuePair<Categories, int> kvp in summaryStats) { + switch (kvp.Key) { + case Categories.Exceptions: + output.WriteLine("Total Exception ({0}) = {1} (throwtime = ~{2} secs)", kvp.Key, kvp.Value, kvp.Value * THROW_TIME); + knownTimes += kvp.Value * THROW_TIME; + break; + case Categories.Fields: + output.WriteLine("Total field = {0} (time = ~{1} secs)", kvp.Value, kvp.Value * FIELD_TIME); + knownTimes += kvp.Value * FIELD_TIME; + break; + case Categories.Methods: + output.WriteLine("Total calls = {0} (calltime = ~{1} secs)", kvp.Value, kvp.Value * CALL_TIME); + knownTimes += kvp.Value * CALL_TIME; + break; + //case Categories.Properties: + default: + output.WriteLine("Total {1} = {0}", kvp.Value, kvp.Key); + break; + } + } + + output.WriteLine(); + output.WriteLine("Total Known Times: {0}", knownTimes); + } + + [Conditional("DEBUG")] + public static void NoteEvent(Categories category, object key) { + if (!DebugOptions.TrackPerformance) return; + + Dictionary<string, int> categoryEvents = _events[category]; + totalEvents++; + lock (categoryEvents) { + string name = key.ToString(); + Exception ex = key as Exception; + if (ex != null) name = ex.GetType().ToString(); + int v; + if (!categoryEvents.TryGetValue(name, out v)) categoryEvents[name] = 1; + else categoryEvents[name] = v + 1; + + if (!summaryStats.TryGetValue(category, out v)) summaryStats[category] = 1; + else summaryStats[category] = v + 1; + } + } + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs index 5667f88973..4d1c235673 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs @@ -19,7 +19,9 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; +#if FEATURE_REFEMIT using System.Reflection.Emit; +#endif using System.Threading; using System.Runtime.CompilerServices; @@ -61,9 +63,9 @@ namespace System.Linq.Expressions { _delegateType = delegateType; _tailCall = tailCall; } - +#if FEATURE_REFEMIT internal abstract LambdaExpression Accept(StackSpiller spiller); - +#endif /// <summary> /// Gets the static type of the expression that this <see cref="Expression" /> represents. (Inherited from <see cref="Expression"/>.) /// </summary> @@ -217,11 +219,11 @@ namespace System.Linq.Expressions { protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitLambda(this); } - +#if FEATURE_REFEMIT internal override LambdaExpression Accept(StackSpiller spiller) { return spiller.Rewrite(this); } - +#endif internal static LambdaExpression Create(Expression body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters) { return new Expression<TDelegate>(body, name, tailCall, parameters); } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs index 408ae7d99a..9a60fa4428 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs @@ -20,7 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +//using Microsoft.Scripting.Utils; #if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { @@ -207,7 +207,7 @@ namespace System.Linq.Expressions { } ConstructorInfo ci = null; if (!type.IsValueType) { - ci = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, ReflectionUtils.EmptyTypes, null); + ci = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Microsoft.Scripting.Utils.ReflectionUtils.EmptyTypes, null); if (ci == null) { throw Error.TypeMissingDefaultConstructor(type); } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs index 95dea78f1f..329928fd80 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs @@ -24,7 +24,9 @@ using System.Linq.Expressions.Compiler; using System; using System.Collections.Generic; using System.Text; +#if FEATURE_REFEMIT using System.Reflection.Emit; +#endif using System.Diagnostics; using System.Diagnostics.SymbolStore; using System.Reflection; @@ -55,6 +57,7 @@ namespace System.Runtime.CompilerServices { /// <param name="sequencePoint">Debug informaton corresponding to the sequence point.</param> public abstract void MarkSequencePoint(LambdaExpression method, int ilOffset, DebugInfoExpression sequencePoint); +#if FEATURE_REFEMIT internal virtual void MarkSequencePoint(LambdaExpression method, MethodBase methodBase, ILGenerator ilg, DebugInfoExpression sequencePoint) { MarkSequencePoint(method, ilg.ILOffset, sequencePoint); } @@ -62,5 +65,6 @@ namespace System.Runtime.CompilerServices { internal virtual void SetLocalName(LocalBuilder localBuilder, string name) { // nop } +#endif } } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs index d16f40e435..a2e5ca0a4c 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs @@ -16,7 +16,9 @@ using System; using System.Dynamic.Utils; using System.Reflection; +#if FEATURE_REFEMIT using System.Reflection.Emit; +#endif #if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs index 78d5226492..5b219237f6 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs @@ -15,7 +15,9 @@ using System.Diagnostics; using System.Reflection; +#if FEATURE_REFEMIT using System.Reflection.Emit; +#endif using System.Text; namespace System.Dynamic.Utils { @@ -28,13 +30,12 @@ namespace System.Dynamic.Utils { /// </summary> internal static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType, object target) { Debug.Assert(methodInfo != null && delegateType != null); - +#if FEATURE_REFEMIT var dm = methodInfo as DynamicMethod; - if (dm != null) { + if (dm != null) return dm.CreateDelegate(delegateType, target); - } else { - return Delegate.CreateDelegate(delegateType, target, methodInfo); - } +#endif + return Delegate.CreateDelegate(delegateType, target, methodInfo); } internal static Type GetReturnType(this MethodBase mi) { diff --git a/mcs/class/lib/monolite/Mono.Security.dll b/mcs/class/lib/monolite/Mono.Security.dll Binary files differindex 7ae537c199..3e5144327f 100755 --- a/mcs/class/lib/monolite/Mono.Security.dll +++ b/mcs/class/lib/monolite/Mono.Security.dll diff --git a/mcs/class/lib/monolite/System.Core.dll b/mcs/class/lib/monolite/System.Core.dll Binary files differindex 0bb1ee35d4..de9732e917 100755 --- a/mcs/class/lib/monolite/System.Core.dll +++ b/mcs/class/lib/monolite/System.Core.dll diff --git a/mcs/class/lib/monolite/System.Xml.dll b/mcs/class/lib/monolite/System.Xml.dll Binary files differindex e63c986cf6..e2120fdeef 100755 --- a/mcs/class/lib/monolite/System.Xml.dll +++ b/mcs/class/lib/monolite/System.Xml.dll diff --git a/mcs/class/lib/monolite/System.dll b/mcs/class/lib/monolite/System.dll Binary files differindex 96ba1ef068..16c5775e9b 100755 --- a/mcs/class/lib/monolite/System.dll +++ b/mcs/class/lib/monolite/System.dll diff --git a/mcs/class/lib/monolite/basic.exe b/mcs/class/lib/monolite/basic.exe Binary files differindex 6e7cf1f5e5..7ceeae95e9 100755 --- a/mcs/class/lib/monolite/basic.exe +++ b/mcs/class/lib/monolite/basic.exe diff --git a/mcs/class/lib/monolite/mscorlib.dll b/mcs/class/lib/monolite/mscorlib.dll Binary files differindex 515c331973..5812f17231 100755 --- a/mcs/class/lib/monolite/mscorlib.dll +++ b/mcs/class/lib/monolite/mscorlib.dll diff --git a/mcs/class/monodoc/Monodoc/generators/html/Man2Html.cs b/mcs/class/monodoc/Monodoc/generators/html/Man2Html.cs index d4f9cc2665..a065daf212 100644 --- a/mcs/class/monodoc/Monodoc/generators/html/Man2Html.cs +++ b/mcs/class/monodoc/Monodoc/generators/html/Man2Html.cs @@ -240,7 +240,7 @@ namespace Monodoc.Generators.Html static void ClearUntil (StateInfo s, string required) { - string e; + string e = null; while (s.tags.Count > 0 && (e = s.tags.Peek ().ToString ()) != required) { s.output.Append (s.tags.Pop ().ToString ()); diff --git a/mcs/class/monodoc/Monodoc/providers/EcmaDoc.cs b/mcs/class/monodoc/Monodoc/providers/EcmaDoc.cs index 360889f6a7..efdeedf63a 100644 --- a/mcs/class/monodoc/Monodoc/providers/EcmaDoc.cs +++ b/mcs/class/monodoc/Monodoc/providers/EcmaDoc.cs @@ -54,7 +54,17 @@ namespace Monodoc.Providers nsSummaries[nsName] = nsElements = new XElement ("elements", new XElement ("summary"), new XElement ("remarks")); - + //Add namespace summary and remarks data from file, if available + var nsFileName = Path.Combine(asm, String.Format("ns-{0}.xml", nsName)); + if(File.Exists(nsFileName)){ + var nsEl = XElement.Load (nsFileName); + + nsElements.Element ("summary").ReplaceWith (nsEl.Descendants ("summary").First ()); + nsElements.Element ("remarks").ReplaceWith (nsEl.Descendants ("remarks").First ()); + }else{ + Console.WriteLine ("Error reading namespace XML for " + nsName); + } + foreach (var type in ns.Elements ("Type")) { // Add the XML file corresponding to the type to our storage var id = indexGenerator (type); @@ -541,10 +551,11 @@ namespace Monodoc.Providers break; // binary operators: overloading is possible [ECMA-335 §10.3.2] default: - memberSignature = - nicename + "(" - + string.Join (",", member.Element ("Parameters").Elements ("Parameter").Select (p => (string)p.Attribute ("Type"))) - + ")"; + if (member.Element ("Parameters") != null) + memberSignature = + nicename + "(" + + string.Join (",", member.Element ("Parameters").Elements ("Parameter").Select (p => (string)p.Attribute ("Type"))) + + ")"; break; } diff --git a/mcs/class/monodoc/Resources/ecmaspec.css b/mcs/class/monodoc/Resources/ecmaspec.css index 341f439b96..97937fc442 100644 --- a/mcs/class/monodoc/Resources/ecmaspec.css +++ b/mcs/class/monodoc/Resources/ecmaspec.css @@ -10,7 +10,6 @@ } p { - text-align: justify; margin-top: .5em; margin-bottom: .5em; } |