Пример #1
0
        private void button6_Click(object sender, EventArgs e)
        {

                if (treeView1.GetNodeCount(false) > 0)
                {
                    if (treeView1.SelectedNode != null)
                    {
                        if (treeView1.SelectedNode.Level > 0)
                        {
                            Target tmp;

                            if (treeView1.SelectedNode.Level > 1)
                            {
                                if (treeView1.SelectedNode.Parent.Tag != null)
                                {
                                    tmp = (Target)treeView1.SelectedNode.Parent.Tag;
                                }
                                else
                                {
                                    tmp = (Target)treeView1.SelectedNode.Parent.Parent.Tag;
                                }
                            }
                            else
                            {
                                tmp = (Target)treeView1.SelectedNode.Tag;
                            }


                            if (tmp.soapRequest != null)
                            {

                                string tmpAction = tmp.actionDesc.Name;
                                string tmpCoUrl = tmp.controlURL;
                                string tmpSoap = tmp.soapRequest;
                                string tmpSvcIdent = tmp.targetService.ServiceTypeIdentifier;
                                RequestSender requestsender = new RequestSender(tmpAction, tmpCoUrl, tmpSoap, tmpSvcIdent);
                                requestsender.Show();
                            }


                        }
                        else
                        {
                            MessageBox.Show("No action selected.",
                                                   "Select the action of a target first.",
                                                   MessageBoxButtons.OK,
                                                   MessageBoxIcon.Exclamation,
                                                   MessageBoxDefaultButton.Button1);
                        }

                    }
                    else
                    {
                        MessageBox.Show("No action selected.",
                                                   "Select the action of a target first.",
                                                   MessageBoxButtons.OK,
                                                   MessageBoxIcon.Exclamation,
                                                   MessageBoxDefaultButton.Button1);
                    }
                }
                else
                {
                    MessageBox.Show("There are no targets yet.",
                                                   "No targets",
                                                   MessageBoxButtons.OK,
                                                   MessageBoxIcon.Exclamation,
                                                   MessageBoxDefaultButton.Button1);
                }
        }
Пример #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            if (treeView1.GetNodeCount(false) > 0)
            {
                if (treeView1.SelectedNode != null)
                {
                    if (treeView1.SelectedNode.Level > 0)
                    {
                        Target tmp;

                        if (treeView1.SelectedNode.Level > 1)
                        {
                            if (treeView1.SelectedNode.Parent.Tag != null)
                            {
                                tmp = (Target)treeView1.SelectedNode.Parent.Tag;
                            }
                            else
                            {
                                tmp = (Target)treeView1.SelectedNode.Parent.Parent.Tag;
                            }
                        }
                        else
                        {
                            tmp = (Target)treeView1.SelectedNode.Tag;
                        }


                        if (tmp.soapRequest != null)
                        {
                            string        tmpAction     = tmp.actionDesc.Name;
                            string        tmpCoUrl      = tmp.controlURL;
                            string        tmpSoap       = tmp.soapRequest;
                            string        tmpSvcIdent   = tmp.targetService.ServiceTypeIdentifier;
                            RequestSender requestsender = new RequestSender(tmpAction, tmpCoUrl, tmpSoap, tmpSvcIdent);
                            requestsender.Show();
                        }
                    }
                    else
                    {
                        MessageBox.Show("No action selected.",
                                        "Select the action of a target first.",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Exclamation,
                                        MessageBoxDefaultButton.Button1);
                    }
                }
                else
                {
                    MessageBox.Show("No action selected.",
                                    "Select the action of a target first.",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation,
                                    MessageBoxDefaultButton.Button1);
                }
            }
            else
            {
                MessageBox.Show("There are no targets yet.",
                                "No targets",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
            }
        }