public void Init(string initSchema, string initClass) { List <QueryMode> modes = new List <QueryMode>(); if (!string.IsNullOrEmpty(initSchema) && !string.IsNullOrEmpty(initClass)) { if (_service.SupportsCommand(OSGeo.FDO.Commands.CommandType.CommandType_Select)) { using (FdoFeatureService service = _connection.CreateFeatureService()) { ClassDefinition classDef = service.GetClassByName(initSchema, initClass); if (!ExpressUtility.HasRaster(classDef)) { modes.Add(QueryMode.Standard); _queryViews.Add(QueryMode.Standard, new FdoStandardQueryCtl(_connection, initSchema, initClass)); } } } if (_service.SupportsCommand(OSGeo.FDO.Commands.CommandType.CommandType_SelectAggregates)) { modes.Add(QueryMode.Aggregate); _queryViews.Add(QueryMode.Aggregate, new FdoAggregateQueryCtl(_connection, initSchema, initClass)); } } else { if (_service.SupportsCommand(OSGeo.FDO.Commands.CommandType.CommandType_Select)) { modes.Add(QueryMode.Standard); _queryViews.Add(QueryMode.Standard, new FdoStandardQueryCtl(_connection)); } if (_service.SupportsCommand(OSGeo.FDO.Commands.CommandType.CommandType_SelectAggregates)) { modes.Add(QueryMode.Aggregate); _queryViews.Add(QueryMode.Aggregate, new FdoAggregateQueryCtl(_connection)); } } if (_service.SupportsCommand(OSGeo.FDO.Commands.CommandType.CommandType_SQLCommand)) { modes.Add(QueryMode.SQL); _queryViews.Add(QueryMode.SQL, new FdoSqlQueryCtl()); } foreach (IQuerySubView qv in _queryViews.Values) { qv.MapPreviewStateChanged += new MapPreviewStateEventHandler(OnMapPreviewStateChanged); qv.SetRestrictions(_connection.Capability); } _view.QueryModes = modes; _view.InsertEnabled = (_view.SelectedQueryMode != QueryMode.SQL) && insertSupported; }