Пример #1
0
            public FieldSelection(CommonLayer layer, string fields)
            {
                if (String.IsNullOrEmpty(fields))
                {
                    fields = "#";
                }

                if (fields == "*" || fields == "#")
                {
                    foreach (CommonField field in layer.Fields)
                    {
                        if (fields == "*" || field.Type != CommonFieldType.Geometry)
                        {
                            _fields.Add(field);
                            _useAlias.Add(!String.IsNullOrEmpty(field.Alias));
                        }
                    }
                }
                else
                {
                    List <String> fieldNames = new List <String>(fields.Split(new char[] { ',' }));

                    foreach (string fieldName in fieldNames)
                    {
                        string      trimmedFieldName = fieldName.Trim();
                        CommonField field            = layer.Fields.FirstOrDefault(f => String.Compare(trimmedFieldName, f.Name, true) == 0 || String.Compare(trimmedFieldName, f.Alias, true) == 0);

                        if (field == null)
                        {
                            throw new Exception(String.Format("The field '{0}' is not present in layer '{1}'", trimmedFieldName, layer.Name));
                        }

                        _fields.Add(field);
                        _useAlias.Add(String.Compare(fieldName, field.Alias, true) == 0);
                    }
                }
            }
Пример #2
0
 public abstract void AddLayer(CommonLayer layer, string definitionQuery);
Пример #3
0
 public abstract void AddLayerAndChildren(CommonLayer layer);
Пример #4
0
 public abstract void AddLayer(CommonLayer layer);