Пример #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());
        }
Пример #2
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());
        }