Ejemplo n.º 1
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            int selectedIndex = this.ExecutionServices.SelectedIndex;

            if (selectedIndex < 0)
            {
                return;
            }
            ExecutionServiceProxy executionServiceProxy;

            if (!this.proxys.TryGetValue(selectedIndex, out executionServiceProxy))
            {
                MessageBox.Show("익스큐션 서비스가 이상해요 " + selectedIndex);
                return;
            }
            foreach (object obj in this.Services.SelectedItems)
            {
                string text = (string)obj;
                if (text == "" || text == null)
                {
                    MessageBox.Show("서비스가 이상해요 " + text);
                    break;
                }
                ExecAppDomain execAppDomain = new ExecAppDomain(text, 1);
                execAppDomain.OnComplete += delegate(Operation op)
                {
                    this.AppDomains.Invoke(new AdminService.InvokeFormDelegate(delegate
                    {
                        ExecAppDomain execAppDomain2 = op as ExecAppDomain;
                        if (op == null)
                        {
                            MessageBox.Show("에러!!");
                            return;
                        }
                        this.AppDomains.Items.Clear();
                        foreach (string item in execAppDomain2.LoadedAppDomains)
                        {
                            this.AppDomains.Items.Add(item);
                        }
                    }));
                    this.AppDomains.Invoke(new AdminService.InvokeFormDelegate(this.AppDomains.Invalidate));
                };
                this.Service.RequestOperation(executionServiceProxy.ExecutionServiceInfo, execAppDomain);
            }
        }
Ejemplo n.º 2
0
        private void QueryService(IPEndPoint info)
        {
            QueryService operation = new QueryService();

            operation.OnComplete += delegate(Operation op)
            {
                ExecAppDomain execop = new ExecAppDomain("", 0);
                execop.OnComplete += delegate(Operation op2)
                {
                    this.ExecutionServices.Invoke(new AdminService.InvokeFormDelegate(delegate
                    {
                        this.ExecutionServices.Items.Add(info);
                        int key          = this.ExecutionServices.Items.Count - 1;
                        this.proxys[key] = new ExecutionServiceProxy(info, operation.ServiceClasses, execop.LoadedAppDomains);
                        this.ExecutionServices.Invalidate();
                    }));
                };
                this.Service.RequestOperation(info, execop);
            };
            this.Service.RequestOperation(info, operation);
        }