Beispiel #1
0
        internal void Initialize(
            EmitMapperManager MapperMannager,
            Type TypeFrom,
            Type TypeTo,
            IMappingConfigurator mappingConfigurator,
            object[] stroredObjects)
        {
            mapperMannager       = MapperMannager;
            typeFrom             = TypeFrom;
            typeTo               = TypeTo;
            _mappingConfigurator = mappingConfigurator;
            StroredObjects       = stroredObjects;
            if (_mappingConfigurator != null)
            {
                _rootOperation = _mappingConfigurator.GetRootMappingOperation(TypeFrom, TypeTo);
                if (_rootOperation == null)
                {
                    _rootOperation = new RootMappingOperation(TypeFrom, TypeTo);
                }
                var constructor = _rootOperation.TargetConstructor;
                if (constructor != null)
                {
                    _targetConstructor = (DelegateInvokerFunc_0)DelegateInvoker.GetDelegateInvoker(constructor);
                }

                var valuesPostProcessor = _rootOperation.ValuesPostProcessor;
                if (valuesPostProcessor != null)
                {
                    _valuesPostProcessor = (DelegateInvokerFunc_2)DelegateInvoker.GetDelegateInvoker(valuesPostProcessor);
                }

                var converter = _rootOperation.Converter;
                if (converter != null)
                {
                    _converter = (DelegateInvokerFunc_2)DelegateInvoker.GetDelegateInvoker(converter);
                }

                var nullSubstitutor = _rootOperation.NullSubstitutor;
                if (nullSubstitutor != null)
                {
                    _nullSubstitutor = (DelegateInvokerFunc_0)DelegateInvoker.GetDelegateInvoker(nullSubstitutor);
                }

                var sourceFilter = _rootOperation.SourceFilter;
                if (sourceFilter != null)
                {
                    _sourceFilter = (DelegateInvokerFunc_2)DelegateInvoker.GetDelegateInvoker(sourceFilter);
                }

                var destinationFilter = _rootOperation.DestinationFilter;
                if (destinationFilter != null)
                {
                    _destinationFilter = (DelegateInvokerFunc_2)DelegateInvoker.GetDelegateInvoker(destinationFilter);
                }
            }
        }
Beispiel #2
0
 public MappingOperationsProcessor(MappingOperationsProcessor prototype)
 {
     locFrom                 = prototype.locFrom;
     locTo                   = prototype.locTo;
     locState                = prototype.locState;
     locException            = prototype.locException;
     compilationContext      = prototype.compilationContext;
     operations              = prototype.operations;
     storedObjects           = prototype.storedObjects;
     mappingConfigurator     = prototype.mappingConfigurator;
     objectsMapperManager    = prototype.objectsMapperManager;
     rootOperation           = prototype.rootOperation;
     staticConvertersManager = prototype.staticConvertersManager;
 }
		public MappingOperationsProcessor(MappingOperationsProcessor prototype)
		{
			locFrom = prototype.locFrom;
			locTo = prototype.locTo;
			locState = prototype.locState;
			locException = prototype.locException;
			compilationContext = prototype.compilationContext;
			operations = prototype.operations;
			storedObjects = prototype.storedObjects;
			mappingConfigurator = prototype.mappingConfigurator;
			objectsMapperManager = prototype.objectsMapperManager;
			rootOperation = prototype.rootOperation;
			staticConvertersManager = prototype.staticConvertersManager;
		}
 public MappingOperationsProcessor(MappingOperationsProcessor prototype)
 {
     LocFrom                 = prototype.LocFrom;
     LocTo                   = prototype.LocTo;
     LocState                = prototype.LocState;
     LocException            = prototype.LocException;
     CompilationContext      = prototype.CompilationContext;
     Operations              = prototype.Operations;
     StoredObjects           = prototype.StoredObjects;
     MappingConfigurator     = prototype.MappingConfigurator;
     ObjectsMapperManager    = prototype.ObjectsMapperManager;
     RootOperation           = prototype.RootOperation;
     StaticConvertersManager = prototype.StaticConvertersManager;
 }
