示例#1
0
        /// <summary>
        ///   Cauta ontologii pe baza informatiilor specificate in campurile corespunzatoare.
        ///   Completeaza lista de ontologii cu rezultatele cautarii.
        /// </summary>
        public void performSearch()
        {
            string ontologyName = txbOntologyName.Text.Trim();

            if (ontologyName == String.Empty) {

                MessageBox.Show("Ontology name is not set", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try {

                listView.Items.Clear();

                SearchOntology searchOntology = new SearchOntology(uddiConnection, ontologyName, chkCaseSensitive.Checked, chkExactMatch.Checked);

                List<OntInfo> ontologyList = searchOntology.search();

                if (ontologyList == null) {

                    MessageBox.Show("No matches were found", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                foreach (OntInfo ontInfo in ontologyList) {

                    ListViewItem item = new ListViewItem(ontInfo.owner);

                    item.SubItems.Add(ontInfo.ontologyName);
                    item.SubItems.Add(ontInfo.ontologyURL);

                    item.Tag = ontInfo;

                    listView.Items.Add(item);
                }
            }
            catch (UddiException e) {

                MessageBox.Show("Uddi error: " + e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception e) {

                MessageBox.Show("General exception: " + e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        /// <summary>
        ///   Cauta toate ontologiile de pe serverul UDDI.
        ///   Stocheaza toate ontologiile in lista ontologiilor.
        ///   Adauga ontologiile in combo-box.
        /// </summary>
        private void searchOntologies()
        {
            try {

                cbxOntology.Items.Add("None");

                cbxOntology.SelectedIndex = 0;

                SearchOntology searchOntology = new SearchOntology(uddiConnection);

                ontologyList = searchOntology.search();

                if (ontologyList != null) {

                    cbxOntology.Tag = ontologyList;

                    foreach (OntInfo ontInfo in ontologyList) {

                        cbxOntology.Items.Add(ontInfo.ontologyName);
                     }
                }
            }
            catch (UddiException e) {

                MessageBox.Show("Uddi error: " + e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception e) {

                MessageBox.Show("General exception: " + e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }