Catel.MVVM.Views.ViewToViewModelMappingHelper.TransferValue C# (CSharp) Метод

TransferValue() приватный статический Метод

Transfers a value from the source property to the target property.
This method does not check the type of the properties. If the types are incorrect, an exception will be thrown by the .NET Framework.
The is null. The is null. The is null or whitespace. The is null or whitespace.
private static TransferValue ( object source, string sourcePropertyName, object target, string targetPropertyName ) : void
source object The source.
sourcePropertyName string Name of the source property.
target object The target.
targetPropertyName string Name of the target property.
Результат void
        private static void TransferValue(object source, string sourcePropertyName, object target, string targetPropertyName)
        {
            Argument.IsNotNull("source", source);
            Argument.IsNotNull("target", target);
            Argument.IsNotNullOrWhitespace("sourcePropertyName", sourcePropertyName);
            Argument.IsNotNullOrWhitespace("targetPropertyName", targetPropertyName);

            object valueToTransfer = PropertyHelper.GetPropertyValue(source, sourcePropertyName, false);

            Log.Debug("Transferring value of {0}.{1} to {2}.{3}", source.GetType().Name, sourcePropertyName, target.GetType().Name, targetPropertyName);

            PropertyHelper.SetPropertyValue(target, targetPropertyName, valueToTransfer, false);
        }
        #endregion