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);
        }
Ejemplo n.º 2
0
 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 (FdoExpressionValidationException ex)
     {
         new ExpressionParseErrorDialog(ex, this).ShowDialog();
     }
     catch (FdoMalformedExpressionException ex)
     {
         new MalformedExpressionDialog(ex, this).ShowDialog();
     }
 }
        /// <summary>
        /// Validates the given FDO expression
        /// </summary>
        /// <param name="expr"></param>
        /// <param name="cls"></param>
        /// <param name="caps"></param>
        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 (!IsStylizationFunc(name) && !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;
            }
        }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
        protected string TryTranslateExpression(FdoExpression expr, string featureVar)
        {
            switch (expr)
            {
            case FdoIdentifier ident:
                return(TryTranslateIdentifier(ident, featureVar));

            case FdoStringValue strVal:
                return($"('{strVal.Value}')");

            case FdoInt32Value ival:
                return($"{ival.Value}");

            case FdoDoubleValue dval:
                return($"{dval.Value}");

            case FdoBooleanValue bval:
                return(bval.Value ? "true" : "false");
            }
            return(null);
        }
Ejemplo n.º 6
0
        private void DoFilteredCount(FdoIConnection conn)
        {
            FdoISelectAggregates selectCmd = conn.CreateCommand((int)FdoCommandType.FdoCommandType_SelectAggregates) as FdoISelectAggregates;

            Assert.NotNull(selectCmd);
            selectCmd.SetFeatureClassName("World_Countries");
            selectCmd.SetFilter("NAME = 'Canada'");

            FdoIdentifierCollection propNames  = selectCmd.GetPropertyNames();
            FdoExpression           countExpr  = FdoExpression.Parse("COUNT(NAME)");
            FdoComputedIdentifier   countIdent = FdoComputedIdentifier.Create("TOTAL_COUNT", countExpr);

            propNames.Add(countIdent);

            FdoIDataReader rdr   = selectCmd.Execute();
            long           total = 0;

            while (rdr.ReadNext())
            {
                total += rdr.GetInt64("TOTAL_COUNT");
            }
            rdr.Close();
            Assert.Equal(66L, total);

            //Re-test with sugar methods
            propNames.Clear();
            Assert.Equal(0, propNames.Count);
            propNames.AddComputedIdentifier("TOTAL_COUNT", "COUNT(NAME)");
            Assert.Equal(1, propNames.Count);

            rdr   = selectCmd.Execute();
            total = 0;
            while (rdr.ReadNext())
            {
                total += rdr.GetInt64("TOTAL_COUNT");
            }
            rdr.Close();
            Assert.Equal(66L, total);
        }
