Browse Source

2005-02-17 Gonzalo Paniagua Javier <[email protected]>

	* System.Web.dll.sources: new files.

	* System.Web.UI/BoundPropertyEntry.cs:
	* System.Web.UI/PropertyEntry.cs:
	* System.Web.UI/TwoWayBoundPropertyEntry.cs: implemented.

	* System.Web.Compilation/ExpressionBuilderContext.cs:
	* System.Web.Compilation/ExpressionBuilder.cs: implemented.


svn path=/trunk/mcs/; revision=40815
Gonzalo Paniagua Javier 21 years ago
parent
commit
9124fd7440

+ 57 - 0
mcs/class/System.Web/System.Web.Compilation/ExpressionBuilder.cs

@@ -0,0 +1,57 @@
+//
+// System.Web.Compilation.ExpressionBuilder
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System.CodeDom;
+using System.Web.UI;
+
+namespace System.Web.Compilation
+{
+	public abstract class ExpressionBuilder {
+		protected ExpressionBuilder ()
+		{
+		}
+
+		public virtual bool SupportsEvaluate {
+			get { return false; }
+		}
+
+		public virtual object EvaluateExpression (object target, BoundPropertyEntry entry, object parsedData,
+								ExpressionBuilderContext context)
+		{
+			return null;
+		}
+
+		public abstract CodeExpression GetCodeExpression (BoundPropertyEntry entry, object parsedData,
+								ExpressionBuilderContext context);
+	}
+	
+}
+#endif // NET_2_0
+

+ 61 - 0
mcs/class/System.Web/System.Web.Compilation/ExpressionBuilderContext.cs

@@ -0,0 +1,61 @@
+//
+// System.Web.Compilation.ExpressionBuilderContext
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System.CodeDom;
+using System.Web.UI;
+
+namespace System.Web.Compilation
+{
+	public class ExpressionBuilderContext {
+		TemplateControl tcontrol;
+		string vpath;
+
+		public ExpressionBuilderContext (string virtualPath)
+		{
+			this.vpath = virtualPath;
+		}
+
+		public ExpressionBuilderContext (TemplateControl templateControl)
+		{
+			this.tcontrol = templateControl;
+		}
+
+		public TemplateControl TemplateControl {
+			get { return tcontrol; }
+		}
+
+		public string VirtualPath {
+			get { return vpath; }
+		}
+	}
+	
+}
+#endif // NET_2_0
+

+ 61 - 0
mcs/class/System.Web/System.Web.UI/BoundPropertyEntry.cs

@@ -0,0 +1,61 @@
+//
+// System.Web.UI.BoundPropertyEntry
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+namespace System.Web.UI
+{
+	public class BoundPropertyEntry : PropertyEntry {
+		string expression;
+		string expressionPrefix;
+		bool generated;
+		bool useSetAttribute;
+
+		public string Expression {
+			get { return expression; }
+			set { expression = value; }
+		}
+
+		public string ExpressionPrefix {
+			get { return expressionPrefix; }
+			set { expressionPrefix = value; }
+		}
+
+		public bool Generated {
+			get { return generated; }
+			set { generated = value; }
+		}
+
+		public bool UseSetAttribute {
+			get { return useSetAttribute; }
+			set { useSetAttribute = value; }
+		}
+	}
+}
+#endif // NET_2_0
+

+ 6 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,9 @@
+2005-02-17 Gonzalo Paniagua Javier <[email protected]>
+
+	* BoundPropertyEntry.cs:
+	* PropertyEntry.cs:
+	* TwoWayBoundPropertyEntry.cs: implemented.
+
 2005-02-10  Lluis Sanchez Gual <[email protected]>
 
 	* Page.cs: Added support for validation groups. Some fixes in

+ 69 - 0
mcs/class/System.Web/System.Web.UI/PropertyEntry.cs

