private void LogTransfer([CanBeNull] object sourceValue, FieldValueTransferLogLevel logLevel) { string formattedValue = GetFormattedValue(sourceValue); string message = string.Format("Transferring value from field '{0}' to field '{1}': {2}", SourceFieldName, TargetFieldName, formattedValue); switch (logLevel) { case FieldValueTransferLogLevel.Debug: _msg.Debug(message); break; case FieldValueTransferLogLevel.VerboseDebug: _msg.VerboseDebug(message); break; case FieldValueTransferLogLevel.Info: _msg.Info(message); break; default: throw new ArgumentOutOfRangeException(nameof(logLevel)); } }
public void TransferValue( [NotNull] IFeature sourceFeature, [NotNull] IFeature targetFeature, FieldValueTransferLogLevel logLevel = FieldValueTransferLogLevel.Debug) { Assert.ArgumentNotNull(sourceFeature, nameof(sourceFeature)); Assert.ArgumentNotNull(targetFeature, nameof(targetFeature)); object sourceValue = sourceFeature.Value[_sourceFieldIndex]; LogTransfer(sourceValue, logLevel); object targetValue = FieldUtils.ConvertAttributeValue( sourceValue, SourceFieldType, TargetFieldType); targetFeature.set_Value(TargetFieldIndex, targetValue); }