Beispiel #1
0
        /// <summary>
        /// Edits the currently selected element in the list.
        /// </summary>
        private void EditMI_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (areaSourceLv_.SelectedItems.Count != 1)
                {
                    return;
                }

                if (typeof(Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement).IsInstanceOfType(areaSourceLv_.SelectedItems[0].Tag))
                {
                    Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement element = (Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement)areaSourceLv_.SelectedItems[0].Tag;

                    string qualifiedName = new QualifiedNameEditDlg().ShowDialog(element.QualifiedName);

                    if (qualifiedName == null)
                    {
                        return;
                    }

                    element.QualifiedName = qualifiedName;
                    AdjustColumns(areaSourceLv_);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Prompts the user to enter the qualified name for a source.
        /// </summary>
        private void AddSourceMI_Click(object sender, System.EventArgs e)
        {
            try
            {
                string qualifiedName = new QualifiedNameEditDlg().ShowDialog(null);

                if (qualifiedName == null)
                {
                    return;
                }

                Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement element = new Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement
                {
                    QualifiedName = qualifiedName,
                    NodeType      = Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseType.Source
                };

                Add(element);
                AdjustColumns(areaSourceLv_);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Adds the area or source to the list.
        /// </summary>
        public void Add(Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement element)
        {
            ListViewItem item = new ListViewItem(element.QualifiedName);

            item.SubItems.Add(element.NodeType.ToString());

            item.ImageIndex = (element.NodeType == Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseType.Area)?Resources.IMAGE_CLOSED_BLUE_FOLDER:Resources.IMAGE_GREEN_SCROLL;
            item.Tag        = element;

            areaSourceLv_.Items.Add(item);
        }
Beispiel #4
0
        /// <summary>
        /// Returns the qualified names for the sources in the control.
        /// </summary>
        public string[] GetSources()
        {
            ArrayList sources = new ArrayList();

            foreach (ListViewItem item in areaSourceLv_.Items)
            {
                Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement element = (Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement)item.Tag;

                if (element.NodeType == Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseType.Source)
                {
                    sources.Add(element.QualifiedName);
                }
            }

            return((string[])sources.ToArray(typeof(string)));
        }
Beispiel #5
0
        /// <summary>
        /// Adds multiple sources to the list.
        /// </summary>
        public void AddSources(string[] sources)
        {
            if (sources != null)
            {
                for (int ii = 0; ii < sources.Length; ii++)
                {
                    Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement element = new Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseElement
                    {
                        QualifiedName = sources[ii],
                        NodeType      = Technosoftware.DaAeHdaClient.Ae.TsCAeBrowseType.Source
                    };

                    Add(element);
                }

                AdjustColumns(areaSourceLv_);
            }
        }