/// <summary>
        /// </summary>
        public void DeSerializeXMLMappings()
        {
            try
            {
                this.initExplorer();
                treeView1.Nodes[0].Nodes.Clear();
                AddWebServiceClient.listWebServiceClient.Clear();
                AddWebServiceClient.listWebServiceName.Clear();
                XmlDocument xmldoc = new XmlDocument();
                string path = EIBXMLUtilities.folderName + @"\\webserviceconsumer";
                string fileName = path + "\\webserviceconsumer.xml";
                xmldoc.Load(fileName);
                foreach (XmlNode xmlNode in xmldoc.FirstChild.ChildNodes)
                {
                    WebServiceConsumer webservCons = new WebServiceConsumer();
                    webservCons.Deserialize(xmlNode);
                    AddWebServiceClient.listWebServiceClient.Add(webservCons.name, webservCons);
                    AddWebServiceClient.listWebServiceName.Add(webservCons.name, webservCons.name);
                    TreeNode webTreeNode = new TreeNode(webservCons.name);
                    webTreeNode.ContextMenuStrip = deleteContextMenuStrip;
                    treeView1.Nodes[0].Nodes.Add(webTreeNode);
                }
            }
            catch
            {

            }
        }
        private void prepareArgumentList(WebServiceConsumer webCons)
        {
            DataTable dtParam = parameterDataSet.Tables[0];

            foreach (DataRow dr in dtParam.Rows)
            {
                Argument arg1 = new Argument();
                foreach (DataColumn dc in dtParam.Columns)
                {
                    if (dc.ColumnName == "paramname")
                    {
                        arg1.argName = dr[dc].ToString();
                    }
                    else if (dc.ColumnName == "paramtype")
                    {
                        arg1.argType = dr[dc].ToString();
                    }
                    else if (dc.ColumnName == "paramvalue")
                    {
                        arg1.argValue = dr[dc].ToString();
                    }
                }
                webCons.argumentList.Add(arg1);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (!validateInfos())
            {
                MessageBox.Show("Incomplete Information.");
                //this.DialogResult = DialogResult.Cancel;
                return;
            }
            else
            {
                WebServiceConsumer webCons = new WebServiceConsumer();
                if (comboNamespace.SelectedItem == null)
                {
                    webCons.name_space = comboNamespace.Text;
                }
                else
                {
                    webCons.name_space = comboNamespace.SelectedItem.ToString();
                }
                if (comboBox1.SelectedItem == null)
                {
                    webCons.wsdlurl = comboBox1.Text;
                }
                else
                {
                    webCons.wsdlurl = comboBox1.SelectedItem.ToString();
                }

                if (comboBox2.SelectedItem == null)
                {
                    webCons.methodname = comboBox2.Text;
                }
                else
                {
                    webCons.methodname = comboBox2.SelectedItem.ToString();
                }
                this.prepareArgumentList(webCons);
                if (button1.Text == "Add")
                {
                    webCons.name = "webserviceConsumer" + counter.ToString();
                    checkUniqueNess(webCons);
                    listWebServiceName.Add(webCons.name, webCons.name);
                    TreeNode treeNode1 = new TreeNode(webCons.name);
                    newTreeNode = treeNode1;
                    listWebServiceClient.Add(webCons.name, webCons);
                }
                else
                {
                    webCons.name = editName;
                    listWebServiceClient[editName] = webCons;
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
 public void checkUniqueNess(WebServiceConsumer webservCons)
 {
     string nameU = webservCons.name;
     if (listWebServiceName.ContainsKey(nameU))
     {
         counter++;
         nameU = "webserviceConsumer" + counter.ToString();
         webservCons.name = nameU;
         checkUniqueNess(webservCons);
     }
 }
        public void checkUniqueNess(WebServiceConsumer webservCons)
        {
            string nameU = webservCons.name;

            if (listWebServiceName.ContainsKey(nameU))
            {
                counter++;
                nameU            = "webserviceConsumer" + counter.ToString();
                webservCons.name = nameU;
                checkUniqueNess(webservCons);
            }
        }
        internal bool resetValues(string name)
        {
            if (!listWebServiceClient.ContainsKey(name))
            {
                this.button1.Text = "Add";
                return(false);
            }
            WebServiceConsumer webservCons = listWebServiceClient[name];

            this.comboNamespace.Items.Clear();
            this.comboBox1.Items.Clear();
            this.comboBox2.Items.Clear();
            this.comboBox1.Items.Add(webservCons.wsdlurl);
            this.comboBox1.SelectedIndex = 0;
            ReadServiceDescription();

            //this.comboNamespace.Items.Add(webservCons.name_space);
            this.comboNamespace.SelectedItem = webservCons.name_space;

            this.comboBox2.SelectedItem = webservCons.methodname;

            parameterDataSet.Tables.Clear();
            BindData();
            DataTable dtParam = parameterDataSet.Tables[0];

            foreach (Argument arg in webservCons.argumentList)
            {
                DataRow dr = dtParam.NewRow();
                dr["paramname"]  = arg.argName;
                dr["paramtype"]  = arg.argType;
                dr["paramvalue"] = arg.argValue;
                dtParam.Rows.Add(dr);
            }
            this.parameterGrid.DataSource = dtParam;
            ((System.Data.DataTable) this.parameterGrid.DataSource).DefaultView.AllowNew = false;
            this.button1.Text = "Save";
            editName          = name;
            return(true);
        }
 private void prepareTableArgList(WebServiceConsumer webCons)
 {
     parameterDataSet.Tables.Clear();
 }
 private void prepareArgumentList(WebServiceConsumer webCons)
 {
     DataTable dtParam = parameterDataSet.Tables[0];
     foreach (DataRow dr in dtParam.Rows)
     {
         Argument arg1 = new Argument();
         foreach (DataColumn dc in dtParam.Columns)
         {
             if (dc.ColumnName == "paramname")
             {
                 arg1.argName = dr[dc].ToString();
             }
             else if (dc.ColumnName == "paramtype")
             {
                 arg1.argType = dr[dc].ToString();
             }
             else if (dc.ColumnName == "paramvalue")
             {
                 arg1.argValue = dr[dc].ToString();
             }
         }
         webCons.argumentList.Add(arg1);
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            if (!validateInfos())
            {
                MessageBox.Show("Incomplete Information.");
                //this.DialogResult = DialogResult.Cancel;
                return;
            }
            else
            {
                WebServiceConsumer webCons = new WebServiceConsumer();
                if (comboNamespace.SelectedItem == null)
                {
                    webCons.name_space = comboNamespace.Text;
                }
                else
                {
                    webCons.name_space = comboNamespace.SelectedItem.ToString();
                }
                if (comboBox1.SelectedItem == null)
                {
                    webCons.wsdlurl = comboBox1.Text;
                }
                else
                {
                    webCons.wsdlurl = comboBox1.SelectedItem.ToString();
                }

                if (comboBox2.SelectedItem == null)
                {
                    webCons.methodname = comboBox2.Text;
                }
                else
                {
                    webCons.methodname = comboBox2.SelectedItem.ToString();
                }
                this.prepareArgumentList(webCons);
                if (button1.Text == "Add")
                {
                    webCons.name = "webserviceConsumer" + counter.ToString();
                    checkUniqueNess(webCons);
                    listWebServiceName.Add(webCons.name, webCons.name);
                    TreeNode treeNode1 = new TreeNode(webCons.name);
                    newTreeNode = treeNode1;
                    listWebServiceClient.Add(webCons.name, webCons);
                }
                else
                {
                    webCons.name = editName;
                    listWebServiceClient[editName] = webCons;
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
 private void prepareTableArgList(WebServiceConsumer webCons)
 {
     parameterDataSet.Tables.Clear();
 }