[mapguide-commits] r8508 - in trunk/Tools/Maestro: Maestro.Editors Maestro.Editors/Common Maestro.Editors/Common/Expression Maestro.Editors/FeatureSource/Extensions Maestro.Editors/FeatureSource/Preview Maestro.Editors/LayerDefinition Maestro.Editors/LayerDefinition/Vector Maestro.Editors/LayerDefinition/Vector/GridEditor Maestro.Editors/LayerDefinition/Vector/Scales Maestro.Editors/LayerDefinition/Vector/StyleEditors Maestro.Editors/LayerDefinition/Vector/Thematics Maestro.Editors/SymbolDefinition Maestro.Editors/WebLayout/Commands OSGeo.MapGuide.MaestroAPI.Expressions
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Jan 19 06:17:44 PST 2015
Author: jng
Date: 2015-01-19 06:17:44 -0800 (Mon, 19 Jan 2015)
New Revision: 8508
Added:
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.resx
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParseable.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.Designer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.resx
Modified:
trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.designer.cs
trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.resx
trunk/Tools/Maestro/Maestro.Editors/Common/IExpressionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.resx
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/ElevationDialog.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs
trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Strings.resx
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs
trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryExpression.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryLogicalOperator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoComparisonCondition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDataValue.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDistanceCondition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoExpression.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFilter.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFunction.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoGeometryValue.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoIdentifier.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoInCondition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoNullCondition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParameter.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoSpatialCondition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryExpression.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryLogicalOperator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/OSGeo.MapGuide.MaestroAPI.Expressions.csproj
Log:
#2525: Enhance the Expression Editor with ability to validate expressions/filter and to view their parsed structure via a new commands under the "Tools" toolbar menu.
Added: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.Designer.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,65 @@
+namespace Maestro.Editors.Common.Expression
+{
+ partial class ExpressionDisplayDialog
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExpressionDisplayDialog));
+ this.btnClose = new System.Windows.Forms.Button();
+ this.trvStructure = new System.Windows.Forms.TreeView();
+ this.SuspendLayout();
+ //
+ // btnClose
+ //
+ resources.ApplyResources(this.btnClose, "btnClose");
+ this.btnClose.Name = "btnClose";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // trvStructure
+ //
+ resources.ApplyResources(this.trvStructure, "trvStructure");
+ this.trvStructure.Name = "trvStructure";
+ //
+ // ExpressionDisplayDialog
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ControlBox = false;
+ this.Controls.Add(this.trvStructure);
+ this.Controls.Add(this.btnClose);
+ this.Name = "ExpressionDisplayDialog";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button btnClose;
+ private System.Windows.Forms.TreeView trvStructure;
+ }
+}
\ No newline at end of file
Added: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,202 @@
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#endregion Disclaimer / License
+using OSGeo.MapGuide.MaestroAPI.Expressions;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Maestro.Editors.Common.Expression
+{
+ internal partial class ExpressionDisplayDialog : Form
+ {
+ private ExpressionDisplayDialog()
+ {
+ InitializeComponent();
+ }
+
+ public ExpressionDisplayDialog(FdoParseable obj)
+ : this()
+ {
+ try
+ {
+ trvStructure.BeginUpdate();
+ trvStructure.Nodes.Add(LoadTree(obj));
+ }
+ finally
+ {
+ trvStructure.EndUpdate();
+ }
+ }
+
+ private TreeNode LoadTree(FdoParseable obj)
+ {
+ if (obj is FdoFilter)
+ return LoadFilterTree((FdoFilter)obj);
+ else
+ return LoadExpressionTree((FdoExpression)obj);
+ }
+
+ private TreeNode LoadExpressionTree(FdoExpression expr)
+ {
+ TreeNode node = new TreeNode();
+ switch (expr.ExpressionType)
+ {
+ case ExpressionType.BinaryExpression:
+ break;
+ case ExpressionType.BooleanValue:
+ node.Text = string.Format(Strings.ExprDispBoolean, ((FdoBooleanValue)expr).Value);
+ break;
+ case ExpressionType.DateTimeValue:
+ var dtVal = (FdoDateTimeValue)expr;
+ node.Text = string.Format(Strings.ExprDispDateTime, ((object)dtVal.DateTime ?? (object)dtVal.Time));
+ break;
+ case ExpressionType.DoubleValue:
+ node.Text = string.Format(Strings.ExprDispDouble, ((FdoDoubleValue)expr).Value);
+ break;
+ case ExpressionType.Function:
+ {
+ var func = (FdoFunction)expr;
+ node.Text = string.Format(Strings.ExprDispFunction, func.Identifier.Name);
+ foreach (var arg in func.Arguments)
+ {
+ node.Nodes.Add(LoadExpressionTree(arg));
+ }
+ }
+ break;
+ case ExpressionType.GeometryValue:
+ node.Text = string.Format(Strings.ExprDispGeometry, ((FdoGeometryValue)expr).GeometryWkt);
+ break;
+ case ExpressionType.Identifier:
+ node.Text = string.Format(Strings.ExprDispIdentifier, ((FdoIdentifier)expr).Name);
+ break;
+ case ExpressionType.Int32Value:
+ node.Text = string.Format(Strings.ExprDispInt32, ((FdoInt32Value)expr).Value);
+ break;
+ case ExpressionType.Parameter:
+ node.Text = string.Format(Strings.ExprDispParameter, ((FdoParameter)expr).Name);
+ break;
+ case ExpressionType.StringValue:
+ node.Text = string.Format(Strings.ExprDispString, ((FdoStringValue)expr).Value);
+ break;
+ case ExpressionType.UnaryExpression:
+ node.Text = Strings.ExprDispUnaryExpr;
+ node.Nodes.Add(LoadExpressionTree(((FdoUnaryExpression)expr).Expression));
+ break;
+ }
+ return node;
+ }
+
+ private TreeNode LoadFilterTree(FdoFilter filter)
+ {
+ TreeNode node = new TreeNode();
+ switch (filter.FilterType)
+ {
+ case FilterType.BinaryLogicalOperator:
+ {
+ var binOp = (FdoBinaryLogicalOperator)filter;
+ node.Text = string.Format(Strings.FltrDispBinaryLogicalOperator, binOp.Operator);
+ var left = new TreeNode(Strings.FltrDispLeftNode);
+ var right = new TreeNode(Strings.FltrDispRightNode);
+ left.Nodes.Add(LoadFilterTree(binOp.Left));
+ right.Nodes.Add(LoadFilterTree(binOp.Right));
+ node.Nodes.Add(left);
+ node.Nodes.Add(right);
+ }
+ break;
+ case FilterType.ComparisonCondition:
+ {
+ var compCond = (FdoComparisonCondition)filter;
+ node.Text = string.Format(Strings.FltrDispComparisonCondition, compCond.Operator);
+ var left = new TreeNode(Strings.FltrDispLeftNode);
+ var right = new TreeNode(Strings.FltrDispRightNode);
+ left.Nodes.Add(LoadExpressionTree(compCond.Left));
+ right.Nodes.Add(LoadExpressionTree(compCond.Right));
+ node.Nodes.Add(left);
+ node.Nodes.Add(right);
+ }
+ break;
+ case FilterType.DistanceCondition:
+ {
+ var distCond = (FdoDistanceCondition)filter;
+ node.Text = string.Format(Strings.FdoDispDistanceCondition, distCond.Operator);
+ var ident = new TreeNode(Strings.FdoDispIdentifierTitle);
+ var expr = new TreeNode(Strings.FdoDispExprTitle);
+ var dist = new TreeNode(Strings.FdoDispDistanceTitle);
+ ident.Nodes.Add(LoadExpressionTree(distCond.Identifier));
+ expr.Nodes.Add(LoadExpressionTree(distCond.Expression));
+ dist.Nodes.Add(LoadExpressionTree(distCond.Distance));
+ node.Nodes.Add(ident);
+ node.Nodes.Add(expr);
+ node.Nodes.Add(dist);
+ }
+ break;
+ case FilterType.InCondition:
+ {
+ var inCond = (FdoInCondition)filter;
+ node.Text = string.Format(Strings.FdoDispInCondition, inCond.Identifier.Name);
+ foreach (var arg in inCond.ValueList)
+ {
+ node.Nodes.Add(LoadExpressionTree(arg));
+ }
+ }
+ break;
+ case FilterType.NullCondition:
+ {
+ var nullCond = (FdoNullCondition)filter;
+ node.Text = string.Format(Strings.FdoDispNullCondition, nullCond.Identifier.Name);
+ }
+ break;
+ case FilterType.SpatialCondition:
+ {
+ var spCond = (FdoSpatialCondition)filter;
+ node.Text = string.Format(Strings.FdoDispSpatialCondition, spCond.Operator);
+ var ident = new TreeNode(Strings.FdoDispIdentifierTitle);
+ var exprNode = new TreeNode(Strings.FdoDispExprTitle);
+ ident.Nodes.Add(LoadExpressionTree(spCond.Identifier));
+ exprNode.Nodes.Add(LoadExpressionTree(spCond.Expression));
+ node.Nodes.Add(ident);
+ node.Nodes.Add(exprNode);
+ }
+ break;
+ case FilterType.UnaryLogicalOperator:
+ {
+ var unCond = (FdoUnaryLogicalOperator)filter;
+ node.Text = Strings.FdoDispUnaryOperator;
+ node.Nodes.Add(LoadFilterTree(unCond.NegatedFilter));
+ }
+ break;
+ }
+ return node;
+ }
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.resx 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="btnClose.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
+ <value>197, 313</value>
+ </data>
+ <data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="btnClose.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name="btnClose.Text" xml:space="preserve">
+ <value>Close</value>
+ </data>
+ <data name=">>btnClose.Name" xml:space="preserve">
+ <value>btnClose</value>
+ </data>
+ <data name=">>btnClose.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnClose.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnClose.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="trvStructure.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Bottom, Left, Right</value>
+ </data>
+ <data name="trvStructure.Location" type="System.Drawing.Point, System.Drawing">
+ <value>13, 13</value>
+ </data>
+ <data name="trvStructure.Size" type="System.Drawing.Size, System.Drawing">
+ <value>259, 294</value>
+ </data>
+ <data name="trvStructure.TabIndex" type="System.Int32, mscorlib">
+ <value>2</value>
+ </data>
+ <data name=">>trvStructure.Name" xml:space="preserve">
+ <value>trvStructure</value>
+ </data>
+ <data name=">>trvStructure.Type" xml:space="preserve">
+ <value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>trvStructure.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>trvStructure.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
+ <value>6, 13</value>
+ </data>
+ <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
+ <value>284, 348</value>
+ </data>
+ <data name="$this.Text" xml:space="preserve">
+ <value>Expression/Filter</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>ExpressionDisplayDialog</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Added: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,180 @@
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#endregion Disclaimer / License
+using OSGeo.MapGuide.MaestroAPI.Expressions;
+using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.ObjectModels.Capabilities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Maestro.Editors.Common.Expression
+{
+ [Serializable]
+ public class FdoExpressionValidationException : FdoParseException
+ {
+ private FdoExpressionValidationException(string message) : base(message) { }
+ public FdoExpressionValidationException(string message, Exception inner) : base(message, inner) { }
+ protected FdoExpressionValidationException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context)
+ : base(info, context) { }
+
+ /// <summary>
+ /// Gets the contextual token that is the cause of the validation error
+ /// </summary>
+ public string Token { get; private set; }
+
+ public FdoExpressionValidationException(string message, string token)
+ : this(message)
+ {
+ this.Token = token;
+ }
+ }
+
+ public class FdoExpressionValidator
+ {
+ public void ValidateExpression(FdoExpression expr, ClassDefinition cls, IFdoProviderCapabilities caps)
+ {
+ switch (expr.ExpressionType)
+ {
+ case ExpressionType.BinaryExpression:
+ {
+ var binExpr = (FdoBinaryExpression)expr;
+ ValidateExpression(binExpr.Left, cls, caps);
+ ValidateExpression(binExpr.Right, cls, caps);
+ }
+ break;
+ case ExpressionType.UnaryExpression:
+ {
+ var unExpr = (FdoUnaryExpression)expr;
+ ValidateExpression(unExpr.Expression, cls, caps);
+ }
+ break;
+ case ExpressionType.Identifier:
+ {
+ ValidateIdentifier(((FdoIdentifier)expr), cls);
+ }
+ break;
+ case ExpressionType.Function:
+ {
+ var func = ((FdoFunction)expr);
+ string name = func.Identifier.Name;
+ if (!caps.Expression.SupportedFunctions.Any(f => f.Name.ToUpper() == name.ToUpper()))
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidExpressionUnsupportedFunction, name), name);
+
+ foreach (var arg in func.Arguments)
+ {
+ ValidateExpression(arg, cls, caps);
+ }
+ }
+ break;
+ }
+ }
+
+ private static void ValidateIdentifier(FdoIdentifier expr, ClassDefinition cls)
+ {
+ string name = expr.Name;
+ if (cls.FindProperty(name) == null)
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidExpressionPropertyNotFound, name), name);
+ }
+
+ public void ValidateFilter(FdoFilter filter, ClassDefinition cls, IFdoProviderCapabilities caps)
+ {
+ switch (filter.FilterType)
+ {
+ case FilterType.BinaryLogicalOperator:
+ {
+ var binOp = (FdoBinaryLogicalOperator)filter;
+ ValidateFilter(binOp.Left, cls, caps);
+ ValidateFilter(binOp.Right, cls, caps);
+ }
+ break;
+ case FilterType.ComparisonCondition:
+ {
+ var compCond = (FdoComparisonCondition)filter;
+ if (compCond.Operator != ComparisonOperations.Like)
+ {
+ if (!caps.Filter.ConditionTypes.Select(o => o.ToUpper()).Contains("COMPARISON")) //NOXLATE
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedConditionType, compCond.Operator), compCond.Operator.ToString());
+ }
+ else //Like
+ {
+ if (!caps.Filter.ConditionTypes.Select(o => o.ToUpper()).Any(o => o == compCond.Operator.ToString().ToUpper()))
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedConditionType, compCond.Operator), compCond.Operator.ToString());
+ }
+ ValidateExpression(compCond.Left, cls, caps);
+ ValidateExpression(compCond.Right, cls, caps);
+ }
+ break;
+ case FilterType.DistanceCondition:
+ {
+ var distCond = (FdoDistanceCondition)filter;
+ if (!caps.Filter.DistanceOperations.Select(o => o.ToUpper()).Any(o => o == distCond.Operator.ToString().ToUpper()))
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedDistanceOperator, distCond.Operator), distCond.Operator.ToString());
+ ValidateIdentifier(distCond.Identifier, cls);
+ ValidateExpression(distCond.Expression, cls, caps);
+ }
+ break;
+ case FilterType.InCondition:
+ {
+ if (!caps.Filter.ConditionTypes.Select(o => o.ToUpper()).Contains("IN")) //NOXLATE
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedConditionType, "IN"), "IN"); //NOXLATE
+ var inCond = (FdoInCondition)filter;
+ ValidateIdentifier(inCond.Identifier, cls);
+ foreach (var val in inCond.ValueList)
+ {
+ ValidateExpression(val, cls, caps);
+ }
+ }
+ break;
+ case FilterType.NullCondition:
+ {
+ if (!caps.Filter.ConditionTypes.Select(o => o.ToUpper()).Contains("NULL")) //NOXLATE
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedConditionType, "NULL"), "NULL"); //NOXLATE
+ var nullCond = (FdoNullCondition)filter;
+ ValidateIdentifier(nullCond.Identifier, cls);
+ }
+ break;
+ case FilterType.SpatialCondition:
+ {
+ var spFilter = (FdoSpatialCondition)filter;
+ if (!caps.Filter.ConditionTypes.Select(o => o.ToUpper()).Contains("SPATIAL")) //NOXLATE
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedConditionType, "SPATIAL"), spFilter.Operator.ToString()); //NOXLATE
+ if (!caps.Filter.SpatialOperations.Select(o => o.ToUpper()).Any(o => o == spFilter.Operator.ToString().ToUpper()))
+ throw new FdoExpressionValidationException(string.Format(Strings.InvalidFilterUnsupportedSpatialOperator, spFilter.Operator), spFilter.Operator.ToString());
+
+ ValidateIdentifier(spFilter.Identifier, cls);
+ ValidateExpression(spFilter.Expression, cls, caps);
+ }
+ break;
+ case FilterType.UnaryLogicalOperator:
+ {
+ var negatedFilter = ((FdoUnaryLogicalOperator)filter).NegatedFilter;
+ ValidateFilter(negatedFilter, cls, caps);
+ }
+ break;
+ }
+ }
+ }
+}
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -25,6 +25,7 @@
using Maestro.Shared.UI;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Exceptions;
+using OSGeo.MapGuide.MaestroAPI.Expressions;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.ObjectModels.Capabilities;
using System;
@@ -79,21 +80,25 @@
set { ExpressionText.Text = value; }
}
+ private ExpressionEditorMode _mode;
+
/// <summary>
/// Initializes the dialog.
/// </summary>
/// <param name="edSvc">The editor service.</param>
/// <param name="caps">The provider capabilities.</param>
/// <param name="cls">The class definition.</param>
- /// <param name="featuresSourceId">The FeatureSource id.</param>
+ /// <param name="featureSourceId">The FeatureSource id.</param>
+ /// <param name="mode">The editor mode</param>
/// <param name="attachStylizationFunctions">if set to <c>true</c> stylization functions are also attached</param>
- public void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featuresSourceId, bool attachStylizationFunctions)
+ public void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions)
{
try
{
+ _mode = mode;
_cls = cls;
_edSvc = edSvc;
- m_featureSource = featuresSourceId;
+ m_featureSource = featureSourceId;
_caps = caps;
btnTools.Enabled = attachStylizationFunctions;
@@ -527,5 +532,51 @@
}
}
}
+
+ private FdoExpressionValidator _validator = new FdoExpressionValidator();
+
+ private void btnValidate_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (_mode == ExpressionEditorMode.Filter)
+ {
+ FdoFilter filter = FdoFilter.Parse(ExpressionText.Text);
+ _validator.ValidateFilter(filter, _cls, _caps);
+ MessageBox.Show(Strings.FilterIsValid);
+ }
+ else //Expression
+ {
+ FdoExpression expr = FdoExpression.Parse(ExpressionText.Text);
+ _validator.ValidateExpression(expr, _cls, _caps);
+ MessageBox.Show(Strings.ExprIsValid);
+ }
+ }
+ catch (FdoParseException ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ }
+
+ private void viewParsedExpressionFilterToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (_mode == ExpressionEditorMode.Filter)
+ {
+ FdoFilter filter = FdoFilter.Parse(ExpressionText.Text);
+ new ExpressionDisplayDialog(filter).ShowDialog();
+ }
+ else //Expression
+ {
+ FdoExpression expr = FdoExpression.Parse(ExpressionText.Text);
+ new ExpressionDisplayDialog(expr).ShowDialog();
+ }
+ }
+ catch (FdoParseException ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.designer.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.designer.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -46,12 +46,14 @@
this.ColumnName = new System.Windows.Forms.ToolStripComboBox();
this.btnTools = new System.Windows.Forms.ToolStripDropDownButton();
this.insertThemeExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this._autoCompleteTooltip = new System.Windows.Forms.ToolTip(this.components);
- this.ExpressionText = new ICSharpCode.TextEditor.TextEditorControl();
this.insertARGBColorExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.insertHTMLCOLORExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildAndInsertLOOKUPExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildAndInsertRANGEExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.btnValidate = new System.Windows.Forms.ToolStripButton();
+ this._autoCompleteTooltip = new System.Windows.Forms.ToolTip(this.components);
+ this.ExpressionText = new ICSharpCode.TextEditor.TextEditorControl();
+ this.viewParsedExpressionFilterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
@@ -88,7 +90,8 @@
this.ColumnValue,
this.LookupValues,
this.ColumnName,
- this.btnTools});
+ this.btnTools,
+ this.btnValidate});
resources.ApplyResources(this.toolStrip1, "toolStrip1");
this.toolStrip1.Name = "toolStrip1";
//
@@ -171,7 +174,8 @@
this.insertARGBColorExpressionToolStripMenuItem,
this.insertHTMLCOLORExpressionToolStripMenuItem,
this.buildAndInsertLOOKUPExpressionToolStripMenuItem,
- this.buildAndInsertRANGEExpressionToolStripMenuItem});
+ this.buildAndInsertRANGEExpressionToolStripMenuItem,
+ this.viewParsedExpressionFilterToolStripMenuItem});
this.btnTools.Image = global::Maestro.Editors.Properties.Resources.gear;
resources.ApplyResources(this.btnTools, "btnTools");
this.btnTools.Name = "btnTools";
@@ -182,14 +186,6 @@
resources.ApplyResources(this.insertThemeExpressionToolStripMenuItem, "insertThemeExpressionToolStripMenuItem");
this.insertThemeExpressionToolStripMenuItem.Click += new System.EventHandler(this.insertThemeExpressionToolStripMenuItem_Click);
//
- // ExpressionText
- //
- resources.ApplyResources(this.ExpressionText, "ExpressionText");
- this.ExpressionText.IsReadOnly = false;
- this.ExpressionText.Name = "ExpressionText";
- this.ExpressionText.ShowLineNumbers = false;
- this.ExpressionText.ShowVRuler = false;
- //
// insertARGBColorExpressionToolStripMenuItem
//
this.insertARGBColorExpressionToolStripMenuItem.Name = "insertARGBColorExpressionToolStripMenuItem";
@@ -214,6 +210,27 @@
resources.ApplyResources(this.buildAndInsertRANGEExpressionToolStripMenuItem, "buildAndInsertRANGEExpressionToolStripMenuItem");
this.buildAndInsertRANGEExpressionToolStripMenuItem.Click += new System.EventHandler(this.buildAndInsertRANGEExpressionToolStripMenuItem_Click);
//
+ // btnValidate
+ //
+ this.btnValidate.Image = global::Maestro.Editors.Properties.Resources.tick;
+ resources.ApplyResources(this.btnValidate, "btnValidate");
+ this.btnValidate.Name = "btnValidate";
+ this.btnValidate.Click += new System.EventHandler(this.btnValidate_Click);
+ //
+ // ExpressionText
+ //
+ resources.ApplyResources(this.ExpressionText, "ExpressionText");
+ this.ExpressionText.IsReadOnly = false;
+ this.ExpressionText.Name = "ExpressionText";
+ this.ExpressionText.ShowLineNumbers = false;
+ this.ExpressionText.ShowVRuler = false;
+ //
+ // viewParsedExpressionFilterToolStripMenuItem
+ //
+ this.viewParsedExpressionFilterToolStripMenuItem.Name = "viewParsedExpressionFilterToolStripMenuItem";
+ resources.ApplyResources(this.viewParsedExpressionFilterToolStripMenuItem, "viewParsedExpressionFilterToolStripMenuItem");
+ this.viewParsedExpressionFilterToolStripMenuItem.Click += new System.EventHandler(this.viewParsedExpressionFilterToolStripMenuItem_Click);
+ //
// ExpressionEditor
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -255,5 +272,7 @@
private System.Windows.Forms.ToolStripMenuItem insertHTMLCOLORExpressionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem buildAndInsertLOOKUPExpressionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem buildAndInsertRANGEExpressionToolStripMenuItem;
+ private System.Windows.Forms.ToolStripButton btnValidate;
+ private System.Windows.Forms.ToolStripMenuItem viewParsedExpressionFilterToolStripMenuItem;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.resx 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.resx 2015-01-19 14:17:44 UTC (rev 8508)
@@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="OKBtn.Location" type="System.Drawing.Point, System.Drawing">
- <value>473, 6</value>
+ <value>505, 6</value>
</data>
<data name="OKBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@@ -151,7 +151,7 @@
<value>Bottom, Right</value>
</data>
<data name="CancelBtn.Location" type="System.Drawing.Point, System.Drawing">
- <value>554, 6</value>
+ <value>586, 6</value>
</data>
<data name="CancelBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@@ -181,7 +181,7 @@
<value>0, 279</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
- <value>641, 40</value>
+ <value>673, 40</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@@ -219,6 +219,24 @@
<data name="btnFunctions.Text" xml:space="preserve">
<value>Functions</value>
</data>
+ <data name="btnCondition.Size" type="System.Drawing.Size, System.Drawing">
+ <value>127, 22</value>
+ </data>
+ <data name="btnCondition.Text" xml:space="preserve">
+ <value>Condition</value>
+ </data>
+ <data name="btnSpatial.Size" type="System.Drawing.Size, System.Drawing">
+ <value>127, 22</value>
+ </data>
+ <data name="btnSpatial.Text" xml:space="preserve">
+ <value>Spatial</value>
+ </data>
+ <data name="btnDistance.Size" type="System.Drawing.Size, System.Drawing">
+ <value>127, 22</value>
+ </data>
+ <data name="btnDistance.Text" xml:space="preserve">
+ <value>Distance</value>
+ </data>
<data name="btnFilter.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
@@ -285,6 +303,12 @@
<data name="buildAndInsertRANGEExpressionToolStripMenuItem.Text" xml:space="preserve">
<value>Build and Insert RANGE expression</value>
</data>
+ <data name="viewParsedExpressionFilterToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>307, 22</value>
+ </data>
+ <data name="viewParsedExpressionFilterToolStripMenuItem.Text" xml:space="preserve">
+ <value>View Parsed Expression/Filter</value>
+ </data>
<data name="btnTools.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
@@ -294,11 +318,20 @@
<data name="btnTools.Text" xml:space="preserve">
<value>Tools</value>
</data>
+ <data name="btnValidate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+ <value>Magenta</value>
+ </data>
+ <data name="btnValidate.Size" type="System.Drawing.Size, System.Drawing">
+ <value>69, 22</value>
+ </data>
+ <data name="btnValidate.Text" xml:space="preserve">
+ <value>Validate</value>
+ </data>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="toolStrip1.Size" type="System.Drawing.Size, System.Drawing">
- <value>641, 25</value>
+ <value>673, 25</value>
</data>
<data name="toolStrip1.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
@@ -318,24 +351,6 @@
<data name=">>toolStrip1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
- <data name="btnCondition.Size" type="System.Drawing.Size, System.Drawing">
- <value>127, 22</value>
- </data>
- <data name="btnCondition.Text" xml:space="preserve">
- <value>Condition</value>
- </data>
- <data name="btnSpatial.Size" type="System.Drawing.Size, System.Drawing">
- <value>127, 22</value>
- </data>
- <data name="btnSpatial.Text" xml:space="preserve">
- <value>Spatial</value>
- </data>
- <data name="btnDistance.Size" type="System.Drawing.Size, System.Drawing">
- <value>127, 22</value>
- </data>
- <data name="btnDistance.Text" xml:space="preserve">
- <value>Distance</value>
- </data>
<metadata name="_autoCompleteTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>116, 17</value>
</metadata>
@@ -346,7 +361,7 @@
<value>0, 25</value>
</data>
<data name="ExpressionText.Size" type="System.Drawing.Size, System.Drawing">
- <value>641, 254</value>
+ <value>673, 254</value>
</data>
<data name="ExpressionText.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
@@ -367,7 +382,7 @@
<value>True</value>
</metadata>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
- <value>641, 319</value>
+ <value>673, 319</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>500, 300</value>
@@ -450,12 +465,6 @@
<data name=">>insertThemeExpressionToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
- <data name=">>_autoCompleteTooltip.Name" xml:space="preserve">
- <value>_autoCompleteTooltip</value>
- </data>
- <data name=">>_autoCompleteTooltip.Type" xml:space="preserve">
- <value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
<data name=">>insertARGBColorExpressionToolStripMenuItem.Name" xml:space="preserve">
<value>insertARGBColorExpressionToolStripMenuItem</value>
</data>
@@ -480,6 +489,24 @@
<data name=">>buildAndInsertRANGEExpressionToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
+ <data name=">>btnValidate.Name" xml:space="preserve">
+ <value>btnValidate</value>
+ </data>
+ <data name=">>btnValidate.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>_autoCompleteTooltip.Name" xml:space="preserve">
+ <value>_autoCompleteTooltip</value>
+ </data>
+ <data name=">>_autoCompleteTooltip.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>viewParsedExpressionFilterToolStripMenuItem.Name" xml:space="preserve">
+ <value>viewParsedExpressionFilterToolStripMenuItem</value>
+ </data>
+ <data name=">>viewParsedExpressionFilterToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
<data name=">>$this.Name" xml:space="preserve">
<value>ExpressionEditor</value>
</data>
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/IExpressionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/IExpressionEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/IExpressionEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -27,6 +27,21 @@
namespace Maestro.Editors.Common
{
/// <summary>
+ /// The mode in which the expression editor should function
+ /// </summary>
+ public enum ExpressionEditorMode
+ {
+ /// <summary>
+ /// The editor is for editing expressions
+ /// </summary>
+ Expression,
+ /// <summary>
+ /// The editor is for editing filters
+ /// </summary>
+ Filter
+ }
+
+ /// <summary>
/// The expression editor interface
/// </summary>
internal interface IExpressionEditor
@@ -37,9 +52,10 @@
/// <param name="edSvc"></param>
/// <param name="caps"></param>
/// <param name="cls"></param>
- /// <param name="featuresSourceId"></param>
+ /// <param name="featureSourceId"></param>
+ /// <param name="mode"></param>
/// <param name="attachStylizationFunctions"></param>
- void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featuresSourceId, bool attachStylizationFunctions);
+ void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions);
/// <summary>
/// Gets or sets the FDO expression
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.Designer.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.Designer.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -47,12 +47,14 @@
this.ColumnName = new System.Windows.Forms.ToolStripComboBox();
this.btnTools = new System.Windows.Forms.ToolStripDropDownButton();
this.insertThemeExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.ExpressionText = new System.Windows.Forms.TextBox();
- this._autoCompleteTooltip = new System.Windows.Forms.ToolTip(this.components);
this.insertARGBColorExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.insertHTMLCOLORExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildAndInsertLOOKUPExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildAndInsertRANGEExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.btnValidate = new System.Windows.Forms.ToolStripButton();
+ this.ExpressionText = new System.Windows.Forms.TextBox();
+ this._autoCompleteTooltip = new System.Windows.Forms.ToolTip(this.components);
+ this.viewParsedExpressionFilterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
@@ -95,7 +97,8 @@
this.ColumnValue,
this.LookupValues,
this.ColumnName,
- this.btnTools});
+ this.btnTools,
+ this.btnValidate});
resources.ApplyResources(this.toolStrip1, "toolStrip1");
this.toolStrip1.Name = "toolStrip1";
//
@@ -178,7 +181,8 @@
this.insertARGBColorExpressionToolStripMenuItem,
this.insertHTMLCOLORExpressionToolStripMenuItem,
this.buildAndInsertLOOKUPExpressionToolStripMenuItem,
- this.buildAndInsertRANGEExpressionToolStripMenuItem});
+ this.buildAndInsertRANGEExpressionToolStripMenuItem,
+ this.viewParsedExpressionFilterToolStripMenuItem});
this.btnTools.Image = global::Maestro.Editors.Properties.Resources.gear;
resources.ApplyResources(this.btnTools, "btnTools");
this.btnTools.Name = "btnTools";
@@ -189,14 +193,6 @@
resources.ApplyResources(this.insertThemeExpressionToolStripMenuItem, "insertThemeExpressionToolStripMenuItem");
this.insertThemeExpressionToolStripMenuItem.Click += new System.EventHandler(this.insertThemeExpressionToolStripMenuItem_Click);
//
- // ExpressionText
- //
- resources.ApplyResources(this.ExpressionText, "ExpressionText");
- this.ExpressionText.HideSelection = false;
- this.ExpressionText.Name = "ExpressionText";
- this.ExpressionText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ExpressionText_KeyDown);
- this.ExpressionText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ExpressionText_KeyUp);
- //
// insertARGBColorExpressionToolStripMenuItem
//
this.insertARGBColorExpressionToolStripMenuItem.Name = "insertARGBColorExpressionToolStripMenuItem";
@@ -221,6 +217,27 @@
resources.ApplyResources(this.buildAndInsertRANGEExpressionToolStripMenuItem, "buildAndInsertRANGEExpressionToolStripMenuItem");
this.buildAndInsertRANGEExpressionToolStripMenuItem.Click += new System.EventHandler(this.buildAndInsertRANGEExpressionToolStripMenuItem_Click);
//
+ // btnValidate
+ //
+ this.btnValidate.Image = global::Maestro.Editors.Properties.Resources.tick;
+ resources.ApplyResources(this.btnValidate, "btnValidate");
+ this.btnValidate.Name = "btnValidate";
+ this.btnValidate.Click += new System.EventHandler(this.btnValidate_Click);
+ //
+ // ExpressionText
+ //
+ resources.ApplyResources(this.ExpressionText, "ExpressionText");
+ this.ExpressionText.HideSelection = false;
+ this.ExpressionText.Name = "ExpressionText";
+ this.ExpressionText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ExpressionText_KeyDown);
+ this.ExpressionText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ExpressionText_KeyUp);
+ //
+ // viewParsedExpressionFilterToolStripMenuItem
+ //
+ this.viewParsedExpressionFilterToolStripMenuItem.Name = "viewParsedExpressionFilterToolStripMenuItem";
+ resources.ApplyResources(this.viewParsedExpressionFilterToolStripMenuItem, "viewParsedExpressionFilterToolStripMenuItem");
+ this.viewParsedExpressionFilterToolStripMenuItem.Click += new System.EventHandler(this.viewParsedExpressionFilterToolStripMenuItem_Click);
+ //
// MonoCompatibleExpressionEditor
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -264,5 +281,7 @@
private System.Windows.Forms.ToolStripMenuItem insertHTMLCOLORExpressionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem buildAndInsertLOOKUPExpressionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem buildAndInsertRANGEExpressionToolStripMenuItem;
+ private System.Windows.Forms.ToolStripButton btnValidate;
+ private System.Windows.Forms.ToolStripMenuItem viewParsedExpressionFilterToolStripMenuItem;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -25,6 +25,7 @@
using Maestro.Shared.UI;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Exceptions;
+using OSGeo.MapGuide.MaestroAPI.Expressions;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.ObjectModels.Capabilities;
using OSGeo.MapGuide.ObjectModels.Capabilities.v1_0_0;
@@ -103,21 +104,27 @@
set { ExpressionText.Text = value; }
}
+ private IFdoProviderCapabilities _caps;
+ private ExpressionEditorMode _mode;
+
/// <summary>
/// Initializes the dialog.
/// </summary>
/// <param name="edSvc">The editor service.</param>
/// <param name="caps">The provider capabilities.</param>
/// <param name="cls">The class definition.</param>
- /// <param name="featuresSourceId">The features source id.</param>
+ /// <param name="featureSourceId">The features source id.</param>
+ /// <param name="mode">The editor mode</param>
/// <param name="attachStylizationFunctions">If true, Stylization FDO functions will be included</param>
- public void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featuresSourceId, bool attachStylizationFunctions)
+ public void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions)
{
try
{
+ _caps = caps;
+ _mode = mode;
_cls = cls;
_edSvc = edSvc;
- m_featureSource = featuresSourceId;
+ m_featureSource = featureSourceId;
insertThemeExpressionToolStripMenuItem.Enabled = attachStylizationFunctions;
@@ -1027,6 +1034,52 @@
}
}
}
+
+ private FdoExpressionValidator _validator = new FdoExpressionValidator();
+
+ private void btnValidate_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (_mode == ExpressionEditorMode.Filter)
+ {
+ FdoFilter filter = FdoFilter.Parse(ExpressionText.Text);
+ _validator.ValidateFilter(filter, _cls, _caps);
+ MessageBox.Show(Strings.FilterIsValid);
+ }
+ else //Expression
+ {
+ FdoExpression expr = FdoExpression.Parse(ExpressionText.Text);
+ _validator.ValidateExpression(expr, _cls, _caps);
+ MessageBox.Show(Strings.ExprIsValid);
+ }
+ }
+ catch (FdoParseException ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ }
+
+ private void viewParsedExpressionFilterToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (_mode == ExpressionEditorMode.Filter)
+ {
+ FdoFilter filter = FdoFilter.Parse(ExpressionText.Text);
+ new ExpressionDisplayDialog(filter).ShowDialog();
+ }
+ else //Expression
+ {
+ FdoExpression expr = FdoExpression.Parse(ExpressionText.Text);
+ new ExpressionDisplayDialog(expr).ShowDialog();
+ }
+ }
+ catch (FdoParseException ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ }
}
// ImageListBoxItem class
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.resx 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.resx 2015-01-19 14:17:44 UTC (rev 8508)
@@ -174,6 +174,21 @@
<data name=">>CancelBtn.ZOrder" xml:space="preserve">
<value>1</value>
</data>
+ <data name="lblHint.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="lblHint.Location" type="System.Drawing.Point, System.Drawing">
+ <value>12, 11</value>
+ </data>
+ <data name="lblHint.Size" type="System.Drawing.Size, System.Drawing">
+ <value>202, 13</value>
+ </data>
+ <data name="lblHint.TabIndex" type="System.Int32, mscorlib">
+ <value>4</value>
+ </data>
+ <data name="lblHint.Text" xml:space="preserve">
+ <value>Press Alt + Right to invoke auto-complete</value>
+ </data>
<data name=">>lblHint.Name" xml:space="preserve">
<value>lblHint</value>
</data>
@@ -210,33 +225,6 @@
<data name=">>panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
- <data name="lblHint.AutoSize" type="System.Boolean, mscorlib">
- <value>True</value>
- </data>
- <data name="lblHint.Location" type="System.Drawing.Point, System.Drawing">
- <value>12, 11</value>
- </data>
- <data name="lblHint.Size" type="System.Drawing.Size, System.Drawing">
- <value>202, 13</value>
- </data>
- <data name="lblHint.TabIndex" type="System.Int32, mscorlib">
- <value>4</value>
- </data>
- <data name="lblHint.Text" xml:space="preserve">
- <value>Press Alt + Right to invoke auto-complete</value>
- </data>
- <data name=">>lblHint.Name" xml:space="preserve">
- <value>lblHint</value>
- </data>
- <data name=">>lblHint.Type" xml:space="preserve">
- <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>lblHint.Parent" xml:space="preserve">
- <value>panel1</value>
- </data>
- <data name=">>lblHint.ZOrder" xml:space="preserve">
- <value>0</value>
- </data>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
@@ -258,6 +246,24 @@
<data name="btnFunctions.Text" xml:space="preserve">
<value>Functions</value>
</data>
+ <data name="btnCondition.Size" type="System.Drawing.Size, System.Drawing">
+ <value>127, 22</value>
+ </data>
+ <data name="btnCondition.Text" xml:space="preserve">
+ <value>Condition</value>
+ </data>
+ <data name="btnSpatial.Size" type="System.Drawing.Size, System.Drawing">
+ <value>127, 22</value>
+ </data>
+ <data name="btnSpatial.Text" xml:space="preserve">
+ <value>Spatial</value>
+ </data>
+ <data name="btnDistance.Size" type="System.Drawing.Size, System.Drawing">
+ <value>127, 22</value>
+ </data>
+ <data name="btnDistance.Text" xml:space="preserve">
+ <value>Distance</value>
+ </data>
<data name="btnFilter.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
@@ -324,6 +330,12 @@
<data name="buildAndInsertRANGEExpressionToolStripMenuItem.Text" xml:space="preserve">
<value>Build and Insert RANGE expression</value>
</data>
+ <data name="viewParsedExpressionFilterToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>307, 22</value>
+ </data>
+ <data name="viewParsedExpressionFilterToolStripMenuItem.Text" xml:space="preserve">
+ <value>View Parsed Expression/Filter</value>
+ </data>
<data name="btnTools.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
@@ -333,6 +345,15 @@
<data name="btnTools.Text" xml:space="preserve">
<value>Tools</value>
</data>
+ <data name="btnValidate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+ <value>Magenta</value>
+ </data>
+ <data name="btnValidate.Size" type="System.Drawing.Size, System.Drawing">
+ <value>69, 22</value>
+ </data>
+ <data name="btnValidate.Text" xml:space="preserve">
+ <value>Validate</value>
+ </data>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
@@ -357,24 +378,6 @@
<data name=">>toolStrip1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
- <data name="btnCondition.Size" type="System.Drawing.Size, System.Drawing">
- <value>127, 22</value>
- </data>
- <data name="btnCondition.Text" xml:space="preserve">
- <value>Condition</value>
- </data>
- <data name="btnSpatial.Size" type="System.Drawing.Size, System.Drawing">
- <value>127, 22</value>
- </data>
- <data name="btnSpatial.Text" xml:space="preserve">
- <value>Spatial</value>
- </data>
- <data name="btnDistance.Size" type="System.Drawing.Size, System.Drawing">
- <value>127, 22</value>
- </data>
- <data name="btnDistance.Text" xml:space="preserve">
- <value>Distance</value>
- </data>
<data name="ExpressionText.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
@@ -495,12 +498,6 @@
<data name=">>insertThemeExpressionToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
- <data name=">>_autoCompleteTooltip.Name" xml:space="preserve">
- <value>_autoCompleteTooltip</value>
- </data>
- <data name=">>_autoCompleteTooltip.Type" xml:space="preserve">
- <value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
<data name=">>insertARGBColorExpressionToolStripMenuItem.Name" xml:space="preserve">
<value>insertARGBColorExpressionToolStripMenuItem</value>
</data>
@@ -525,6 +522,24 @@
<data name=">>buildAndInsertRANGEExpressionToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
+ <data name=">>btnValidate.Name" xml:space="preserve">
+ <value>btnValidate</value>
+ </data>
+ <data name=">>btnValidate.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>_autoCompleteTooltip.Name" xml:space="preserve">
+ <value>_autoCompleteTooltip</value>
+ </data>
+ <data name=">>_autoCompleteTooltip.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>viewParsedExpressionFilterToolStripMenuItem.Name" xml:space="preserve">
+ <value>viewParsedExpressionFilterToolStripMenuItem</value>
+ </data>
+ <data name=">>viewParsedExpressionFilterToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
<data name=">>$this.Name" xml:space="preserve">
<value>MonoCompatibleExpressionEditor</value>
</data>
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -52,7 +52,7 @@
private void lnkEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- string expr = _edSvc.EditExpression(txtExpression.Text, _cls, _parent.Provider, _parent.ResourceID, false);
+ string expr = _edSvc.EditExpression(txtExpression.Text, _cls, _parent.Provider, _parent.ResourceID, Common.ExpressionEditorMode.Expression, false);
if (expr != null)
{
txtExpression.Text = expr;
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -107,7 +107,7 @@
private void txtFilter_Click(object sender, EventArgs e)
{
var ed = FdoExpressionEditorFactory.Create(); //new ExpressionEditor();
- ed.Initialize(_edSvc, _caps, _cls, _fsId, false);
+ ed.Initialize(_edSvc, _caps, _cls, _fsId, ExpressionEditorMode.Filter, false);
ed.Expression = txtFilter.Text;
if (ed.ShowDialog() == DialogResult.OK)
{
@@ -134,7 +134,7 @@
private void btnAdd_Click(object sender, EventArgs e)
{
var ed = FdoExpressionEditorFactory.Create();// new ExpressionEditor();
- ed.Initialize(_edSvc, _caps, _cls, _fsId, false);
+ ed.Initialize(_edSvc, _caps, _cls, _fsId, ExpressionEditorMode.Expression, false);
if (ed.ShowDialog() == DialogResult.OK)
{
grdExpressions.Rows.Add(GenerateAlias(), ed.Expression);
Modified: trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -20,6 +20,7 @@
#endregion Disclaimer / License
+using Maestro.Editors.Common;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI.Schema;
@@ -107,9 +108,10 @@
/// <param name="schema"></param>
/// <param name="providerName"></param>
/// <param name="featureSourceId"></param>
+ /// <param name="mode"></param>
/// <param name="attachStylizationFunctions"></param>
/// <returns></returns>
- string EditExpression(string currentExpr, ClassDefinition schema, string providerName, string featureSourceId, bool attachStylizationFunctions);
+ string EditExpression(string currentExpr, ClassDefinition schema, string providerName, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions);
/// <summary>
/// Gets the resource ID of the resource, whose session-copy is being edited
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -20,6 +20,7 @@
#endregion Disclaimer / License
+using Maestro.Editors.Common;
using Maestro.Editors.LayerDefinition.Vector.Scales;
using Maestro.Editors.LayerDefinition.Vector.StyleEditors;
using Maestro.Editors.LayerDefinition.Vector.Thematics;
@@ -443,7 +444,7 @@
case "Filter":
{
var expr = rule.Filter;
- var newExpr = _edSvc.EditExpression(expr, GetLayerClass(), GetLayerProvider(), GetFeatureSource(), true);
+ var newExpr = _edSvc.EditExpression(expr, GetLayerClass(), GetLayerProvider(), GetFeatureSource(), ExpressionEditorMode.Filter, true);
if (newExpr != null)
{
rule.Filter = newExpr;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -199,7 +199,7 @@
private void EditFilter_Click(object sender, EventArgs e)
{
- string tmp = m_owner.EditExpression(RuleCondition.Text, false);
+ string tmp = m_owner.EditExpression(RuleCondition.Text, ExpressionEditorMode.Filter, false);
if (tmp != null)
RuleCondition.Text = tmp;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -102,7 +102,7 @@
private void OnRequestBrowse(SymbolDefinition.SymbolField sender)
{
- string expr = _edSvc.EditExpression(sender.Content, _cls, _providerName, _featureSourceId, true);
+ string expr = _edSvc.EditExpression(sender.Content, _cls, _providerName, _featureSourceId, Common.ExpressionEditorMode.Expression, true);
if (expr != null)
sender.Content = expr;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -473,7 +473,7 @@
if (grdOverrides.SelectedRows.Count == 1)
{
var ov = (ParameterModel)grdOverrides.SelectedRows[0].DataBoundItem;
- string expr = _edSvc.EditExpression(ov.Value, _cls, _provider, _featureSourceId, true);
+ string expr = _edSvc.EditExpression(ov.Value, _cls, _provider, _featureSourceId, ExpressionEditorMode.Expression, true);
if (expr != null)
{
ov.Value = expr;
@@ -501,7 +501,7 @@
}
else //Fallback to Expression Editor
{
- string expr = _edSvc.EditExpression(ov.Value, _cls, _provider, _featureSourceId, true);
+ string expr = _edSvc.EditExpression(ov.Value, _cls, _provider, _featureSourceId, ExpressionEditorMode.Expression, true);
if (expr != null)
{
ov.Value = expr;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -20,6 +20,7 @@
#endregion Disclaimer / License
+using Maestro.Editors.Common;
using Maestro.Shared.UI;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.MaestroAPI.Services;
@@ -316,7 +317,7 @@
string expr = null;
if (current != null)
{
- expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
}
@@ -381,7 +382,7 @@
private void fillStyleEditor_BackgroundRequiresExpression(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(fillStyleEditor.backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(fillStyleEditor.backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
fillStyleEditor.backgroundColor.ColorExpression = expr;
@@ -391,7 +392,7 @@
private void fillStyleEditor_ForegroundRequiresExpression(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(fillStyleEditor.foregroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(fillStyleEditor.foregroundColor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
fillStyleEditor.foregroundColor.ColorExpression = expr;
@@ -401,7 +402,7 @@
private void LineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
lineStyleEditor.colorCombo.ColorExpression = expr;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/ElevationDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/ElevationDialog.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/ElevationDialog.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -20,6 +20,7 @@
#endregion Disclaimer / License
+using Maestro.Editors.Common;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
using System;
@@ -110,14 +111,14 @@
private void btnZOffset_Click(object sender, EventArgs e)
{
- string expr = _edSvc.EditExpression(txtZOffset.Text, _clsDef, _provider, _featureSourceId, true);
+ string expr = _edSvc.EditExpression(txtZOffset.Text, _clsDef, _provider, _featureSourceId, ExpressionEditorMode.Expression, true);
if (expr != null)
txtZOffset.Text = expr;
}
private void btnZExtrusion_Click(object sender, EventArgs e)
{
- string expr = _edSvc.EditExpression(txtZExtrusion.Text, _clsDef, _provider, _featureSourceId, true);
+ string expr = _edSvc.EditExpression(txtZExtrusion.Text, _clsDef, _provider, _featureSourceId, ExpressionEditorMode.Expression, true);
if (expr != null)
txtZExtrusion.Text = expr;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -20,6 +20,7 @@
#endregion Disclaimer / License
+using Maestro.Editors.Common;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
@@ -154,7 +155,7 @@
if (propertyCombo.SelectedIndex == propertyCombo.Items.Count - 1)
{
string current = m_item.Text;
- string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
@@ -203,7 +204,7 @@
if (sizeCombo.SelectedIndex == sizeCombo.Items.Count - 1)
{
string current = m_item.SizeX;
- string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
@@ -286,7 +287,7 @@
if (horizontalCombo.SelectedIndex == horizontalCombo.Items.Count - 1)
{
string current = m_item.HorizontalAlignment;
- string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
@@ -307,7 +308,7 @@
if (verticalCombo.SelectedIndex == verticalCombo.Items.Count - 1)
{
string current = m_item.VerticalAlignment;
- string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
@@ -328,7 +329,7 @@
if (rotationCombo.SelectedIndex == rotationCombo.Items.Count - 1)
{
string current = m_item.Rotation;
- string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
@@ -482,14 +483,14 @@
private void TextColor_RequestExpressionEditor(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(textColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(textColor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
textColor.ColorExpression = expr;
}
private void BackgroundColor_RequestExpressionEditor(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
backgroundColor.ColorExpression = expr;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -579,7 +579,7 @@
return;
string current = this.CurrentStrokeType.Thickness;
- string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
@@ -746,7 +746,7 @@
private void lineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(lineStyleEditor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(lineStyleEditor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
lineStyleEditor.ColorExpression = expr;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -1170,7 +1170,7 @@
string expr = null;
if (current != null)
{
- expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
}
@@ -1194,7 +1194,7 @@
string expr = null;
if (current != null)
{
- expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
}
@@ -1256,7 +1256,7 @@
string expr = null;
if (current != null)
{
- expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
}
@@ -1377,7 +1377,7 @@
string expr = null;
if (current != null)
{
- expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, true);
+ expr = m_editor.EditExpression(current, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (!string.IsNullOrEmpty(expr))
current = expr;
}
@@ -1761,7 +1761,7 @@
private void FillStyleEditor_BackgroundRequiresExpression(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(fillStyleEditor.backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(fillStyleEditor.backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
fillStyleEditor.backgroundColor.ColorExpression = expr;
@@ -1771,7 +1771,7 @@
private void FillStyleEditor_ForegroundRequiresExpression(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(fillStyleEditor.foregroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(fillStyleEditor.foregroundColor.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
fillStyleEditor.foregroundColor.ColorExpression = expr;
@@ -1781,7 +1781,7 @@
private void LineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
{
- string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, true);
+ string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, ExpressionEditorMode.Expression, true);
if (expr != null)
{
lineStyleEditor.colorCombo.ColorExpression = expr;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -1728,7 +1728,7 @@
var conn = m_editor.CurrentConnection;
IFeatureSource fs = (IFeatureSource)conn.ResourceService.GetResource(fsId);
ClassDefinition clsDef = conn.FeatureService.GetClassDefinition(fsId, className);
- string expr = m_editor.EditExpression(txtFilter.Text, clsDef, fs.Provider, fsId, false);
+ string expr = m_editor.EditExpression(txtFilter.Text, clsDef, fs.Provider, fsId, ExpressionEditorMode.Filter, false);
if (expr != null)
txtFilter.Text = expr;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -345,7 +345,7 @@
if (cls != null)
{
var fs = GetFeatureSource();
- var expr = _edsvc.EditExpression(txtFilter.Text, cls, fs.Provider, fs.ResourceID, false);
+ var expr = _edsvc.EditExpression(txtFilter.Text, cls, fs.Provider, fs.ResourceID, ExpressionEditorMode.Filter, false);
if (expr != null)
{
txtFilter.Text = expr;
@@ -359,7 +359,7 @@
if (cls != null)
{
var fs = GetFeatureSource();
- var expr = _edsvc.EditExpression(txtHyperlink.Text, cls, fs.Provider, fs.ResourceID, true);
+ var expr = _edsvc.EditExpression(txtHyperlink.Text, cls, fs.Provider, fs.ResourceID, ExpressionEditorMode.Expression, true);
if (expr != null)
{
txtHyperlink.Text = expr;
@@ -373,7 +373,7 @@
if (cls != null)
{
var fs = GetFeatureSource();
- var expr = _edsvc.EditExpression(txtTooltip.Text, cls, fs.Provider, fs.ResourceID, true);
+ var expr = _edsvc.EditExpression(txtTooltip.Text, cls, fs.Provider, fs.ResourceID, ExpressionEditorMode.Expression, true);
if (expr != null)
{
txtTooltip.Text = expr;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -1,4 +1,5 @@
-using Maestro.Editors.WatermarkDefinition;
+using Maestro.Editors.Common;
+using Maestro.Editors.WatermarkDefinition;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
@@ -86,12 +87,12 @@
get { return _edsvc; }
}
- internal string EditExpression(string expr, bool attachStylizationFunctions)
+ internal string EditExpression(string expr, ExpressionEditorMode mode, bool attachStylizationFunctions)
{
var fs = (IFeatureSource)_edsvc.CurrentConnection.ResourceService.GetResource(_vl.ResourceId);
var cls = _edsvc.CurrentConnection.FeatureService.GetClassDefinition(fs.ResourceID, _vl.FeatureName);
- return _edsvc.EditExpression(expr, cls, fs.Provider, _vl.ResourceId, attachStylizationFunctions);
+ return _edsvc.EditExpression(expr, cls, fs.Provider, _vl.ResourceId, mode, attachStylizationFunctions);
}
internal void UpdateDisplay()
Modified: trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj 2015-01-19 14:17:44 UTC (rev 8508)
@@ -122,6 +122,13 @@
<Compile Include="Common\ExpressionEditor.designer.cs">
<DependentUpon>ExpressionEditor.cs</DependentUpon>
</Compile>
+ <Compile Include="Common\Expression\ExpressionDisplayDialog.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Common\Expression\ExpressionDisplayDialog.Designer.cs">
+ <DependentUpon>ExpressionDisplayDialog.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Common\Expression\FdoExpressionValidator.cs" />
<Compile Include="Common\Expression\LookupExpressionBuilder.cs">
<SubType>Form</SubType>
</Compile>
@@ -1352,6 +1359,9 @@
<DependentUpon>ExpressionEditor.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="Common\Expression\ExpressionDisplayDialog.resx">
+ <DependentUpon>ExpressionDisplayDialog.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Common\Expression\LookupExpressionBuilder.resx">
<DependentUpon>LookupExpressionBuilder.cs</DependentUpon>
</EmbeddedResource>
@@ -1974,6 +1984,10 @@
<Project>{CFD19053-2172-41D3-8460-0FD2123A1E88}</Project>
<Name>Maestro.Shared.UI</Name>
</ProjectReference>
+ <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI.Expressions\OSGeo.MapGuide.MaestroAPI.Expressions.csproj">
+ <Project>{da2cc031-200b-4f99-a0a9-2e95374be78f}</Project>
+ <Name>OSGeo.MapGuide.MaestroAPI.Expressions</Name>
+ </ProjectReference>
<ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
<Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>
<Name>OSGeo.MapGuide.MaestroAPI</Name>
Modified: trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -94,13 +94,14 @@
/// <param name="classDef">The class def.</param>
/// <param name="providerName">Name of the provider.</param>
/// <param name="featureSourceId">The feature source id.</param>
+ /// <param name="mode">The editor mode</param>
/// <param name="attachStylizationFunctions">If true, FDO stylization functions are also included in the function list</param>
/// <returns></returns>
- public string EditExpression(string currentExpr, ClassDefinition classDef, string providerName, string featureSourceId, bool attachStylizationFunctions)
+ public string EditExpression(string currentExpr, ClassDefinition classDef, string providerName, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions)
{
- var ed = FdoExpressionEditorFactory.Create(); new ExpressionEditor();
+ var ed = FdoExpressionEditorFactory.Create();
var caps = _conn.FeatureService.GetProviderCapabilities(providerName);
- ed.Initialize(this, caps, classDef, featureSourceId, attachStylizationFunctions);
+ ed.Initialize(this, caps, classDef, featureSourceId, mode, attachStylizationFunctions);
ed.Expression = currentExpr;
if (ed.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -646,6 +646,96 @@
}
/// <summary>
+ /// Looks up a localized string similar to Boolean: {0}.
+ /// </summary>
+ internal static string ExprDispBoolean {
+ get {
+ return ResourceManager.GetString("ExprDispBoolean", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to DateTime: {0}.
+ /// </summary>
+ internal static string ExprDispDateTime {
+ get {
+ return ResourceManager.GetString("ExprDispDateTime", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Double: {0}.
+ /// </summary>
+ internal static string ExprDispDouble {
+ get {
+ return ResourceManager.GetString("ExprDispDouble", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Function: {0}.
+ /// </summary>
+ internal static string ExprDispFunction {
+ get {
+ return ResourceManager.GetString("ExprDispFunction", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Geometry: {0}.
+ /// </summary>
+ internal static string ExprDispGeometry {
+ get {
+ return ResourceManager.GetString("ExprDispGeometry", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Identifier: {0}.
+ /// </summary>
+ internal static string ExprDispIdentifier {
+ get {
+ return ResourceManager.GetString("ExprDispIdentifier", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Int32: {0}.
+ /// </summary>
+ internal static string ExprDispInt32 {
+ get {
+ return ResourceManager.GetString("ExprDispInt32", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Parameter: {0}.
+ /// </summary>
+ internal static string ExprDispParameter {
+ get {
+ return ResourceManager.GetString("ExprDispParameter", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to String: '{0}'.
+ /// </summary>
+ internal static string ExprDispString {
+ get {
+ return ResourceManager.GetString("ExprDispString", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unary Expression (Negated).
+ /// </summary>
+ internal static string ExprDispUnaryExpr {
+ get {
+ return ResourceManager.GetString("ExprDispUnaryExpr", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to {0}{4}Description:{1}{4}Arguments:{2}{4}Returns: {3}.
/// </summary>
internal static string ExprEditorFunctionDesc {
@@ -664,6 +754,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to Expression is valid.
+ /// </summary>
+ internal static string ExprIsValid {
+ get {
+ return ResourceManager.GetString("ExprIsValid", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Extended class based on: {0}.
/// </summary>
internal static string ExtendedClassTooltip {
@@ -736,6 +835,78 @@
}
/// <summary>
+ /// Looks up a localized string similar to Distance ({0}).
+ /// </summary>
+ internal static string FdoDispDistanceCondition {
+ get {
+ return ResourceManager.GetString("FdoDispDistanceCondition", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Distance.
+ /// </summary>
+ internal static string FdoDispDistanceTitle {
+ get {
+ return ResourceManager.GetString("FdoDispDistanceTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Expression.
+ /// </summary>
+ internal static string FdoDispExprTitle {
+ get {
+ return ResourceManager.GetString("FdoDispExprTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Identifier.
+ /// </summary>
+ internal static string FdoDispIdentifierTitle {
+ get {
+ return ResourceManager.GetString("FdoDispIdentifierTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to In Condition ({0}).
+ /// </summary>
+ internal static string FdoDispInCondition {
+ get {
+ return ResourceManager.GetString("FdoDispInCondition", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Null Condition ({0}).
+ /// </summary>
+ internal static string FdoDispNullCondition {
+ get {
+ return ResourceManager.GetString("FdoDispNullCondition", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Spatial Condition ({0}).
+ /// </summary>
+ internal static string FdoDispSpatialCondition {
+ get {
+ return ResourceManager.GetString("FdoDispSpatialCondition", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unary Operator (NOT).
+ /// </summary>
+ internal static string FdoDispUnaryOperator {
+ get {
+ return ResourceManager.GetString("FdoDispUnaryOperator", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Feature Class not found: {0}.
/// </summary>
internal static string FeatureClassNotFound {
@@ -844,6 +1015,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to Filter is valid.
+ /// </summary>
+ internal static string FilterIsValid {
+ get {
+ return ResourceManager.GetString("FilterIsValid", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Cannot Find an Empty String.
/// </summary>
internal static string FindEmptyString {
@@ -880,6 +1060,42 @@
}
/// <summary>
+ /// Looks up a localized string similar to Binary Logical Operator ({0}).
+ /// </summary>
+ internal static string FltrDispBinaryLogicalOperator {
+ get {
+ return ResourceManager.GetString("FltrDispBinaryLogicalOperator", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Comparison ({0}).
+ /// </summary>
+ internal static string FltrDispComparisonCondition {
+ get {
+ return ResourceManager.GetString("FltrDispComparisonCondition", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Left.
+ /// </summary>
+ internal static string FltrDispLeftNode {
+ get {
+ return ResourceManager.GetString("FltrDispLeftNode", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Right.
+ /// </summary>
+ internal static string FltrDispRightNode {
+ get {
+ return ResourceManager.GetString("FltrDispRightNode", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to The folder must start with \"Library://\", do you want the starting folder to become:\n {0} ?.
/// </summary>
internal static string FolderMissingPrefix {
@@ -1382,6 +1598,24 @@
}
/// <summary>
+ /// Looks up a localized string similar to Invalid Expression. Property not found: {0}.
+ /// </summary>
+ internal static string InvalidExpressionPropertyNotFound {
+ get {
+ return ResourceManager.GetString("InvalidExpressionPropertyNotFound", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid Expression. Function not supported: {0}.
+ /// </summary>
+ internal static string InvalidExpressionUnsupportedFunction {
+ get {
+ return ResourceManager.GetString("InvalidExpressionUnsupportedFunction", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Feature Source ({0}) has no usable feature classes. Choose a different feature source.
/// </summary>
internal static string InvalidFeatureSourceNoClasses {
@@ -1400,6 +1634,33 @@
}
/// <summary>
+ /// Looks up a localized string similar to Invalid Filter. Unsupported condition type: {0}.
+ /// </summary>
+ internal static string InvalidFilterUnsupportedConditionType {
+ get {
+ return ResourceManager.GetString("InvalidFilterUnsupportedConditionType", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid Filter. Unsupported distance operator: {0}.
+ /// </summary>
+ internal static string InvalidFilterUnsupportedDistanceOperator {
+ get {
+ return ResourceManager.GetString("InvalidFilterUnsupportedDistanceOperator", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid Filter. Unsupported spatial operator: {0}.
+ /// </summary>
+ internal static string InvalidFilterUnsupportedSpatialOperator {
+ get {
+ return ResourceManager.GetString("InvalidFilterUnsupportedSpatialOperator", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Invalid Layer Name Format. Name must have both {0} and {1} format markers.
/// </summary>
internal static string InvalidLayerNameFormat {
Modified: trunk/Tools/Maestro/Maestro.Editors/Strings.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Strings.resx 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/Strings.resx 2015-01-19 14:17:44 UTC (rev 8508)
@@ -1619,4 +1619,91 @@
<data name="CmsStamenWaterColor" xml:space="preserve">
<value>Stamen (WaterColor)</value>
</data>
+ <data name="ExprIsValid" xml:space="preserve">
+ <value>Expression is valid</value>
+ </data>
+ <data name="FilterIsValid" xml:space="preserve">
+ <value>Filter is valid</value>
+ </data>
+ <data name="InvalidExpressionPropertyNotFound" xml:space="preserve">
+ <value>Invalid Expression. Property not found: {0}</value>
+ </data>
+ <data name="InvalidExpressionUnsupportedFunction" xml:space="preserve">
+ <value>Invalid Expression. Function not supported: {0}</value>
+ </data>
+ <data name="InvalidFilterUnsupportedConditionType" xml:space="preserve">
+ <value>Invalid Filter. Unsupported condition type: {0}</value>
+ </data>
+ <data name="InvalidFilterUnsupportedDistanceOperator" xml:space="preserve">
+ <value>Invalid Filter. Unsupported distance operator: {0}</value>
+ </data>
+ <data name="InvalidFilterUnsupportedSpatialOperator" xml:space="preserve">
+ <value>Invalid Filter. Unsupported spatial operator: {0}</value>
+ </data>
+ <data name="ExprDispBoolean" xml:space="preserve">
+ <value>Boolean: {0}</value>
+ </data>
+ <data name="ExprDispDateTime" xml:space="preserve">
+ <value>DateTime: {0}</value>
+ </data>
+ <data name="ExprDispDouble" xml:space="preserve">
+ <value>Double: {0}</value>
+ </data>
+ <data name="ExprDispFunction" xml:space="preserve">
+ <value>Function: {0}</value>
+ </data>
+ <data name="ExprDispGeometry" xml:space="preserve">
+ <value>Geometry: {0}</value>
+ </data>
+ <data name="ExprDispIdentifier" xml:space="preserve">
+ <value>Identifier: {0}</value>
+ </data>
+ <data name="ExprDispInt32" xml:space="preserve">
+ <value>Int32: {0}</value>
+ </data>
+ <data name="ExprDispParameter" xml:space="preserve">
+ <value>Parameter: {0}</value>
+ </data>
+ <data name="ExprDispString" xml:space="preserve">
+ <value>String: '{0}'</value>
+ </data>
+ <data name="ExprDispUnaryExpr" xml:space="preserve">
+ <value>Unary Expression (Negated)</value>
+ </data>
+ <data name="FdoDispDistanceCondition" xml:space="preserve">
+ <value>Distance ({0})</value>
+ </data>
+ <data name="FdoDispDistanceTitle" xml:space="preserve">
+ <value>Distance</value>
+ </data>
+ <data name="FdoDispExprTitle" xml:space="preserve">
+ <value>Expression</value>
+ </data>
+ <data name="FdoDispIdentifierTitle" xml:space="preserve">
+ <value>Identifier</value>
+ </data>
+ <data name="FdoDispInCondition" xml:space="preserve">
+ <value>In Condition ({0})</value>
+ </data>
+ <data name="FdoDispNullCondition" xml:space="preserve">
+ <value>Null Condition ({0})</value>
+ </data>
+ <data name="FdoDispSpatialCondition" xml:space="preserve">
+ <value>Spatial Condition ({0})</value>
+ </data>
+ <data name="FdoDispUnaryOperator" xml:space="preserve">
+ <value>Unary Operator (NOT)</value>
+ </data>
+ <data name="FltrDispBinaryLogicalOperator" xml:space="preserve">
+ <value>Binary Logical Operator ({0})</value>
+ </data>
+ <data name="FltrDispComparisonCondition" xml:space="preserve">
+ <value>Comparison ({0})</value>
+ </data>
+ <data name="FltrDispLeftNode" xml:space="preserve">
+ <value>Left</value>
+ </data>
+ <data name="FltrDispRightNode" xml:space="preserve">
+ <value>Right</value>
+ </data>
</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -20,6 +20,7 @@
#endregion Disclaimer / License
+using Maestro.Editors.Common;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.ObjectModels;
@@ -97,9 +98,9 @@
return _inner.SelectUnmanagedData(startPath, fileTypes);
}
- public string EditExpression(string currentExpr, OSGeo.MapGuide.MaestroAPI.Schema.ClassDefinition schema, string providerName, string featureSourceId, bool attachStylizationFunctions)
+ public string EditExpression(string currentExpr, OSGeo.MapGuide.MaestroAPI.Schema.ClassDefinition schema, string providerName, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions)
{
- return _inner.EditExpression(currentExpr, schema, providerName, featureSourceId, attachStylizationFunctions);
+ return _inner.EditExpression(currentExpr, schema, providerName, featureSourceId, mode, attachStylizationFunctions);
}
public string ResourceID
Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -177,7 +177,7 @@
var fs = (IFeatureSource)resSvc.GetResource(vl.ResourceId);
- string expr = _edsvc.EditExpression(txtFilter.Text, _cls, fs.Provider, vl.ResourceId, false);
+ string expr = _edsvc.EditExpression(txtFilter.Text, _cls, fs.Provider, vl.ResourceId, ExpressionEditorMode.Filter, false);
if (expr != null)
{
txtFilter.Text = expr;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryExpression.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryExpression.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -38,6 +38,11 @@
public class FdoBinaryExpression : FdoExpression
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.BinaryExpression; }
+ }
+
public FdoExpression Left { get; private set; }
public BinaryOperator Operator { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryLogicalOperator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryLogicalOperator.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoBinaryLogicalOperator.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -35,6 +35,11 @@
public class FdoBinaryLogicalOperator : FdoLogicalOperator
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.BinaryLogicalOperator; }
+ }
+
public FdoFilter Left { get; private set; }
public BinaryLogicalOperations Operator { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoComparisonCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoComparisonCondition.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoComparisonCondition.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -41,6 +41,11 @@
public class FdoComparisonCondition : FdoSearchCondition
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.ComparisonCondition; }
+ }
+
public FdoExpression Left { get; private set; }
public ComparisonOperations Operator { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDataValue.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDataValue.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDataValue.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -75,6 +75,11 @@
public class FdoStringValue : FdoDataValue
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.StringValue; }
+ }
+
public string Value { get; private set; }
internal FdoStringValue(ParseTreeNode node)
@@ -86,6 +91,11 @@
public class FdoInt32Value : FdoDataValue
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.Int32Value; }
+ }
+
public int Value { get; private set; }
internal FdoInt32Value(ParseTreeNode node)
@@ -107,6 +117,11 @@
public class FdoDoubleValue : FdoDataValue
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.DoubleValue; }
+ }
+
public double Value { get; private set; }
internal FdoDoubleValue(ParseTreeNode node)
@@ -128,6 +143,11 @@
public class FdoDateTimeValue : FdoDataValue
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.DateTimeValue; }
+ }
+
public DateTime? DateTime { get; private set; }
public TimeSpan? Time { get; private set; }
@@ -172,6 +192,11 @@
public class FdoBooleanValue : FdoDataValue
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.BooleanValue; }
+ }
+
public bool Value { get; private set; }
internal FdoBooleanValue(ParseTreeNode node)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDistanceCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDistanceCondition.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoDistanceCondition.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -36,6 +36,11 @@
public class FdoDistanceCondition : FdoGeometricCondition
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.DistanceCondition; }
+ }
+
public FdoIdentifier Identifier { get; private set; }
public DistanceOperations Operator { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoExpression.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoExpression.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -28,12 +28,30 @@
namespace OSGeo.MapGuide.MaestroAPI.Expressions
{
- public abstract class FdoExpression
+ public enum ExpressionType
{
+ UnaryExpression,
+ BinaryExpression,
+ Function,
+ Identifier,
+ Parameter,
+ GeometryValue,
+ BooleanValue,
+ StringValue,
+ Int32Value,
+ DoubleValue,
+ DateTimeValue
+ }
+
+ public abstract class FdoExpression : FdoParseable
+ {
+ public abstract ExpressionType ExpressionType { get; }
+
public static FdoExpression Parse(string str)
{
Parser p = new Parser(new FdoExpressionGrammar());
var tree = p.Parse(str);
+ CheckParserErrors(tree);
if (tree.Root.Term.Name == FdoTerminalNames.Expression)
{
var child = tree.Root.ChildNodes[0];
@@ -45,6 +63,22 @@
}
}
+ private static void CheckParserErrors(ParseTree tree)
+ {
+ if (tree.HasErrors())
+ {
+ List<string> errors = new List<string>();
+ foreach(var msg in tree.ParserMessages)
+ {
+ if (msg.Level == Irony.ErrorLevel.Error)
+ {
+ errors.Add(string.Format(Strings.ParserErrorMessage, msg.Location.ToUiString(), msg.Message));
+ }
+ }
+ throw new FdoParseException(string.Format(Strings.ExpressionParseError, Environment.NewLine, string.Join(Environment.NewLine, errors.ToArray())));
+ }
+ }
+
internal static FdoExpression ParseNode(ParseTreeNode child)
{
if (child.Term.Name == FdoTerminalNames.Expression)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFilter.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFilter.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFilter.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -28,12 +28,26 @@
namespace OSGeo.MapGuide.MaestroAPI.Expressions
{
- public abstract class FdoFilter
+ public enum FilterType
{
+ UnaryLogicalOperator,
+ NullCondition,
+ InCondition,
+ BinaryLogicalOperator,
+ DistanceCondition,
+ ComparisonCondition,
+ SpatialCondition
+ }
+
+ public abstract class FdoFilter : FdoParseable
+ {
+ public abstract FilterType FilterType { get; }
+
public static FdoFilter Parse(string str)
{
Parser p = new Parser(new FdoFilterGrammar());
var tree = p.Parse(str);
+ CheckParserErrors(tree);
if (tree.Root.Term.Name == FdoTerminalNames.Filter)
{
var child = tree.Root.ChildNodes[0];
@@ -45,6 +59,22 @@
}
}
+ private static void CheckParserErrors(ParseTree tree)
+ {
+ if (tree.HasErrors())
+ {
+ List<string> errors = new List<string>();
+ foreach (var msg in tree.ParserMessages)
+ {
+ if (msg.Level == Irony.ErrorLevel.Error)
+ {
+ errors.Add(string.Format(Strings.ParserErrorMessage, msg.Location.ToUiString(), msg.Message));
+ }
+ }
+ throw new FdoParseException(string.Format(Strings.FilterParseError, Environment.NewLine, string.Join(Environment.NewLine, errors.ToArray())));
+ }
+ }
+
internal static FdoFilter ParseNode(ParseTreeNode child)
{
if (child.Term.Name == FdoTerminalNames.Filter)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFunction.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFunction.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoFunction.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoFunction : FdoExpression
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.Function; }
+ }
+
public FdoIdentifier Identifier { get; private set; }
public List<FdoExpression> Arguments { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoGeometryValue.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoGeometryValue.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoGeometryValue.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoGeometryValue : FdoLiteralValue
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.GeometryValue; }
+ }
+
public string GeometryWkt { get; private set; }
internal FdoGeometryValue(ParseTreeNode node)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoIdentifier.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoIdentifier.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoIdentifier.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoIdentifier : FdoExpression
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.Identifier; }
+ }
+
public string Name { get; private set; }
internal FdoIdentifier(ParseTreeNode node)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoInCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoInCondition.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoInCondition.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoInCondition : FdoSearchCondition
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.InCondition; }
+ }
+
public FdoIdentifier Identifier { get; private set; }
public List<FdoValueExpression> ValueList { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoNullCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoNullCondition.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoNullCondition.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoNullCondition : FdoSearchCondition
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.NullCondition; }
+ }
+
public FdoIdentifier Identifier { get; private set; }
public FdoNullCondition(ParseTreeNode node)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParameter.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParameter.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParameter.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoParameter : FdoValueExpression
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.Parameter; }
+ }
+
public string Name { get; private set; }
internal FdoParameter(ParseTreeNode node)
Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParseable.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParseable.cs (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoParseable.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,33 @@
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#endregion Disclaimer / License
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OSGeo.MapGuide.MaestroAPI.Expressions
+{
+ public abstract class FdoParseable
+ {
+ }
+}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoSpatialCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoSpatialCondition.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoSpatialCondition.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -44,6 +44,11 @@
public class FdoSpatialCondition : FdoGeometricCondition
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.SpatialCondition; }
+ }
+
public FdoIdentifier Identifier { get; private set; }
public SpatialOperations Operator { get; private set; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryExpression.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryExpression.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoUnaryExpression : FdoExpression
{
+ public override ExpressionType ExpressionType
+ {
+ get { return Expressions.ExpressionType.UnaryExpression; }
+ }
+
public FdoExpression Expression { get; private set; }
internal FdoUnaryExpression(ParseTreeNode node)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryLogicalOperator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryLogicalOperator.cs 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/FdoUnaryLogicalOperator.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -30,6 +30,11 @@
{
public class FdoUnaryLogicalOperator : FdoLogicalOperator
{
+ public override FilterType FilterType
+ {
+ get { return Expressions.FilterType.UnaryLogicalOperator; }
+ }
+
public FdoFilter NegatedFilter { get; private set; }
public FdoUnaryLogicalOperator(ParseTreeNode node)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/OSGeo.MapGuide.MaestroAPI.Expressions.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/OSGeo.MapGuide.MaestroAPI.Expressions.csproj 2015-01-19 11:25:57 UTC (rev 8507)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/OSGeo.MapGuide.MaestroAPI.Expressions.csproj 2015-01-19 14:17:44 UTC (rev 8508)
@@ -73,6 +73,7 @@
<Compile Include="FdoLogicalOperator.cs" />
<Compile Include="FdoNullCondition.cs" />
<Compile Include="FdoParameter.cs" />
+ <Compile Include="FdoParseable.cs" />
<Compile Include="FdoParseException.cs" />
<Compile Include="FdoSearchCondition.cs" />
<Compile Include="FdoSpatialCondition.cs" />
@@ -81,10 +82,21 @@
<Compile Include="FdoUnaryLogicalOperator.cs" />
<Compile Include="FdoValueExpression.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Strings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Strings.resx</DependentUpon>
+ </Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Strings.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Strings.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.Designer.cs 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,90 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.34209
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OSGeo.MapGuide.MaestroAPI.Expressions {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Strings {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Strings() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OSGeo.MapGuide.MaestroAPI.Expressions.Strings", typeof(Strings).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Error Parsing Expression: {0}{1}.
+ /// </summary>
+ internal static string ExpressionParseError {
+ get {
+ return ResourceManager.GetString("ExpressionParseError", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Error Parsing Filter: {0}{1}.
+ /// </summary>
+ internal static string FilterParseError {
+ get {
+ return ResourceManager.GetString("FilterParseError", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to ({0}) - {1}.
+ /// </summary>
+ internal static string ParserErrorMessage {
+ get {
+ return ResourceManager.GetString("ParserErrorMessage", resourceCulture);
+ }
+ }
+ }
+}
Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.resx
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.resx (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Expressions/Strings.resx 2015-01-19 14:17:44 UTC (rev 8508)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="ExpressionParseError" xml:space="preserve">
+ <value>Error Parsing Expression: {0}{1}</value>
+ </data>
+ <data name="FilterParseError" xml:space="preserve">
+ <value>Error Parsing Filter: {0}{1}</value>
+ </data>
+ <data name="ParserErrorMessage" xml:space="preserve">
+ <value> ({0}) - {1}</value>
+ </data>
+</root>
\ No newline at end of file
More information about the mapguide-commits
mailing list