public void Exception()
        {
            ResponseMethodDTO responseMethodDTO;

            IComponentModel componentModel = DefaultContainer.Instance.GetComponentByName("TestUnidad1");

            responseMethodDTO = componentModel.Execute("TestException", null, false);
            Assert.AreEqual(responseMethodDTO.ExecutionSuccess, false);
            Assert.IsNull(responseMethodDTO.MethodResult);
        }
예제 #2
0
        public static void Main()
        {
            Gdk.Threads.Init();
            Gtk.Application.Init();
            IComponentModel componentModel = DefaultContainer.Instance.GetComponentByName("MainComponent");

            Gdk.Threads.Enter();
            componentModel.Execute("InitApp", null);
            //DefaultContainer.Instance.Execute ("MainComponent", "InitApp", null);
            Gtk.Application.Run();
            Gdk.Threads.Leave();
        }
        public void ExecuteRedirectNewView()
        {
            int x = 4;
            ResponseMethodDTO responseMethodDTO;

            IComponentModel componentModel = DefaultContainer.Instance.GetComponentByName("TestUnidad1");

            responseMethodDTO = componentModel.Execute("ReturnValue", new object[] { x });
            Assert.AreEqual(responseMethodDTO.ExecutionSuccess, true);
            Assert.IsNotNull(responseMethodDTO.MethodResult);
            Assert.AreEqual(responseMethodDTO.MethodResult, x);
            Assert.IsTrue(componentModel.ViewHandlerCollection.Count != 0);
        }
        private void OnPreferencesClicked(object sender, EventArgs args)
        {
            preferencesView = new PreferencesView();
            IComponentModel componentModel = DefaultContainer.Instance["ComponentBuilder"];

            preferencesView.LoadDataForm((IDataTransferObject)componentModel.GetProperty("PreferencesDTO"));
            PreferencesDTO preferencesDTO = (PreferencesDTO)preferencesView.GetDataForm();

            if (preferencesDTO != null)
            {
                componentModel.SetProperty("PreferencesDTO", preferencesDTO);
                componentModel.Execute("SerializePreferences", null, this);
            }
            preferencesView = null;
        }
        public void ExecutionNonRedirectOverload()
        {
            char c = 'a';
            ResponseMethodDTO responseMethodDTO;
            char returnValue;

            IComponentModel componentModel = DefaultContainer.Instance.GetComponentByName("TestUnidad1");

            responseMethodDTO = componentModel.Execute("ReturnValue", new object[] { c }, false);
            Assert.AreEqual(responseMethodDTO.ExecutionSuccess, true);
            Assert.IsNotNull(responseMethodDTO.MethodResult);
            if (responseMethodDTO.ExecutionSuccess == true)
            {
                returnValue = (char)responseMethodDTO.MethodResult;
                Assert.AreEqual(returnValue, c);
            }
        }
        public void ExecutionNonRedirect()
        {
            int x = 4;
            ResponseMethodDTO responseMethodDTO;
            int returnValue;

            IComponentModel componentModel = DefaultContainer.Instance.GetComponentByName("TestUnidad1");

            responseMethodDTO = componentModel.Execute("ReturnValue", new object[] { x }, false);
            Assert.AreEqual(responseMethodDTO.ExecutionSuccess, true);
            Assert.IsNotNull(responseMethodDTO.MethodResult);
            if (responseMethodDTO.ExecutionSuccess == true)
            {
                returnValue = (int)responseMethodDTO.MethodResult;
                Assert.AreEqual(returnValue, x);
                //Al estar usando reflection, no creo que se devuelva la misma
                //posición de memoria.
                //Assert.AreNotSame (returnValue, x);
            }
        }
        /*Servicio ejecutor*/
        public ResponseMethodDTO Execute(string componentName, string methodName, object[] parameters, bool redirect, IViewHandler viewHandler, bool block)
        {
            IComponentModel componentModel = this.GetComponentByName(componentName);

            return(componentModel.Execute(methodName, parameters, redirect, viewHandler, block));
        }
 public void ResponseNotFound()
 {
     IComponentModel   componentModel = DefaultContainer.Instance.GetComponentByName("TestUnidad1");
     ResponseMethodDTO response       = componentModel.Execute("NoResponse", null);
 }