Ejemplo n.º 1
0
        public object InvokeDelegate(ObjectIdentifier identifier, object[] args)
        {
            var @delegate = (Delegate)QueryVault().Query(identifier);
            var result    = @delegate.DynamicInvoke(DomainPipeline.UnpackArgs(identifier.PipelineId, args));

            return(DomainPipeline.PackArgs(identifier.PipelineId, new[] { @delegate.Method.ReturnType }, new[] { result }).First());
        }
Ejemplo n.º 2
0
        public ObjectIdentifier CreateObjectReflex(Type objectType)
        {
            var identifier = new ObjectIdentifier(_pipelineId);
            var reflex     = DomainPipeline.CreateReflexForObject(identifier, objectType);

            QueryVault().Register(identifier, reflex);
            return(identifier);
        }
Ejemplo n.º 3
0
        public object InvokeObjectMethod(ObjectIdentifier identifier, string methodName, IEnumerable <Type> methodParameters, object[] args)
        {
            var vault = QueryVault();

            var instance     = vault.Query(identifier);
            var instanceType = instance.GetType();

            var method = instanceType.GetSimilarMethod(methodName, methodParameters.ToArray());
            var result = method.Invoke(instance, DomainPipeline.UnpackArgs(identifier.PipelineId, args));

            return(DomainPipeline.PackArgs(identifier.PipelineId, new[] { method.ReturnType }, new[] { result }).First());
        }