Beispiel #5
0
        public void Initialize(
            ObjectMapperManager MapperMannager, 
            Type TypeFrom, 
            Type TypeTo, 
			IMappingConfigurator mappingConfigurator,
			object[] stroredObjects)
        {
            mapperMannager = MapperMannager;
            typeFrom = TypeFrom;
            typeTo = TypeTo;
			_mappingConfigurator = mappingConfigurator;
			StroredObjects = stroredObjects;
			if (_mappingConfigurator != null)
			{
				_rootOperation = _mappingConfigurator.GetRootMappingOperation(TypeFrom, TypeTo);
				if (_rootOperation == null)
				{
					_rootOperation = new RootMappingOperation(TypeFrom, TypeTo);
				}
				var constructor = _rootOperation.TargetConstructor;
                if (constructor != null)
                {
                    _targetConstructor = (DelegateInvokerFunc_0)DelegateInvoker.GetDelegateInvoker(constructor);
                }

                var valuesPostProcessor = _rootOperation.ValuesPostProcessor;
                if (valuesPostProcessor != null)
                {
                    _valuesPostProcessor = (DelegateInvokerFunc_2)DelegateInvoker.GetDelegateInvoker(valuesPostProcessor);
                }

                var converter = _rootOperation.Converter;
                if (converter != null)
                {
                    _converter = (DelegateInvokerFunc_2)DelegateInvoker.GetDelegateInvoker(converter);
                }

                var nullSubstitutor = _rootOperation.NullSubstitutor;
                if (nullSubstitutor != null)
                {
                    _nullSubstitutor = (DelegateInvokerFunc_0)DelegateInvoker.GetDelegateInvoker(nullSubstitutor);
                }
			}
        }
    /// <summary>
    /// </summary>
    /// <param name="objectMapperManager">The object mapper manager.</param>
    /// <param name="typeFrom">The type from.</param>
    /// <param name="typeTo">The type to.</param>
    /// <param name="mappingConfigurator">The mapping configurator.</param>
    /// <param name="storedObjects">The stored objects.</param>
    internal void Initialize(
        Mapper objectMapperManager,
        Type typeFrom,
        Type typeTo,
        IMappingConfigurator mappingConfigurator,
        object[] storedObjects)
    {
        Mapper              = objectMapperManager;
        TypeFrom            = typeFrom;
        TypeTo              = typeTo;
        MappingConfigurator = mappingConfigurator;
        StoredObjects       = storedObjects;

        if (MappingConfigurator != null)
        {
            RootOperation = MappingConfigurator.GetRootMappingOperation(typeFrom, typeTo)
                            ?? new RootMappingOperation(typeFrom, typeTo);

            var constructor = RootOperation.TargetConstructor;

            if (constructor != null)
            {
                TargetConstructor = (DelegateInvokerFunc0)DelegateInvoker.GetDelegateInvoker(constructor);
            }

            var valuesPostProcessor = RootOperation.ValuesPostProcessor;

            if (valuesPostProcessor != null)
            {
                ValuesPostProcessor = (DelegateInvokerFunc2)DelegateInvoker.GetDelegateInvoker(valuesPostProcessor);
            }

            var converter = RootOperation.Converter;

            if (converter != null)
            {
                Converter = (DelegateInvokerFunc2)DelegateInvoker.GetDelegateInvoker(converter);
            }

            var nullSubstitutor = RootOperation.NullSubstitutor;

            if (nullSubstitutor != null)
            {
                NullSubstitutor = (DelegateInvokerFunc0)DelegateInvoker.GetDelegateInvoker(nullSubstitutor);
            }

            var sourceFilter = RootOperation.SourceFilter;

            if (sourceFilter != null)
            {
                SourceFilter = (DelegateInvokerFunc2)DelegateInvoker.GetDelegateInvoker(sourceFilter);
            }

            var destinationFilter = RootOperation.DestinationFilter;

            if (destinationFilter != null)
            {
                DestinationFilter = (DelegateInvokerFunc2)DelegateInvoker.GetDelegateInvoker(destinationFilter);
            }
        }
    }