Exemple #1
0
 private static IEnumerable <int> GetFieldIndices(
     [NotNull] ITable table,
     [NotNull] IEnumerable <string> fieldNames,
     FieldListType fieldListType)
 {
     return(GetRelevantNames(table, fieldNames, fieldListType)
            .Select(table.FindField)
            .Where(index => index >= 0));
 }
 public QaNeighbourAreas(
     [Doc(nameof(DocStrings.QaNeighbourAreas_polygonClass))][NotNull]
     IFeatureClass polygonClass,
     [Doc(nameof(DocStrings.QaNeighbourAreas_allowPointIntersection))]
     bool allowPointIntersection,
     [Doc(nameof(DocStrings.QaNeighbourAreas_fieldsString))][CanBeNull]
     string fieldsString,
     [Doc(nameof(DocStrings.QaNeighbourAreas_fieldListType))]
     FieldListType fieldListType)
     : this(polygonClass, allowPointIntersection,
            TestUtils.GetTokens(fieldsString),
            fieldListType)
 {
 }
 public QaTrimmedTextFields(
     [Doc(nameof(DocStrings.QaTrimmedTextFields_table))][NotNull]
     ITable table,
     [Doc(nameof(DocStrings.QaTrimmedTextFields_allowedWhiteSpaceOnlyCount))]
     int
     allowedWhiteSpaceOnlyCount,
     [Doc(nameof(DocStrings.QaTrimmedTextFields_textFieldNamesString))][CanBeNull]
     string
     textFieldNamesString,
     [Doc(nameof(DocStrings.QaTrimmedTextFields_fieldListType))]
     FieldListType fieldListType)
     : this(table, allowedWhiteSpaceOnlyCount,
            TestUtils.GetTokens(textFieldNamesString),
            fieldListType)
 {
 }
        private static IEnumerable <int> GetCompareFieldIndexes(
            [NotNull] IObjectClass objectClass,
            [NotNull] IEnumerable <string> fieldNames,
            FieldListType fieldListType)
        {
            switch (fieldListType)
            {
            case FieldListType.RelevantFields:
                return(GetCompareFieldIndexes(objectClass, fieldNames));

            case FieldListType.IgnoredFields:
                return(GetCompareFieldIndexesFromIgnoredFieldNames(objectClass, fieldNames));

            default:
                throw new ArgumentOutOfRangeException(
                          string.Format("Unsupported field list type: {0}", fieldListType));
            }
        }
        private static IEnumerable <int> GetFieldIndices(
            [NotNull] ITable table,
            [NotNull] IEnumerable <string> textFieldNames,
            FieldListType fieldListType)
        {
            switch (fieldListType)
            {
            case FieldListType.IgnoredFields:
                return(GetFieldIndicesFromIgnoredFieldNames(table, textFieldNames));

            case FieldListType.RelevantFields:
                return(GetFieldIndicesFromRelevantFieldNames(table, textFieldNames));

            default:
                throw new ArgumentOutOfRangeException(
                          nameof(fieldListType), fieldListType,
                          string.Format("Unsupported field list type: {0}", fieldListType));
            }
        }
        public QaNeighbourAreas(
            [Doc(nameof(DocStrings.QaNeighbourAreas_polygonClass))][NotNull]
            IFeatureClass polygonClass,
            [Doc(nameof(DocStrings.QaNeighbourAreas_allowPointIntersection))]
            bool allowPointIntersection,
            [Doc(nameof(DocStrings.QaNeighbourAreas_fields))][NotNull]
            IEnumerable <string> fields,
            [Doc(nameof(DocStrings.QaNeighbourAreas_fieldListType))]
            FieldListType fieldListType)
            : base((ITable)polygonClass)
        {
            Assert.ArgumentNotNull(polygonClass, nameof(polygonClass));
            Assert.ArgumentNotNull(fields, nameof(fields));

            _polygonClass           = polygonClass;
            _allowPointIntersection = allowPointIntersection;

            _compareFieldIndexes = new List <int>(
                GetCompareFieldIndexes(polygonClass, fields, fieldListType));
        }
        public QaTrimmedTextFields(
            [Doc(nameof(DocStrings.QaTrimmedTextFields_table))][NotNull]
            ITable table,
            [Doc(nameof(DocStrings.QaTrimmedTextFields_allowedWhiteSpaceOnlyCount))]
            int
            allowedWhiteSpaceOnlyCount,
            [Doc(nameof(DocStrings.QaTrimmedTextFields_textFieldNames))][NotNull]
            IEnumerable <string>
            textFieldNames,
            [Doc(nameof(DocStrings.QaTrimmedTextFields_fieldListType))]
            FieldListType fieldListType)
            : base(table)
        {
            Assert.ArgumentNotNull(textFieldNames, nameof(textFieldNames));

            _allowedWhiteSpaceOnlyCount = allowedWhiteSpaceOnlyCount;

            _textFieldIndices = new List <int>(
                GetFieldIndices(table, textFieldNames, fieldListType));
        }
