Exemplo n.º 1
0
        public ConfigStoreResponse SendMessage(ConfigStoreRequest request)
        {
            ModuleProc          PROC     = new ModuleProc(this.DYN_MODULE_NAME, "SendMessage");
            ConfigStoreResponse response = new ConfigStoreResponse();

            try
            {
                ConfigStoreManager.PushValues(request.Request);
                response.Response = true;
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(response);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            ModuleProc PROC = new ModuleProc("", "Method");

            try
            {
                if (lvwProcesses.SelectedItems.Count > 0)
                {
                    ComboItem item = lvwProcesses.SelectedItems[0].Tag as ComboItem;

                    using (ConfigStoreServiceProxy proxy = new ConfigStoreServiceProxy(item.Process.Id))
                    {
                        proxy.KnownTypes = new Type[] { _store.GetType() };

                        ConfigStore        store = _store;// new ConfigStore();
                        ConfigStoreRequest req   = new ConfigStoreRequest()
                        {
                            Request = store
                        };
                        ConfigStoreResponse resp = proxy.SendMessage(req);

                        if (resp == null ||
                            proxy.LastExceptionDetail != null ||
                            resp.Response == false)
                        {
                            this.ShowErrorMessageBox("Unable to send the details.");
                            if (proxy.LastExceptionDetail != null)
                            {
                                Log.Info(PROC, proxy.LastExceptionDetail.Message);
                            }
                        }
                        else
                        {
                            this.ShowInfoMessageBox("Details are sent successfully.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            ModuleProc PROC = new ModuleProc("", "Method");

            try
            {
                if (lvwProcesses.SelectedItems.Count > 0)
                {
                    ComboItem item = lvwProcesses.SelectedItems[0].Tag as ComboItem;

                    using (ConfigStoreServiceProxy proxy = new ConfigStoreServiceProxy(item.Process.Id))
                    {
                        proxy.KnownTypes = new Type[] { _store.GetType() };

                        ConfigStore store = _store;// new ConfigStore();
                        ConfigStoreRequest req = new ConfigStoreRequest()
                        {
                            Request = store
                        };
                        ConfigStoreResponse resp = proxy.SendMessage(req);

                        if (resp == null ||
                            proxy.LastExceptionDetail != null ||
                            resp.Response == false)
                        {
                            this.ShowErrorMessageBox("Unable to send the details.");
                            if (proxy.LastExceptionDetail != null)
                            {
                                Log.Info(PROC, proxy.LastExceptionDetail.Message);
                            }
                        }
                        else
                        {
                            this.ShowInfoMessageBox("Details are sent successfully.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
Exemplo n.º 4
0
 public ConfigStoreResponse SendMessage(ConfigStoreRequest request)
 {
     return(this.InvokeMethod((c) => { return c.SendMessage(request); }));
 }