Пример #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);
            }
        }
Пример #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);
            }
        }