Пример #1
0
 private void ThrowExceptionIfInvalidDuplicateFieldMapValue(FieldMapPair fieldMapPair)
 {
     if (SyncDirection.HasValue)
     {
         if (SyncDirection.Value == Core.SyncDirection.SourceToTarget)
         {
             if (SourceValueIsDuplicate(fieldMapPair))
             {
                 throw new Exception(string.Format("Source value '{0}' can not be duplicated within a one-way field map.",
                                                   fieldMapPair.SourceValue == null ? "null" : fieldMapPair.SourceValue));
             }
         }
         else if (SyncDirection.Value == Core.SyncDirection.TargetToSource)
         {
             if (TargetValueIsDuplicate(fieldMapPair))
             {
                 throw new Exception(string.Format("Target value '{0}' can not be duplicated within a one-way field map.",
                                                   fieldMapPair.TargetValue == null ? "null" : fieldMapPair.TargetValue));
             }
         }
         else
         {
             throw new EnumValueNotImplementedException <SyncDirection>(SyncDirection.Value);
         }
     }
 }
Пример #2
0
        public new void AddMap(FieldMapPair fieldMapPair)
        {
            if (SourceValueIsDuplicate(fieldMapPair))
            {
                throw new Exception(string.Format("Source value '{0}' can not be duplicated within a two-way field map.",
                                                  fieldMapPair.SourceValue == null ? "null" : fieldMapPair.SourceValue));
            }

            if (TargetValueIsDuplicate(fieldMapPair))
            {
                throw new Exception(string.Format("Target value '{0}' can not be duplicated within a two-way field map.",
                                                  fieldMapPair.TargetValue == null ? "null" : fieldMapPair.TargetValue));
            }

            base.AddMap(fieldMapPair);
        }
Пример #3
0
 public bool SourceValueIsDuplicate(FieldMapPair fieldMapPair)
 {
     return(SourceValueIsDuplicate(fieldMapPair.SourceValue));
 }
Пример #4
0
 protected void AddMap(FieldMapPair fieldMapPair)
 {
     _maps.Add(fieldMapPair);
 }
Пример #5
0
 public bool TargetValueIsDuplicate(FieldMapPair fieldMapPair)
 {
     return(TargetValueIsDuplicate(fieldMapPair.TargetValue));
 }
Пример #6
0
        public new void AddMap(FieldMapPair fieldMapPair)
        {
            ThrowExceptionIfInvalidDuplicateFieldMapValue(fieldMapPair);

            base.AddMap(fieldMapPair);
        }