Parcourir la source

Initial drop for System.Web.Extensions assembly

svn path=/trunk/mcs/; revision=78067
Igor Zelmanovich il y a 18 ans
Parent
commit
d9bebe1968

+ 67 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/Converter.cs

@@ -0,0 +1,67 @@
+//
+// Converter.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public class Converter : ConfigurationElement
+	{
+		[StringValidator (MinLength = 1)]
+		[ConfigurationProperty ("name", IsRequired = true, IsKey = true, DefaultValue = "")]
+		public string Name {
+			get {
+				return (string) this ["name"];
+			}
+			set {
+				this ["name"] = value;
+			}
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[StringValidator (MinLength = 1)]
+		[ConfigurationProperty ("type", IsRequired = true, DefaultValue = "")]
+		public string Type {
+			get {
+				return (string) this ["type"];
+			}
+			set {
+				this ["type"] = value;
+			}
+		}
+	}
+}

+ 80 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ConvertersCollection.cs

@@ -0,0 +1,80 @@
+//
+// ConvertersCollection.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	[ConfigurationCollection (typeof (Converter))]
+	public class ConvertersCollection : ConfigurationElementCollection
+	{
+		protected override ConfigurationPropertyCollection Properties {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		public Converter this [int index] {
+			get {
+				return (Converter) BaseGet (index);
+			}
+			set {
+				if (BaseGet (index) != null) {
+					BaseRemoveAt (index);
+				}
+				BaseAdd (index, value);
+			}
+		}
+
+		public void Add (Converter converter) {
+			BaseAdd (converter);
+		}
+
+		public void Clear () {
+			BaseClear ();
+		}
+
+		protected override ConfigurationElement CreateNewElement () {
+			return new Converter ();
+		}
+
+		protected override object GetElementKey (ConfigurationElement element) {
+			return ((Converter) element).Name;
+		}
+
+		public void Remove (Converter converter) {
+			if (BaseIndexOf (converter) >= 0)
+				BaseRemove (converter.Name);
+		}
+
+	}
+}

+ 65 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingAuthenticationServiceSection.cs

@@ -0,0 +1,65 @@
+//
+// ScriptingAuthenticationServiceSection.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class ScriptingAuthenticationServiceSection : ConfigurationSection
+	{
+		[ConfigurationPropertyAttribute ("enabled", DefaultValue = false)]
+		public bool Enabled {
+			get {
+				return (bool) this ["enabled"];
+			}
+			set {
+				this ["enabled"] = value;
+			}
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[ConfigurationPropertyAttribute ("requireSSL", DefaultValue = false)]
+		public bool RequireSSL {
+			get {
+				return (bool) this ["requireSSL"];
+			}
+			set {
+				this ["requireSSL"] = value;
+			}
+		}
+	}
+}

+ 72 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingJsonSerializationSection.cs

@@ -0,0 +1,72 @@
+//
+// ScriptingJsonSerializationSection.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class ScriptingJsonSerializationSection : ConfigurationSection
+	{
+		[ConfigurationPropertyAttribute ("converters", IsKey = true, DefaultValue = "")]
+		public ConvertersCollection Converters {
+			get {
+				return (ConvertersCollection) base ["converters"];
+			}
+		}
+
+		[ConfigurationPropertyAttribute ("maxJsonLength", DefaultValue = 102400)]
+		public int MaxJsonLength {
+			get {
+				return (int) this ["maxJsonLength"];
+			}
+			set {
+				this ["maxJsonLength"] = value;
+			}
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[ConfigurationPropertyAttribute ("recursionLimit", DefaultValue = 100)]
+		public int RecursionLimit {
+			get {
+				return (int) this ["recursionLimit"];
+			}
+			set {
+				this ["recursionLimit"] = value;
+			}
+		}
+	}
+}

+ 75 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingProfileServiceSection.cs

