[2655] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[12012] | 3 | * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[2655] | 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 |
|
---|
| 22 | using System;
|
---|
[4068] | 23 | using System.Collections.Generic;
|
---|
[2818] | 24 | using System.Linq;
|
---|
[5848] | 25 | using System.Reflection;
|
---|
[2655] | 26 | using System.Text;
|
---|
| 27 | using System.Windows.Forms;
|
---|
[2739] | 28 | using HeuristicLab.Common;
|
---|
[2655] | 29 | using HeuristicLab.PluginInfrastructure;
|
---|
| 30 |
|
---|
[4068] | 31 | namespace HeuristicLab.Core.Views {
|
---|
[2655] | 32 | public partial class TypeSelector : UserControl {
|
---|
[2952] | 33 | protected List<TreeNode> treeNodes;
|
---|
| 34 | protected string currentSearchString;
|
---|
[3588] | 35 | protected TypeSelectorDialog typeSelectorDialog;
|
---|
[2952] | 36 |
|
---|
[5850] | 37 | protected IEnumerable<Type> baseTypes;
|
---|
| 38 | public IEnumerable<Type> BaseTypes {
|
---|
| 39 | get { return baseTypes; }
|
---|
[2655] | 40 | }
|
---|
[2676] | 41 | protected bool showNotInstantiableTypes;
|
---|
[2655] | 42 | public bool ShowNotInstantiableTypes {
|
---|
| 43 | get { return showNotInstantiableTypes; }
|
---|
| 44 | }
|
---|
[2676] | 45 | protected bool showGenericTypes;
|
---|
[2655] | 46 | public bool ShowGenericTypes {
|
---|
| 47 | get { return showGenericTypes; }
|
---|
| 48 | }
|
---|
| 49 | public string Caption {
|
---|
[2676] | 50 | get { return typesGroupBox.Text; }
|
---|
[2655] | 51 | set {
|
---|
| 52 | if (InvokeRequired)
|
---|
| 53 | Invoke(new Action<string>(delegate(string s) { Caption = s; }), value);
|
---|
| 54 | else
|
---|
[2676] | 55 | typesGroupBox.Text = value;
|
---|
[2655] | 56 | }
|
---|
| 57 | }
|
---|
| 58 | public TreeView TypesTreeView {
|
---|
| 59 | get { return typesTreeView; }
|
---|
| 60 | }
|
---|
[2676] | 61 | protected Type selectedType;
|
---|
[2655] | 62 | public Type SelectedType {
|
---|
| 63 | get { return selectedType; }
|
---|
| 64 | private set {
|
---|
| 65 | if (value != selectedType) {
|
---|
| 66 | selectedType = value;
|
---|
| 67 | OnSelectedTypeChanged();
|
---|
| 68 | }
|
---|
| 69 | }
|
---|
| 70 | }
|
---|
| 71 |
|
---|
| 72 | public TypeSelector() {
|
---|
| 73 | InitializeComponent();
|
---|
[2952] | 74 | treeNodes = new List<TreeNode>();
|
---|
| 75 | currentSearchString = string.Empty;
|
---|
[2655] | 76 | selectedType = null;
|
---|
| 77 | }
|
---|
| 78 |
|
---|
[5237] | 79 | protected override void Dispose(bool disposing) {
|
---|
| 80 | if (disposing) {
|
---|
| 81 | if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
|
---|
| 82 | if (components != null) components.Dispose();
|
---|
| 83 | }
|
---|
| 84 | base.Dispose(disposing);
|
---|
| 85 | }
|
---|
| 86 |
|
---|
[2676] | 87 | public virtual void Configure(Type baseType, bool showNotInstantiableTypes, bool showGenericTypes) {
|
---|
[6365] | 88 | Configure(baseType, showNotInstantiableTypes, showGenericTypes, (t) => true);
|
---|
[5850] | 89 | }
|
---|
| 90 |
|
---|
[6363] | 91 | public virtual void Configure(Type baseType, bool showNotInstantiableTypes, bool showGenericTypes, Func<Type, bool> typeCondition) {
|
---|
| 92 | Configure(new List<Type>() { baseType }, showNotInstantiableTypes, showGenericTypes, true, typeCondition);
|
---|
| 93 | }
|
---|
| 94 |
|
---|
[5903] | 95 | public virtual void Configure(IEnumerable<Type> baseTypes, bool showNotInstantiableTypes, bool showGenericTypes, bool assignableToAllTypes) {
|
---|
[6363] | 96 | Configure(baseTypes, showNotInstantiableTypes, showGenericTypes, assignableToAllTypes, (t) => { return true; });
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | public virtual void Configure(IEnumerable<Type> baseTypes, bool showNotInstantiableTypes, bool showGenericTypes, bool assignableToAllTypes, Func<Type, bool> typeCondition) {
|
---|
[5850] | 100 | if (baseTypes == null) throw new ArgumentNullException();
|
---|
[2655] | 101 | if (InvokeRequired)
|
---|
[6363] | 102 | Invoke(new Action<IEnumerable<Type>, bool, bool, bool, Func<Type, bool>>(Configure), baseTypes, showNotInstantiableTypes, showGenericTypes, assignableToAllTypes, typeCondition);
|
---|
[2655] | 103 | else {
|
---|
[5850] | 104 | this.baseTypes = baseTypes;
|
---|
[2655] | 105 | this.showNotInstantiableTypes = showNotInstantiableTypes;
|
---|
| 106 | this.showGenericTypes = showGenericTypes;
|
---|
[6954] | 107 | bool selectedTypeFound = false;
|
---|
[2655] | 108 |
|
---|
[3588] | 109 | typeParametersSplitContainer.Panel2Collapsed = !showGenericTypes;
|
---|
| 110 |
|
---|
[2952] | 111 | TreeNode selectedNode = typesTreeView.SelectedNode;
|
---|
[2655] | 112 | typesTreeView.Nodes.Clear();
|
---|
[2952] | 113 | treeNodes.Clear();
|
---|
[10497] | 114 |
|
---|
[2655] | 115 | imageList.Images.Clear();
|
---|
[5287] | 116 | imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Class); // default icon
|
---|
| 117 | imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Namespace); // plugins
|
---|
| 118 | imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Interface); // interfaces
|
---|
| 119 | imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Template); // generic types
|
---|
[10497] | 120 | // additional dictionary for image indexes as imageList.ContainsKey and imageList.IndexOfKey are very slow!
|
---|
| 121 | var imageNames = new Dictionary<string, int>();
|
---|
[2655] | 122 |
|
---|
| 123 | var plugins = from p in ApplicationManager.Manager.Plugins
|
---|
| 124 | orderby p.Name, p.Version ascending
|
---|
| 125 | select p;
|
---|
| 126 | foreach (IPluginDescription plugin in plugins) {
|
---|
| 127 | TreeNode pluginNode = new TreeNode();
|
---|
[5898] | 128 | pluginNode.Text = string.Format("{0} {1}.{2}", plugin.Name, plugin.Version.Major, plugin.Version.Minor);
|
---|
[2655] | 129 | pluginNode.ImageIndex = 1;
|
---|
| 130 | pluginNode.SelectedImageIndex = pluginNode.ImageIndex;
|
---|
| 131 | pluginNode.Tag = plugin;
|
---|
| 132 |
|
---|
[7111] | 133 | var types = from t in ApplicationManager.Manager.GetTypes(BaseTypes, plugin, !ShowNotInstantiableTypes, ShowGenericTypes, assignableToAllTypes)
|
---|
[6363] | 134 | where typeCondition(t)
|
---|
[2655] | 135 | orderby t.Name ascending
|
---|
| 136 | select t;
|
---|
| 137 | foreach (Type type in types) {
|
---|
[7123] | 138 | bool valid = (ShowNotInstantiableTypes || type.GetConstructor(Type.EmptyTypes) != null); //check for public default ctor
|
---|
[2655] | 139 | if (valid) {
|
---|
| 140 | TreeNode typeNode = new TreeNode();
|
---|
| 141 | string name = ItemAttribute.GetName(type);
|
---|
[2739] | 142 | typeNode.Text = name != null ? name : type.GetPrettyName();
|
---|
[2655] | 143 | typeNode.ImageIndex = 0;
|
---|
| 144 | if (type.IsInterface) typeNode.ImageIndex = 2;
|
---|
[3528] | 145 | else if (type.ContainsGenericParameters) typeNode.ImageIndex = 3;
|
---|
[10497] | 146 | else if (imageNames.ContainsKey(type.FullName)) typeNode.ImageIndex = imageNames[type.FullName];
|
---|
[7201] | 147 | else {
|
---|
| 148 | var image = ItemAttribute.GetImage(type);
|
---|
| 149 | if (image != null) {
|
---|
[10497] | 150 | imageList.Images.Add(image);
|
---|
| 151 | typeNode.ImageIndex = imageList.Images.Count - 1;
|
---|
| 152 | imageNames.Add(type.FullName, imageList.Images.Count - 1);
|
---|
[7201] | 153 | }
|
---|
[2655] | 154 | }
|
---|
| 155 | typeNode.SelectedImageIndex = typeNode.ImageIndex;
|
---|
| 156 | typeNode.Tag = type;
|
---|
| 157 | pluginNode.Nodes.Add(typeNode);
|
---|
[6954] | 158 | if (type.Equals(selectedType)) selectedTypeFound = true;
|
---|
[2655] | 159 | }
|
---|
| 160 | }
|
---|
| 161 | if (pluginNode.Nodes.Count > 0)
|
---|
[2952] | 162 | treeNodes.Add(pluginNode);
|
---|
[2655] | 163 | }
|
---|
[6954] | 164 | if (!selectedTypeFound) SelectedType = null;
|
---|
[2952] | 165 | foreach (TreeNode node in treeNodes)
|
---|
| 166 | typesTreeView.Nodes.Add((TreeNode)node.Clone());
|
---|
| 167 | RestoreSelectedNode(selectedNode);
|
---|
| 168 | Filter(searchTextBox.Text);
|
---|
[3588] | 169 |
|
---|
| 170 | UpdateTypeParameters();
|
---|
[2952] | 171 | }
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | public virtual void Filter(string searchString) {
|
---|
| 175 | if (InvokeRequired)
|
---|
| 176 | Invoke(new Action<string>(Filter), searchString);
|
---|
| 177 | else {
|
---|
| 178 | searchString = searchString.ToLower();
|
---|
[4826] | 179 |
|
---|
[2952] | 180 | if (!searchString.Contains(currentSearchString)) {
|
---|
[4826] | 181 | typesTreeView.BeginUpdate();
|
---|
[2952] | 182 | // expand search -> restore all tree nodes
|
---|
| 183 | TreeNode selectedNode = typesTreeView.SelectedNode;
|
---|
| 184 | typesTreeView.Nodes.Clear();
|
---|
| 185 | foreach (TreeNode node in treeNodes)
|
---|
| 186 | typesTreeView.Nodes.Add((TreeNode)node.Clone());
|
---|
| 187 | RestoreSelectedNode(selectedNode);
|
---|
[4826] | 188 | typesTreeView.EndUpdate();
|
---|
[2952] | 189 | }
|
---|
| 190 |
|
---|
[4826] | 191 |
|
---|
[2952] | 192 | // remove nodes
|
---|
[4826] | 193 | typesTreeView.BeginUpdate();
|
---|
[2952] | 194 | int i = 0;
|
---|
| 195 | while (i < typesTreeView.Nodes.Count) {
|
---|
| 196 | int j = 0;
|
---|
| 197 | while (j < typesTreeView.Nodes[i].Nodes.Count) {
|
---|
[6954] | 198 | if (!typesTreeView.Nodes[i].Nodes[j].Text.ToLower().Contains(searchString)) {
|
---|
| 199 | if ((typesTreeView.Nodes[i].Nodes[j].Tag as Type).Equals(selectedType))
|
---|
| 200 | SelectedType = null;
|
---|
[2952] | 201 | typesTreeView.Nodes[i].Nodes[j].Remove();
|
---|
[6954] | 202 | } else
|
---|
[2952] | 203 | j++;
|
---|
| 204 | }
|
---|
| 205 | if (typesTreeView.Nodes[i].Nodes.Count == 0)
|
---|
| 206 | typesTreeView.Nodes[i].Remove();
|
---|
| 207 | else
|
---|
| 208 | i++;
|
---|
| 209 | }
|
---|
[3516] | 210 | typesTreeView.EndUpdate();
|
---|
[2952] | 211 | currentSearchString = searchString;
|
---|
| 212 |
|
---|
| 213 | // if there is just one type node left, select by default
|
---|
| 214 | if (typesTreeView.Nodes.Count == 1) {
|
---|
| 215 | if (typesTreeView.Nodes[0].Nodes.Count == 1) {
|
---|
| 216 | typesTreeView.SelectedNode = typesTreeView.Nodes[0].Nodes[0];
|
---|
| 217 | }
|
---|
| 218 | }
|
---|
| 219 |
|
---|
[2655] | 220 | if (typesTreeView.Nodes.Count == 0) {
|
---|
[2952] | 221 | SelectedType = null;
|
---|
[2655] | 222 | typesTreeView.Enabled = false;
|
---|
| 223 | } else {
|
---|
[2952] | 224 | SetTreeNodeVisibility();
|
---|
| 225 | typesTreeView.Enabled = true;
|
---|
[2655] | 226 | }
|
---|
[2952] | 227 | UpdateDescription();
|
---|
[2655] | 228 | }
|
---|
| 229 | }
|
---|
| 230 |
|
---|
[2676] | 231 | public virtual object CreateInstanceOfSelectedType(params object[] args) {
|
---|
[2999] | 232 | if (SelectedType == null)
|
---|
| 233 | throw new InvalidOperationException("No type selected.");
|
---|
| 234 | else
|
---|
[2655] | 235 | return Activator.CreateInstance(SelectedType, args);
|
---|
| 236 | }
|
---|
| 237 |
|
---|
[3588] | 238 | protected virtual void UpdateTypeParameters() {
|
---|
| 239 | typeParametersListView.Items.Clear();
|
---|
| 240 | if ((SelectedType == null) || !SelectedType.ContainsGenericParameters) {
|
---|
| 241 | typeParametersGroupBox.Enabled = false;
|
---|
| 242 | typeParametersSplitContainer.Panel2Collapsed = true;
|
---|
| 243 | } else {
|
---|
| 244 | typeParametersGroupBox.Enabled = true;
|
---|
| 245 | typeParametersSplitContainer.Panel2Collapsed = false;
|
---|
| 246 | setTypeParameterButton.Enabled = false;
|
---|
| 247 |
|
---|
| 248 | foreach (Type param in SelectedType.GetGenericArguments()) {
|
---|
| 249 | if (param.IsGenericParameter) {
|
---|
| 250 | ListViewItem item = new ListViewItem();
|
---|
| 251 | item.Text = param.Name;
|
---|
| 252 |
|
---|
| 253 | item.ToolTipText = "Constraints:";
|
---|
| 254 | Type[] constraints = param.GetGenericParameterConstraints();
|
---|
| 255 | if (constraints.Length == 0) {
|
---|
| 256 | item.ToolTipText += " none";
|
---|
| 257 | } else {
|
---|
| 258 | foreach (Type constraint in constraints)
|
---|
| 259 | item.ToolTipText += " " + constraint.GetPrettyName();
|
---|
| 260 | }
|
---|
| 261 |
|
---|
| 262 | item.Tag = param;
|
---|
| 263 | typeParametersListView.Items.Add(item);
|
---|
| 264 | }
|
---|
| 265 | }
|
---|
| 266 | typeParametersListView.Columns[0].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
|
---|
| 267 | }
|
---|
[2655] | 268 | }
|
---|
| 269 |
|
---|
[3588] | 270 | protected virtual void SetTypeParameter() {
|
---|
| 271 | if (typeSelectorDialog == null) {
|
---|
| 272 | typeSelectorDialog = new TypeSelectorDialog();
|
---|
| 273 | typeSelectorDialog.Caption = "Select Type of Generic Type Parameter";
|
---|
| 274 | }
|
---|
| 275 | Type param = typeParametersListView.SelectedItems[0].Tag as Type;
|
---|
[5850] | 276 | Type[] constraints = param.GetGenericParameterConstraints();
|
---|
[5848] | 277 | bool showNotInstantiableTypes = !param.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint);
|
---|
[5898] | 278 | typeSelectorDialog.TypeSelector.Configure(constraints, showNotInstantiableTypes, true, true);
|
---|
[3588] | 279 |
|
---|
| 280 | if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
|
---|
| 281 | Type selected = typeSelectorDialog.TypeSelector.SelectedType;
|
---|
| 282 | Type[] parameters = SelectedType.GetGenericArguments();
|
---|
| 283 | parameters[param.GenericParameterPosition] = selected;
|
---|
| 284 | SelectedType = SelectedType.GetGenericTypeDefinition().MakeGenericType(parameters);
|
---|
| 285 |
|
---|
| 286 | typeParametersListView.SelectedItems[0].Text = param.Name + ": " + selected.GetPrettyName();
|
---|
| 287 | typeParametersListView.Columns[0].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
|
---|
| 288 | }
|
---|
| 289 | }
|
---|
| 290 |
|
---|
[2676] | 291 | protected virtual void UpdateDescription() {
|
---|
[2655] | 292 | descriptionTextBox.Text = string.Empty;
|
---|
| 293 |
|
---|
| 294 | if (typesTreeView.SelectedNode != null) {
|
---|
| 295 | IPluginDescription plugin = typesTreeView.SelectedNode.Tag as IPluginDescription;
|
---|
| 296 | if (plugin != null) {
|
---|
| 297 | StringBuilder sb = new StringBuilder();
|
---|
| 298 | sb.Append("Plugin: ").Append(plugin.Name).Append(Environment.NewLine);
|
---|
| 299 | sb.Append("Version: ").Append(plugin.Version.ToString()).Append(Environment.NewLine);
|
---|
| 300 | descriptionTextBox.Text = sb.ToString();
|
---|
| 301 | }
|
---|
| 302 | Type type = typesTreeView.SelectedNode.Tag as Type;
|
---|
| 303 | if (type != null) {
|
---|
| 304 | string description = ItemAttribute.GetDescription(type);
|
---|
| 305 | if (description != null)
|
---|
| 306 | descriptionTextBox.Text = description;
|
---|
| 307 | }
|
---|
[2952] | 308 | } else if (typesTreeView.Nodes.Count == 0) {
|
---|
| 309 | descriptionTextBox.Text = "No types found";
|
---|
[2655] | 310 | }
|
---|
| 311 | }
|
---|
| 312 |
|
---|
[3588] | 313 | #region Events
|
---|
| 314 | public event EventHandler SelectedTypeChanged;
|
---|
| 315 | protected virtual void OnSelectedTypeChanged() {
|
---|
| 316 | if (SelectedTypeChanged != null)
|
---|
| 317 | SelectedTypeChanged(this, EventArgs.Empty);
|
---|
| 318 | }
|
---|
| 319 | #endregion
|
---|
| 320 |
|
---|
| 321 | #region Control Events
|
---|
[2952] | 322 | protected virtual void searchTextBox_TextChanged(object sender, System.EventArgs e) {
|
---|
| 323 | Filter(searchTextBox.Text);
|
---|
| 324 | }
|
---|
| 325 |
|
---|
[2676] | 326 | protected virtual void typesTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
|
---|
[2952] | 327 | if (typesTreeView.SelectedNode == null) SelectedType = null;
|
---|
| 328 | else SelectedType = typesTreeView.SelectedNode.Tag as Type;
|
---|
[3588] | 329 | UpdateTypeParameters();
|
---|
[2655] | 330 | UpdateDescription();
|
---|
| 331 | }
|
---|
[2676] | 332 | protected virtual void typesTreeView_ItemDrag(object sender, ItemDragEventArgs e) {
|
---|
[2655] | 333 | TreeNode node = (TreeNode)e.Item;
|
---|
| 334 | Type type = node.Tag as Type;
|
---|
[2999] | 335 | if ((type != null) && (!type.IsInterface) && (!type.IsAbstract) && (!type.HasElementType) && (!type.ContainsGenericParameters)) {
|
---|
| 336 | object o = Activator.CreateInstance(type);
|
---|
| 337 | DataObject data = new DataObject();
|
---|
[5837] | 338 | data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, o);
|
---|
[2999] | 339 | DoDragDrop(data, DragDropEffects.Copy);
|
---|
[2655] | 340 | }
|
---|
| 341 | }
|
---|
[2952] | 342 | protected virtual void typesTreeView_VisibleChanged(object sender, EventArgs e) {
|
---|
| 343 | if (Visible) SetTreeNodeVisibility();
|
---|
| 344 | }
|
---|
| 345 |
|
---|
[3588] | 346 | protected virtual void typeParametersListView_SelectedIndexChanged(object sender, EventArgs e) {
|
---|
| 347 | setTypeParameterButton.Enabled = typeParametersListView.SelectedItems.Count == 1;
|
---|
| 348 | }
|
---|
| 349 | protected virtual void typeParametersListView_DoubleClick(object sender, EventArgs e) {
|
---|
| 350 | if (typeParametersListView.SelectedItems.Count == 1)
|
---|
| 351 | SetTypeParameter();
|
---|
| 352 | }
|
---|
| 353 |
|
---|
| 354 | protected virtual void setTypeParameterButton_Click(object sender, EventArgs e) {
|
---|
| 355 | SetTypeParameter();
|
---|
| 356 | }
|
---|
| 357 | #endregion
|
---|
| 358 |
|
---|
[2952] | 359 | #region Helpers
|
---|
| 360 | private void RestoreSelectedNode(TreeNode selectedNode) {
|
---|
| 361 | if (selectedNode != null) {
|
---|
| 362 | foreach (TreeNode node in typesTreeView.Nodes) {
|
---|
| 363 | if (node.Text.Equals(selectedNode.Text)) typesTreeView.SelectedNode = node;
|
---|
| 364 | foreach (TreeNode child in node.Nodes) {
|
---|
| 365 | if ((child.Text.Equals(selectedNode.Text)) && (child.Tag == selectedNode.Tag))
|
---|
| 366 | typesTreeView.SelectedNode = child;
|
---|
| 367 | }
|
---|
| 368 | }
|
---|
| 369 | if (typesTreeView.SelectedNode == null) SelectedType = null;
|
---|
| 370 | }
|
---|
| 371 | }
|
---|
| 372 | private void SetTreeNodeVisibility() {
|
---|
| 373 | TreeNode selectedNode = typesTreeView.SelectedNode;
|
---|
[2953] | 374 | if (string.IsNullOrEmpty(currentSearchString) && (typesTreeView.Nodes.Count > 1)) {
|
---|
[2952] | 375 | typesTreeView.CollapseAll();
|
---|
| 376 | if (selectedNode != null) typesTreeView.SelectedNode = selectedNode;
|
---|
| 377 | } else {
|
---|
| 378 | typesTreeView.ExpandAll();
|
---|
| 379 | }
|
---|
| 380 | if (selectedNode != null) selectedNode.EnsureVisible();
|
---|
| 381 | }
|
---|
| 382 | #endregion
|
---|
[2655] | 383 | }
|
---|
| 384 | }
|
---|