private void selectFQN(string fqn)
        {
            UML.UMLItem item = null;
            item = this.model.getItemFromFQN(fqn);

            if (item != null)
            {
                item.select();
            }
            else
            {
                string messageText;
                if (fqn.Length > 255)
                {
                    messageText = fqn.Substring(0, 255);
                }
                else
                {
                    messageText = fqn;
                }
                FQNInputForm fqnForm = new FQNInputForm("Could not find item with the string:"
                                                        + Environment.NewLine + messageText, "Fill in the Fully Qualified Name", "FQN:");
                if (fqnForm.ShowDialog() == DialogResult.OK &&
                    fqnForm.fqn.Length > 0)
                {
                    this.selectFQN(fqnForm.fqn);
                }
            }
        }
示例#2
0
 void QuickSearchComboBoxSelectionChangeCommitted(object sender, EventArgs e)
 {
     if (this.quickSearchBox.SelectedIndex >= 0)
     {
         UML.UMLItem quickSearchSelectedItem = this.quickSearchBox.SelectedItem as UML.UMLItem;
         {
             if (quickSearchSelectedItem != null)
             {
                 // if this element is to be selected in the project browser is will
                 // automatically be set as the main element
                 if (settings.quickSearchSelectProjectBrowser)
                 {
                     quickSearchSelectedItem.select();
                 }
                 else
                 {
                     this.setElement(quickSearchSelectedItem);
                 }
                 // also add to diagram if needed
                 if (settings.quickSearchAddToDiagram)
                 {
                     this.addToDiagram(quickSearchSelectedItem);
                 }
             }
         }
     }
 }
        /// <summary>
        /// selects the element with the given guid
        /// </summary>
        /// <param name="guidString">string containing a guid</param>
        private void selectGUID(string guidString)
        {
            UML.UMLItem item = null;
            item = this.model.getItemFromGUID(guidString);

            if (item != null)
            {
                item.select();
            }
            else
            {
                //TODO make GUID iso fqn
                FQNInputForm fqnForm = new FQNInputForm("Could not find item with the GUID:"
                                                        + Environment.NewLine + guidString, "Fill in the GUID", "GUID:");
                if (fqnForm.ShowDialog() == DialogResult.OK &&
                    fqnForm.fqn.Length > 0)
                {
                    this.selectGUID(fqnForm.fqn);
                }
            }
        }