Ejemplo n.º 7
0
        private void DoFilteredSpatialExtents(FdoIConnection conn)
        {
            FdoIDescribeSchema desc = conn.CreateCommand((int)FdoCommandType.FdoCommandType_DescribeSchema) as FdoIDescribeSchema;

            Assert.NotNull(desc);
            FdoFeatureSchemaCollection schemas = desc.Execute();

            Assert.NotNull(schemas);
            Assert.Equal(1, schemas.Count);
            FdoFeatureSchema   schema   = schemas.GetItem(0);
            FdoClassCollection classes  = schema.GetClasses();
            string             geomName = null;

            for (int i = 0; i < classes.Count; i++)
            {
                FdoClassDefinition cls = classes.GetItem(i);
                if (cls.Name == "World_Countries")
                {
                    Assert.IsAssignableFrom <FdoFeatureClass>(cls);
                    FdoGeometricPropertyDefinition geomProp = ((FdoFeatureClass)cls).GetGeometryProperty();
                    Assert.NotNull(geomProp);
                    geomName = geomProp.Name;
                }
            }
            Assert.NotNull(geomName);

            FdoISelectAggregates selectCmd = conn.CreateCommand((int)FdoCommandType.FdoCommandType_SelectAggregates) as FdoISelectAggregates;

            Assert.NotNull(selectCmd);
            selectCmd.SetFeatureClassName("World_Countries");
            selectCmd.SetFilter("NAME = 'Canada'");

            FdoIdentifierCollection propNames  = selectCmd.GetPropertyNames();
            FdoExpression           countExpr  = FdoExpression.Parse("SpatialExtents(" + geomName + ")");
            FdoComputedIdentifier   countIdent = FdoComputedIdentifier.Create("EXTENTS", countExpr);

            propNames.Add(countIdent);

            FdoIDataReader        rdr         = selectCmd.Execute();
            FdoFgfGeometryFactory geomFactory = FdoFgfGeometryFactory.GetInstance();
            int iterations = 0;

            while (rdr.ReadNext())
            {
                Assert.False(rdr.IsNull("EXTENTS"));
                Assert.Equal(FdoPropertyType.FdoPropertyType_GeometricProperty, rdr.GetPropertyType("EXTENTS"));

                FdoByteArrayHandle bytes = rdr.GetGeometryBytes("EXTENTS");
                Assert.NotNull(bytes);
                FdoIGeometry geom = geomFactory.CreateGeometryFromFgf(bytes);
                Assert.NotNull(geom);
                string wkt = geom.Text;
                Assert.NotNull(wkt);
                System.Diagnostics.Debug.WriteLine(string.Format("SpatialExtents() - {0}", wkt));
                iterations++;
            }
            rdr.Close();
            Assert.Equal(1, iterations);

            //Re-test with sugar methods
            propNames.Clear();
            Assert.Equal(0, propNames.Count);
            propNames.AddComputedIdentifier("EXTENTS", "SpatialExtents(" + geomName + ")");
            Assert.Equal(1, propNames.Count);

            rdr        = selectCmd.Execute();
            iterations = 0;
            while (rdr.ReadNext())
            {
                Assert.False(rdr.IsNull("EXTENTS"));
                Assert.Equal(FdoPropertyType.FdoPropertyType_GeometricProperty, rdr.GetPropertyType("EXTENTS"));

                FdoByteArrayHandle bytes = rdr.GetGeometryBytes("EXTENTS");
                Assert.NotNull(bytes);
                FdoIGeometry geom = geomFactory.CreateGeometryFromFgf(bytes);
                Assert.NotNull(geom);
                string wkt = geom.Text;
                Assert.NotNull(wkt);
                System.Diagnostics.Debug.WriteLine(string.Format("SpatialExtents() - {0}", wkt));
                iterations++;
            }
            rdr.Close();
            Assert.Equal(1, iterations);
        }
