Ejemplo n.º 1
0
        /// <summary>
        /// Removes the rule by meta field.
        /// </summary>
        /// <param name="metaFieldName">Name of the meta field.</param>
        public void RemoveRuleByMetaField(string metaFieldName)
        {
            if (metaFieldName == null)
            {
                throw new ArgumentNullException("metaFieldName");
            }

            if (this.MappingDocument.Count == 0)
            {
                return;
            }

            MappingElement mapping = this.MappingDocument[0];

            foreach (MappingRule map in mapping)
            {
                if (map.FieldName == metaFieldName)
                {
                    mapping.Remove(map);
                    return;
                }
            }

            return;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes the rule by column.
        /// </summary>
        /// <param name="columnName">Name of the column.</param>
        public void RemoveRuleByColumn(string columnName)
        {
            if (columnName == null)
            {
                throw new ArgumentNullException("columnName");
            }

            if (this.MappingDocument.Count == 0)
            {
                return;
            }

            MappingElement mapping = this.MappingDocument[0];

            foreach (MappingRule map in mapping)
            {
                if (map.ColumnName == columnName)
                {
                    mapping.Remove(map);
                    return;
                }
            }

            return;
        }