public void ResponseReturnValue(ResponseMethodDTO responseMethodDTO)
 {
     if (responseMethodDTO.ExecutionSuccess)
     {
         MessageBox.Show("Yeah !!, el valor de retorno es: " + responseMethodDTO.MethodResult);
     }
 }
 public void ResponseSerializePreferences(ResponseMethodDTO response)
 {
     if (response.ExecutionSuccess)
     {
         Console.WriteLine("Serialized settings.");
     }
 }
 public void ResponseSerializeProject(ResponseMethodDTO response)
 {
     if (response.ExecutionSuccess)
     {
         Console.WriteLine("Project serialized");
     }
 }
示例#4
0
        private ResponseMethodDTO ExecuteRedirectView(MethodInfo methodToExecute, object[] parameters, IViewHandler viewHandler, MethodInfo methodToResponse)
        {
            ResponseMethodDTO responseMethodDTO = (ResponseMethodDTO)FactoryDTO.Instance.Create(CreateDTO.ResponseMethod);

            try {
                object ret = methodToExecute.Invoke(this, parameters);
                responseMethodDTO.MethodResult = ret;
                responseMethodDTO.SetExecutionSuccess(true);
                if (VirtualMethod != null)
                {
                    VirtualMethod(responseMethodDTO);
                    VirtualMethod = null;
                }
                //Beta Implementation
                //
                if (!ViewHandlerCollection.Contains(viewHandler))
                {
                    ViewHandlerCollection.Add(viewHandler);
                    logger.Debug("A new view has been added to View Cache");
                }
                else
                {
                    logger.Debug("This view has already been registered at View Cache.");
                }
                //
                //End

                methodToResponse.Invoke(viewHandler, new object[] { responseMethodDTO });
            }
            catch (TargetInvocationException exception) {
                this.MapException(exception);
            }
            return(responseMethodDTO);
        }
示例#5
0
        private ResponseMethodDTO ExecuteRedirectNewView(MethodInfo methodToExecute, object[] parameters, Type viewType, MethodInfo methodToResponse)
        {
            ResponseMethodDTO responseMethodDTO = (ResponseMethodDTO)FactoryDTO.Instance.Create(CreateDTO.ResponseMethod);

            try {
                object ret = methodToExecute.Invoke(this, parameters);
                responseMethodDTO.MethodResult = ret;
                object obj = viewType.GetConstructor(null).Invoke(null);
                responseMethodDTO.SetExecutionSuccess(true);
                if (VirtualMethod != null)
                {
                    VirtualMethod(responseMethodDTO);
                    VirtualMethod = null;
                }
                methodToResponse.Invoke(obj, new object[] { responseMethodDTO });
                //Beta Implementation
                //
                //Siempre se va a añadir esta vista puesto que es una vista
                //nueva.
                ViewHandlerCollection.Add((IViewHandler)obj);
                logger.Debug("A new view has been added to View Cache.");
                //
                //End
                return(responseMethodDTO);
            }
            catch (TargetInvocationException exception) {
                this.MapException(exception);
            }
            return(responseMethodDTO);
        }
 public void ResponseDeserializeProject(ResponseMethodDTO response)
 {
     if (response.ExecutionSuccess)
     {
         ProjectDTO projectDTO = (ProjectDTO)response.MethodResult;
         LoadDataForm(projectDTO);
     }
 }
        /* Response Notifications */

        public void ResponseShowForm(ResponseMethodDTO response)
        {
            if (response.ExecutionSuccess)
            {
                response.MethodResult = mainComponentBuilderForm ["vbox1"];
                statusbar1.Push(0, String.Format("Welcome to Babuine Component Builder: {0}@{1}", Environment.UserName, Environment.MachineName));
            }
        }
 private void CallBackExecuteNoRedirect()
 {
     lock (responseMethodDTO) {
         responseMethodDTO = (ResponseMethodDTO)FactoryDTO.Instance.Create(CreateDTO.ResponseMethod);
         object ret = methodToExecute.Invoke(componentModel, parameters);
         responseMethodDTO.MethodResult = ret;
         responseMethodDTO.SetExecutionSuccess(true);
         if (componentModel.VirtualMethod != null)
         {
             componentModel.VirtualMethod(responseMethodDTO);
             componentModel.VirtualMethod = null;
         }
     }
 }
 private void CallBackExecuteRedirectNewView()
 {
     lock (responseMethodDTO) {
         responseMethodDTO = (ResponseMethodDTO)FactoryDTO.Instance.Create(CreateDTO.ResponseMethod);
         object ret = methodToExecute.Invoke(componentModel, parameters);
         responseMethodDTO.MethodResult = ret;
         responseMethodDTO.SetExecutionSuccess(true);
         if (componentModel.VirtualMethod != null)
         {
             componentModel.VirtualMethod(responseMethodDTO);
             componentModel.VirtualMethod = null;
         }
         object obj = viewType.GetConstructor(null).Invoke(null);
         methodToResponse.Invoke(obj, new object[] { responseMethodDTO });
     }
 }
示例#10
0
        public IComponentModelDTO Create(CreateDTO value)
        {
            switch (value)
            {
            case CreateDTO.ComponentModel:
                return(new ComponentModelDTO());

            case CreateDTO.ResponseMethod:
                ResponseMethodDTO responseMethodDTO = new ResponseMethodDTO();
                responseMethodDTO.SetExecutionSuccess(false);      //Por defecto inicializará a false.
                return(responseMethodDTO);

            default:
                return(null);
            }
        }
示例#11
0
        private ResponseMethodDTO ExecuteNoRedirect(MethodInfo methodToExecute, object[] parameters)
        {
            ResponseMethodDTO responseMethodDTO = (ResponseMethodDTO)FactoryDTO.Instance.Create(CreateDTO.ResponseMethod);

            try {
                object ret = methodToExecute.Invoke(this, parameters);
                responseMethodDTO.MethodResult = ret;
                responseMethodDTO.SetExecutionSuccess(true);
                if (VirtualMethod != null)
                {
                    VirtualMethod(responseMethodDTO);
                    VirtualMethod = null;
                }
            }
            catch (TargetInvocationException exception) {
                this.MapException(exception);
            }
            return(responseMethodDTO);
        }
 public void ResponseNotFound()
 {
     IComponentModel   componentModel = DefaultContainer.Instance.GetComponentByName("TestUnidad1");
     ResponseMethodDTO response       = componentModel.Execute("NoResponse", null);
 }