Ejemplo n.º 8
0
        private async Task WritePopupConfigurationAsync(IVectorLayerDefinition vl, int layerNumber, string name, StreamWriter sw)
        {
            await sw.WriteLineAsync($"//{_options.Viewer} popup template configuration for: {name}");

            if (vl.PropertyMapping.Any())
            {
                switch (_options.Viewer)
                {
                case ViewerType.Leaflet:
                {
                    await sw.WriteLineAsync($"var {GetVariableName(layerNumber)}_popup_template = function(feature, layer) {{");

                    await sw.WriteLineAsync("    var html = '<h3>" + name + "</h3><table>';");

                    await sw.WriteLineAsync("    html += '<tbody>';");

                    foreach (var pm in vl.PropertyMapping)
                    {
                        await sw.WriteLineAsync("    html += '<tr>';");

                        await sw.WriteLineAsync("    html += '<td>';");

                        await sw.WriteLineAsync("    html += '" + pm.Value + "';");

                        await sw.WriteLineAsync("    html += '</td>';");

                        await sw.WriteLineAsync("    html += '<td>';");

                        await sw.WriteLineAsync("    html += feature.properties." + pm.Name + " || '';");

                        await sw.WriteLineAsync("    html += '</td>';");

                        await sw.WriteLineAsync("    html += '</tr>';");
                    }
                    await sw.WriteLineAsync("    html += '</tbody>';");

                    await sw.WriteLineAsync("    html += '</table>';");

                    if (!string.IsNullOrEmpty(vl.Url))
                    {
                        try
                        {
                            //Only supports property references in the URL
                            var expr = FdoExpression.Parse(vl.Url);
                            if (expr is FdoIdentifier ident)
                            {
                                await sw.WriteLineAsync($"    if (feature.properties.{ident.Name}) {{");

                                await sw.WriteLineAsync($"        html += \"<hr /><a href='\" + feature.properties.{ident.Name} + \"' target='_blank'>Open Link</a>\"");

                                await sw.WriteLineAsync("    }");
                            }
                        }
                        catch { }
                    }
                    await sw.WriteLineAsync("    layer.bindPopup(html);");

                    await sw.WriteLineAsync("}");
                }
                break;

                case ViewerType.OpenLayers:
                {
                    await sw.WriteLineAsync($"var {GetVariableName(layerNumber)}_popup_template = function (feature) {{");

                    await sw.WriteLineAsync("    var html = '<h3>" + name + "</h3><table>';");

                    await sw.WriteLineAsync("    html += '<tbody>';");

                    foreach (var pm in vl.PropertyMapping)
                    {
                        await sw.WriteLineAsync("    html += '<tr>';");

                        await sw.WriteLineAsync("    html += '<td>';");

                        await sw.WriteLineAsync("    html += '" + pm.Value + "';");

                        await sw.WriteLineAsync("    html += '</td>';");

                        await sw.WriteLineAsync("    html += '<td>';");

                        await sw.WriteLineAsync("    html += feature.get('" + pm.Name + "') || '';");

                        await sw.WriteLineAsync("    html += '</td>';");

                        await sw.WriteLineAsync("    html += '</tr>';");
                    }
                    await sw.WriteLineAsync("    html += '</tbody>';");

                    await sw.WriteLineAsync("    html += '</table>';");

                    if (!string.IsNullOrEmpty(vl.Url))
                    {
                        try
                        {
                            //Only supports property references in the URL
                            var expr = FdoExpression.Parse(vl.Url);
                            if (expr is FdoIdentifier ident)
                            {
                                await sw.WriteLineAsync($"    if (feature.get('{ident.Name}')) {{");

                                await sw.WriteLineAsync($"        html += \"<hr /><a href='\" + feature.get('{ident.Name}') + \"' target='_blank'>Open Link</a>\"");

                                await sw.WriteLineAsync("    }");
                            }
                        }
                        catch { }
                    }
                    await sw.WriteLineAsync("    return html;");

                    await sw.WriteLineAsync("}");
                }
                break;
                }
            }
            else
            {
                switch (_options.Viewer)
                {
                case ViewerType.Leaflet:
                {
                    await sw.WriteLineAsync($"var {GetVariableName(layerNumber)}_popup_template = function(feature, layer) {{ }}");
                }
                break;

                case ViewerType.OpenLayers:
                {
                    await sw.WriteLineAsync($"var {GetVariableName(layerNumber)}_popup_template = null;");
                }
                break;
                }
            }
        }
        public void TestExpressionParse()
        {
            FdoExpression expr = null;

            expr = FdoExpression.Parse("RNAME");
            Assert.IsAssignableFrom <FdoIdentifier>(expr);
            Assert.Equal("RNAME", ((FdoIdentifier)expr).Name);

            expr = FdoExpression.Parse("TRUE");
            Assert.IsAssignableFrom <FdoBooleanValue>(expr);

            expr = FdoExpression.Parse("FALSE");
            Assert.IsAssignableFrom <FdoBooleanValue>(expr);

            expr = FdoExpression.Parse(":Foo");
            Assert.IsAssignableFrom <FdoParameter>(expr);
            Assert.Equal("Foo", ((FdoParameter)expr).Name);

            expr = FdoExpression.Parse(":Foo_bar");
            Assert.Equal("Foo_bar", ((FdoParameter)expr).Name);
            Assert.IsAssignableFrom <FdoParameter>(expr);

            expr = FdoExpression.Parse("1");
            Assert.IsAssignableFrom <FdoInt32Value>(expr);
            Assert.Equal(1, ((FdoInt32Value)expr).Value);

            expr = FdoExpression.Parse("-1");
            Assert.IsAssignableFrom <FdoInt32Value>(expr);
            Assert.Equal(-1, ((FdoInt32Value)expr).Value);

            expr = FdoExpression.Parse("1 + 2.2");
            Assert.IsAssignableFrom <FdoBinaryExpression>(expr);
            Assert.IsAssignableFrom <FdoInt32Value>(((FdoBinaryExpression)expr).Left);
            Assert.Equal(BinaryOperator.Add, ((FdoBinaryExpression)expr).Operator);
            Assert.IsAssignableFrom <FdoDoubleValue>(((FdoBinaryExpression)expr).Right);

            expr = FdoExpression.Parse("1 * 2.2");
            Assert.IsAssignableFrom <FdoBinaryExpression>(expr);
            Assert.IsAssignableFrom <FdoInt32Value>(((FdoBinaryExpression)expr).Left);
            Assert.Equal(BinaryOperator.Multiply, ((FdoBinaryExpression)expr).Operator);
            Assert.IsAssignableFrom <FdoDoubleValue>(((FdoBinaryExpression)expr).Right);

            expr = FdoExpression.Parse("1 / 2.2");
            Assert.IsAssignableFrom <FdoBinaryExpression>(expr);
            Assert.IsAssignableFrom <FdoInt32Value>(((FdoBinaryExpression)expr).Left);
            Assert.Equal(BinaryOperator.Divide, ((FdoBinaryExpression)expr).Operator);
            Assert.IsAssignableFrom <FdoDoubleValue>(((FdoBinaryExpression)expr).Right);

            expr = FdoExpression.Parse("1 - 2.2");
            Assert.IsAssignableFrom <FdoBinaryExpression>(expr);
            Assert.IsAssignableFrom <FdoInt32Value>(((FdoBinaryExpression)expr).Left);
            Assert.Equal(BinaryOperator.Subtract, ((FdoBinaryExpression)expr).Operator);
            Assert.IsAssignableFrom <FdoDoubleValue>(((FdoBinaryExpression)expr).Right);

            expr = FdoExpression.Parse("GeomFromText('POINT (1 1)')");
            Assert.IsAssignableFrom <FdoGeometryValue>(expr);
            Assert.Equal("POINT (1 1)", ((FdoGeometryValue)expr).GeometryWkt);

            expr = FdoExpression.Parse("DATE '1971-12-24'");
            Assert.IsAssignableFrom <FdoDateTimeValue>(expr);
            Assert.True(((FdoDateTimeValue)expr).DateTime.HasValue);
            Assert.False(((FdoDateTimeValue)expr).Time.HasValue);
            Assert.Equal(1971, ((FdoDateTimeValue)expr).DateTime.Value.Year);
            Assert.Equal(12, ((FdoDateTimeValue)expr).DateTime.Value.Month);
            Assert.Equal(24, ((FdoDateTimeValue)expr).DateTime.Value.Day);

            expr = FdoExpression.Parse("TIME '11:23:43'");
            Assert.IsAssignableFrom <FdoDateTimeValue>(expr);
            Assert.False(((FdoDateTimeValue)expr).DateTime.HasValue);
            Assert.True(((FdoDateTimeValue)expr).Time.HasValue);
            Assert.Equal(11, ((FdoDateTimeValue)expr).Time.Value.Hours);
            Assert.Equal(23, ((FdoDateTimeValue)expr).Time.Value.Minutes);
            Assert.Equal(43, ((FdoDateTimeValue)expr).Time.Value.Seconds);

            expr = FdoExpression.Parse("TIME '11:23:43.123'");
            Assert.IsAssignableFrom <FdoDateTimeValue>(expr);
            Assert.False(((FdoDateTimeValue)expr).DateTime.HasValue);
            Assert.True(((FdoDateTimeValue)expr).Time.HasValue);
            Assert.Equal(11, ((FdoDateTimeValue)expr).Time.Value.Hours);
            Assert.Equal(23, ((FdoDateTimeValue)expr).Time.Value.Minutes);
            Assert.Equal(43, ((FdoDateTimeValue)expr).Time.Value.Seconds);
            Assert.Equal(123, ((FdoDateTimeValue)expr).Time.Value.Milliseconds);

            expr = FdoExpression.Parse("TIMESTAMP '2003-10-23 11:00:02'");
            Assert.IsAssignableFrom <FdoDateTimeValue>(expr);
            Assert.True(((FdoDateTimeValue)expr).DateTime.HasValue);
            Assert.False(((FdoDateTimeValue)expr).Time.HasValue);
            Assert.Equal(2003, ((FdoDateTimeValue)expr).DateTime.Value.Year);
            Assert.Equal(10, ((FdoDateTimeValue)expr).DateTime.Value.Month);
            Assert.Equal(23, ((FdoDateTimeValue)expr).DateTime.Value.Day);
            Assert.Equal(11, ((FdoDateTimeValue)expr).DateTime.Value.Hour);
            Assert.Equal(00, ((FdoDateTimeValue)expr).DateTime.Value.Minute);
            Assert.Equal(02, ((FdoDateTimeValue)expr).DateTime.Value.Second);

            expr = FdoExpression.Parse("TIMESTAMP '2003-10-23 11:00:02.123'");
            Assert.IsAssignableFrom <FdoDateTimeValue>(expr);
            Assert.True(((FdoDateTimeValue)expr).DateTime.HasValue);
            Assert.False(((FdoDateTimeValue)expr).Time.HasValue);
            Assert.Equal(2003, ((FdoDateTimeValue)expr).DateTime.Value.Year);
            Assert.Equal(10, ((FdoDateTimeValue)expr).DateTime.Value.Month);
            Assert.Equal(23, ((FdoDateTimeValue)expr).DateTime.Value.Day);
            Assert.Equal(11, ((FdoDateTimeValue)expr).DateTime.Value.Hour);
            Assert.Equal(00, ((FdoDateTimeValue)expr).DateTime.Value.Minute);
            Assert.Equal(02, ((FdoDateTimeValue)expr).DateTime.Value.Second);
            Assert.Equal(123, ((FdoDateTimeValue)expr).DateTime.Value.Millisecond);

            expr = FdoExpression.Parse("CurrentDate()");
            Assert.IsAssignableFrom <FdoFunction>(expr);
            Assert.Equal("CurrentDate", ((FdoFunction)expr).Identifier.Name);
            Assert.Empty(((FdoFunction)expr).Arguments);

            expr = FdoExpression.Parse("Concat(RNAME, ' ', RBILAD)");
            Assert.IsAssignableFrom <FdoFunction>(expr);
            Assert.Equal("Concat", ((FdoFunction)expr).Identifier.Name);
            Assert.Equal(3, ((FdoFunction)expr).Arguments.Count);
            Assert.IsAssignableFrom <FdoIdentifier>(((FdoFunction)expr).Arguments[0]);
            Assert.IsAssignableFrom <FdoStringValue>(((FdoFunction)expr).Arguments[1]);
            Assert.IsAssignableFrom <FdoIdentifier>(((FdoFunction)expr).Arguments[2]);

            expr = FdoExpression.Parse("-UnixTime()");
            Assert.IsAssignableFrom <FdoUnaryExpression>(expr);
        }
