- Timestamp:
- 03/16/15 14:36:54 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
r12202 r12203 30 30 internal partial class NewItemDialog : Form { 31 31 private bool isInitialized; 32 private bool firstShown = true;33 32 34 33 private List<TreeNode> treeNodes; … … 113 112 private void NewItemDialog_Shown(object sender, EventArgs e) { 114 113 SelectedType = null; 115 if (firstShown) {116 searchTextBox.Focus();117 firstShown = false;118 }119 114 } 120 115 … … 183 178 if (category != null) { 184 179 descriptionTextBox.Text = category; 180 pluginTextBox.Text = string.Empty; 181 versionTextBox.Text = string.Empty; 185 182 } 186 183 Type type = typesTreeView.SelectedNode.Tag as Type; 187 184 if (type != null) { 188 185 string description = ItemAttribute.GetDescription(type); 186 var version = ItemAttribute.GetVersion(type); 187 var plugin = ApplicationManager.Manager.GetDeclaringPlugin(type); 189 188 if (description != null) 190 189 descriptionTextBox.Text = description; 190 if (plugin != null) 191 pluginTextBox.Text = plugin.Name; 192 if (version != null) 193 versionTextBox.Text = version.ToString(); 191 194 } 192 195 } else if (typesTreeView.Nodes.Count == 0) { 193 196 descriptionTextBox.Text = "No types found"; 197 pluginTextBox.Text = string.Empty; 198 versionTextBox.Text = string.Empty; 194 199 } 195 200 } … … 233 238 } 234 239 private void SetTreeNodeVisibility() { 235 typesTreeView.ExpandAll();236 240 TreeNode selectedNode = typesTreeView.SelectedNode; 237 if (selectedNode != null) { 238 typesTreeView.SelectedNode = selectedNode; 239 selectedNode.EnsureVisible(); 240 } else if (string.IsNullOrEmpty(currentSearchString) && typesTreeView.Nodes.Count > 1) { 241 typesTreeView.Nodes[0].EnsureVisible(); 242 } 241 if (string.IsNullOrEmpty(currentSearchString) && (typesTreeView.Nodes.Count > 1)) { 242 typesTreeView.CollapseAll(); 243 if (selectedNode != null) typesTreeView.SelectedNode = selectedNode; 244 } else { 245 typesTreeView.ExpandAll(); 246 } 247 if (selectedNode != null) selectedNode.EnsureVisible(); 243 248 } 244 249 #endregion
Note: See TracChangeset
for help on using the changeset viewer.