Exemple #8
0
        private static IEnumerable <string> GetRelevantNames(
            [NotNull] ITable table,
            [NotNull] IEnumerable <string> fieldNames,
            FieldListType fieldListType)
        {
            if (fieldListType == FieldListType.RelevantFields)
            {
                return(fieldNames);
            }

            var excludedNames = new HashSet <string>(
                fieldNames.Where(name => name != null)
                .Select(name => name.Trim()),
                StringComparer.OrdinalIgnoreCase);

            return(DatasetUtils.GetFields(table)
                   .Where(f => f.Type == esriFieldType.esriFieldTypeString &&
                          f.Editable)
                   .Select(f => f.Name)
                   .Where(name => !excludedNames.Contains(name)));
        }
 public SetNotifyKeyField(FieldListType type, string fieldName)
     : this(type, fieldName, false)
 {
 }
Exemple #10
0
 /// <summary>
 /// Initialises a new instance of the class.
 /// </summary>
 public FieldList()
 {
     Type = FieldListType.None;
 }
 public SetDataField(FieldListType type, string fieldName)
     : this(type, fieldName, false)
 {
 }
Exemple #12
0
 public FieldList(IEnumerable <object> items)
 {
     Type   = FieldListType.None;
     _items = new List <object>(items);
 }
 public SetNotifyKeyField(FieldListType type, string fieldName, bool cacheRawMessage)
     : base(COMMAND, MessageType.Command, cacheRawMessage, ((char)type).ToString(), fieldName)
 {
 }
Exemple #14
0
 public ISingleLineTextFieldDefinition CreateSingleLineTextFieldDefinition(string xmlElementName, string label, int minOccurs = 0, int? maxOccurs = 1, int minLength = 0, int? maxLength = default(int?), string pattern = null, FieldListType listType = FieldListType.Select, int listHeight = 1, string customUrl = null)
 {
     throw new NotImplementedException();
 }
Exemple #15
0
 public INumberFieldDefinition CreateNumberFieldDefinition(string xmlElementName, string label, int minOccurs = 0, int? maxOccurs = 1, double? minValue = default(double?), bool isMinValueExclusive = false, double? maxValue = default(double?), bool isMaxValueExclusive = false, int? totalDigits = default(int?), int? fractionDigits = 0, string pattern = null, FieldListType listType = FieldListType.Select, int listHeight = 1, string customUrl = null)
 {
     throw new NotImplementedException();
 }
Exemple #16
0
 public IDateFieldDefinition CreateDateFieldDefinition(string xmlElementName, string label, int minOccurs = 0, int? maxOccurs = 1, DateTime? minValue = default(DateTime?), bool isMinValueExclusive = false, DateTime? maxValue = default(DateTime?), bool isMaxValueExclusive = false, string pattern = null, FieldListType listType = FieldListType.Select, int listHeight = 1, string customUrl = null)
 {
     throw new NotImplementedException();
 }
 public void SetNotifyKeyField(FieldListType type, string fieldName)
 {
     _client.Send(new SetNotifyKeyField(type, fieldName));
 }