Ejemplo n.º 10
0
        private static void ParseExpression(string exprText, string exprResult = null, FdoExpressionItemType?expectedType = null)
        {
            FdoExpression expr = FdoExpression.Parse(exprText);

            Assert.NotNull(expr);

            string exprStr = expr.ToString();

            Assert.NotNull(exprStr);

            if (exprResult != null)
            {
                Assert.Equal(exprResult, exprStr);
            }
            else
            {
                Assert.Equal(exprText, exprStr);
            }

            if (expectedType.HasValue)
            {
                Assert.Equal(expectedType.Value, expr.ExpressionType);
                switch (expectedType.Value)
                {
                case FdoExpressionItemType.FdoExpressionItemType_BinaryExpression:
                    Assert.IsAssignableFrom <FdoBinaryExpression>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_ComputedIdentifier:
                    Assert.IsAssignableFrom <FdoComputedIdentifier>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_DataValue:
                    Assert.IsAssignableFrom <FdoDataValue>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_Function:
                    Assert.IsAssignableFrom <FdoFunction>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_GeometryValue:
                    Assert.IsAssignableFrom <FdoGeometryValue>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_Identifier:
                    Assert.IsAssignableFrom <FdoIdentifier>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_Parameter:
                    Assert.IsAssignableFrom <FdoParameter>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_SubSelectExpression:
                    Assert.IsAssignableFrom <FdoSubSelectExpression>(expr);
                    break;

                case FdoExpressionItemType.FdoExpressionItemType_UnaryExpression:
                    Assert.IsAssignableFrom <FdoUnaryExpression>(expr);
                    break;
                }
            }
        }