コード例 #1
0
            public DomainConstraint GetConstraint([NotNull] IAttributeRule attributeRule)
            {
                DomainConstraint result;

                if (!_domainConstraints.TryGetValue(attributeRule.DomainName,
                                                    out result))
                {
                    IDomain domain = _domains.DomainByName[attributeRule.DomainName];

                    result = GetDomainConstraint(domain,
                                                 _allowNullForCodedValueDomains,
                                                 _allowNullForRangeDomains);
                    _domainConstraints.Add(attributeRule.DomainName, result);
                }

                return(result);
            }
コード例 #2
0
        private static IField TryGetField([NotNull] ITable table,
                                          [NotNull] IAttributeRule attributeRule)
        {
            string fieldName = attributeRule.FieldName;

            int fieldIndex = table.FindField(fieldName);

            if (fieldIndex < 0)
            {
                // TODO revise; mismatch risk
                fieldIndex = table.Fields.FindFieldByAliasName(fieldName);
            }

            return(fieldIndex < 0
                                       ? null
                                       : table.Fields.Field[fieldIndex]);
        }