@@ -0,0 +1,69 @@
+//
+// System.Web.UI.PropertyEntry
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Reflection;
+
+namespace System.Web.UI
+{
+	public abstract class PropertyEntry {
+		Type type;
+		string name;
+		string filter;
+		PropertyInfo pinfo;
+
+		public Type DeclaringType {
+			get { return pinfo.DeclaringType; }
+		}
+
+		public string Filter {
+			get { return filter; }
+			set { filter = value; }
+		}
+
+		public string Name {
+			get { return name; }
+			set { name = value; }
+		}
+
+		public PropertyInfo PropertyInfo {
+			get { return pinfo; }
+			set { pinfo = value; }
+		}
+
+		public Type Type {
+			get { return type; }
+			set { type = value; }
+		}
+	}
+	
+}
+#endif // NET_2_0
+

+ 61 - 0
mcs/class/System.Web/System.Web.UI/TwoWayBoundPropertyEntry.cs

@@ -0,0 +1,61 @@
+//
+// System.Web.UI.TwoWayBoundPropertyEntry
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+namespace System.Web.UI
+{
+	public class TwoWayBoundPropertyEntry : BoundPropertyEntry {
+		string controlID;
+		Type controlType;
+		string fieldName;
+		string formatString;
+
+		public string ControlID {
+			get { return controlID; }
+			set { controlID = value; }
+		}
+
+		public Type ControlType {
+			get { return controlType; }
+			set { controlType = value; }
+		}
+
+		public string FieldName {
+			get { return fieldName; }
+			set { fieldName = value; }
+		}
+
+		public string FormatString {
+			get { return formatString; }
+			set { formatString = value; }
+		}
+	}
+}
+#endif // NET_2_0
+

+ 7 - 0
mcs/class/System.Web/System.Web.dll.sources

@@ -20,6 +20,8 @@ System.Web.Compilation/BuildProviderResultFlags.cs
 System.Web.Compilation/CachingCompiler.cs
 System.Web.Compilation/CompilationException.cs
 System.Web.Compilation/Directive.cs
+System.Web.Compilation/ExpressionBuilder.cs
+System.Web.Compilation/ExpressionBuilderContext.cs
 System.Web.Compilation/GlobalAsaxCompiler.cs
 System.Web.Compilation/IImplicitResourceProvider.cs
 System.Web.Compilation/ILocation.cs
@@ -44,6 +46,7 @@ System.Web.Configuration/AuthenticationMode.cs
 System.Web.Configuration/AuthorizationConfig.cs
 System.Web.Configuration/AuthorizationConfigHandler.cs
 System.Web.Configuration/AuthorizationRuleAction.cs
+System.Web.Configuration/BuildProvider.cs
 System.Web.Configuration/BuildProviderAppliesTo.cs
 System.Web.Configuration/ClientTargetSectionHandler.cs
 System.Web.Configuration/CompilationConfiguration.cs
@@ -588,6 +591,7 @@ System.Web.UI/ApplicationFileParser.cs
 System.Web.UI/AttributeCollection.cs
 System.Web.UI/BaseParser.cs
 System.Web.UI/BasePartialCachingControl.cs
+System.Web.UI/BoundPropertyEntry.cs
 System.Web.UI/BuildMethod.cs
 System.Web.UI/BuildTemplateMethod.cs
 System.Web.UI/ClientScriptManager.cs
@@ -702,9 +706,11 @@ System.Web.UI/PersistenceMode.cs
 System.Web.UI/PersistenceModeAttribute.cs
 System.Web.UI/PostBackOptions.cs
 System.Web.UI/PropertyConverter.cs
+System.Web.UI/PropertyEntry.cs
 System.Web.UI/RenderMethod.cs
 System.Web.UI/RootBuilder.cs
 System.Web.UI/SimpleHandlerFactory.cs
+System.Web.UI/SimplePropertyEntry.cs
 System.Web.UI/SimpleWebHandlerParser.cs
 System.Web.UI/StateBag.cs
 System.Web.UI/StateItem.cs
@@ -721,6 +727,7 @@ System.Web.UI/TemplateParser.cs
 System.Web.UI/ThemeableAttribute.cs
 System.Web.UI/ToolboxDataAttribute.cs
 System.Web.UI/Triplet.cs
+System.Web.UI/TwoWayBoundPropertyEntry.cs
 System.Web.UI/UrlPropertyAttribute.cs
 System.Web.UI/UrlTypes.cs
 System.Web.UI/UserControl.cs