@@ -0,0 +1,75 @@
+//
+// ScriptingProfileServiceSection.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class ScriptingProfileServiceSection : ConfigurationSection
+	{
+		[ConfigurationPropertyAttribute ("enabled", DefaultValue = false)]
+		public bool Enabled {
+			get {
+				return (bool) this ["enabled"];
+			}
+			set {
+				this ["enabled"] = value;
+			}
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[ConfigurationPropertyAttribute ("readAccessProperties", DefaultValue = null)]
+		public string [] ReadAccessProperties {
+			get {
+				return (string []) this ["readAccessProperties"];
+			}
+			set {
+				this ["readAccessProperties"] = value;
+			}
+		}
+
+		[ConfigurationPropertyAttribute ("writeAccessProperites", DefaultValue = null)]
+		public string [] WriteAccessProperties {
+			get {
+				return (string []) this ["writeAccessProperites"];
+			}
+			set {
+				this ["writeAccessProperites"] = value;
+			}
+		}
+	}
+}

+ 66 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingScriptResourceHandlerSection.cs

@@ -0,0 +1,66 @@
+//
+// ScriptingScriptResourceHandlerSection.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class ScriptingScriptResourceHandlerSection : ConfigurationSection
+	{
+		[ConfigurationPropertyAttribute ("enableCaching", DefaultValue = true)]
+		public bool EnableCaching {
+			get {
+				return (bool) this ["enableCaching"];
+			}
+			set {
+				this ["enableCaching"] = value;
+			}
+		}
+
+		[ConfigurationPropertyAttribute ("enableCompression", DefaultValue = true)]
+		public bool EnableCompression {
+			get {
+				return (bool) this ["enableCompression"];
+			}
+			set {
+				this ["enableCompression"] = value;
+			}
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+	}
+}
+

+ 49 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingSectionGroup.cs

@@ -0,0 +1,49 @@
+//
+// ScriptingSectionGroup.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class ScriptingSectionGroup : ConfigurationSectionGroup
+	{
+		[ConfigurationProperty ("scriptResourceHandler")]
+		public ScriptingScriptResourceHandlerSection ScriptResourceHandler {
+			get { return (ScriptingScriptResourceHandlerSection) Sections ["scriptResourceHandler"]; }
+		}
+
+		[ConfigurationProperty ("webServices")]
+		public ScriptingWebServicesSectionGroup WebServices {
+			get { return (ScriptingWebServicesSectionGroup) SectionGroups ["webServices"]; }
+		}
+	}
+}

+ 55 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingWebServicesSectionGroup.cs

@@ -0,0 +1,55 @@
+//
+// ScriptingWebServicesSectionGroup.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class ScriptingWebServicesSectionGroup : ConfigurationSectionGroup
+	{
+		[ConfigurationProperty ("authenticationService")]
+		public ScriptingAuthenticationServiceSection AuthenticationService {
+			get { return (ScriptingAuthenticationServiceSection) Sections ["authenticationService"]; }
+		}
+
+		[ConfigurationProperty ("jsonSerialization")]
+		public ScriptingJsonSerializationSection JsonSerialization {
+			get { return (ScriptingJsonSerializationSection) Sections ["jsonSerialization"]; }
+		}
+
+		[ConfigurationProperty ("profileService")]
+		public ScriptingProfileServiceSection ProfileService {
+			get { return (ScriptingProfileServiceSection) Sections ["profileService"]; }
+		}
+
+	}
+}

+ 44 - 0
mcs/class/System.Web.Extensions/System.Web.Configuration/SystemWebExtensionsSectionGroup.cs

@@ -0,0 +1,44 @@
+//
+// SystemWebExtensionsSectionGroup.cs
+//
+// Author:
+//   Igor Zelmanovich <[email protected]>
+//
+// (C) 2007 Mainsoft, Inc.  http://www.mainsoft.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.Text;
+using System.Configuration;
+
+namespace System.Web.Configuration
+{
+	public sealed class SystemWebExtensionsSectionGroup : ConfigurationSectionGroup
+	{
+		[ConfigurationProperty ("scripting")]
+		public ScriptingSectionGroup Scripting {
+			get { return (ScriptingSectionGroup) SectionGroups ["scripting"]; }
+		}
+	}
+}