Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/09/15 13:07:30 (9 years ago)
Author:
abeham
Message:

#2208: merged trunk changes

Location:
branches/HeuristicLab.Problems.Orienteering
Files:
66 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232  [Content(typeof(ICheckedItemCollection<>), true)]
    3333  [Content(typeof(CheckedItemCollection<>), true)]
     34  [Content(typeof(ReadOnlyCheckedItemCollection<>), true)]
    3435  public partial class CheckedItemCollectionView<T> : ItemCollectionView<T> where T : class, IItem {
    3536    public new ICheckedItemCollection<T> Content {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/CheckedItemListView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3535  [Content(typeof(CheckedItemList<>), true)]
    3636  [Content(typeof(ICheckedItemList<>), true)]
     37  [Content(typeof(ReadOnlyCheckedItemList<>), true)]
    3738  public partial class CheckedItemListView<T> : ItemListView<T> where T : class, IItem {
    3839    public new ICheckedItemList<T> Content {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/Clipboard.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/Clipboard.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using System.Collections.Generic;
    2525using System.IO;
     26using System.IO.Compression;
    2627using System.Linq;
    2728using System.Threading;
     
    198199          i++;
    199200          SetEnabledStateOfContentViews(item, false);
    200           XmlGenerator.Serialize(item, ItemsPath + Path.DirectorySeparatorChar + i.ToString("00000000") + ".hl", 9);
     201          XmlGenerator.Serialize(item, ItemsPath + Path.DirectorySeparatorChar + i.ToString("00000000") + ".hl", CompressionLevel.Optimal);
    201202          OnItemSaved(item, progressBar.Maximum / listView.Items.Count);
    202203        }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/CreateParameterDialog.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/CreateParameterDialog.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/EngineView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/EngineView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj

    r8600 r12694  
    1111    <RootNamespace>HeuristicLab.Core.Views</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Core.Views-3.3</AssemblyName>
    13     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1414    <TargetFrameworkProfile>
    1515    </TargetFrameworkProfile>
     
    4646    <WarningLevel>4</WarningLevel>
    4747    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     48    <Prefer32Bit>false</Prefer32Bit>
    4849  </PropertyGroup>
    4950  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    5758    </DocumentationFile>
    5859    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     60    <Prefer32Bit>false</Prefer32Bit>
    5961  </PropertyGroup>
    6062  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     
    6668    <ErrorReport>prompt</ErrorReport>
    6769    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     70    <Prefer32Bit>false</Prefer32Bit>
    6871  </PropertyGroup>
    6972  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     
    7780    <ErrorReport>prompt</ErrorReport>
    7881    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     82    <Prefer32Bit>false</Prefer32Bit>
    7983  </PropertyGroup>
    8084  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     
    8690    <ErrorReport>prompt</ErrorReport>
    8791    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     92    <Prefer32Bit>false</Prefer32Bit>
    8893  </PropertyGroup>
    8994  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     
    97102    <ErrorReport>prompt</ErrorReport>
    98103    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     104    <Prefer32Bit>false</Prefer32Bit>
    99105  </PropertyGroup>
    100106  <ItemGroup>
     
    146152    <Compile Include="LogView.Designer.cs">
    147153      <DependentUpon>LogView.cs</DependentUpon>
     154    </Compile>
     155    <Compile Include="NestingLevelErrorControl.cs">
     156      <SubType>UserControl</SubType>
     157    </Compile>
     158    <Compile Include="NestingLevelErrorControl.Designer.cs">
     159      <DependentUpon>NestingLevelErrorControl.cs</DependentUpon>
    148160    </Compile>
    149161    <Compile Include="Plugin.cs" />
     
    378390  -->
    379391  <PropertyGroup>
    380    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     392    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    381393set ProjectDir=$(ProjectDir)
    382394set SolutionDir=$(SolutionDir)
     
    385397call PreBuildEvent.cmd
    386398</PreBuildEvent>
    387 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     399    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    388400export ProjectDir=$(ProjectDir)
    389401export SolutionDir=$(SolutionDir)
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using System.Security.AccessControl;
    2223using System.Windows.Forms;
    2324
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemArrayView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using System.Drawing;
    2525using System.Linq;
     26using System.Text;
    2627using System.Windows.Forms;
    2728using HeuristicLab.Collections;
    2829using HeuristicLab.MainForm;
    29 using HeuristicLab.MainForm.WindowsForms;
    3030using HeuristicLab.PluginInfrastructure;
    3131
     
    3434  [Content(typeof(ItemArray<>), true)]
    3535  [Content(typeof(IItemArray<>), false)]
     36  [Content(typeof(ReadOnlyItemArray<>), true)]
    3637  public partial class ItemArrayView<T> : ItemView where T : class, IItem {
    3738    protected Dictionary<T, List<ListViewItem>> itemListViewItemMapping;
     
    141142        try {
    142143          return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    143         }
    144         catch (Exception ex) {
     144        } catch (Exception ex) {
    145145          ErrorHandling.ShowErrorDialog(this, ex);
    146146        }
     
    256256          foreach (ListViewItem item in itemsListView.SelectedItems)
    257257            Content[item.Index] = null;
     258        }
     259      } else if (e.KeyData == (Keys.Control | Keys.C)) {
     260        if (itemsListView.SelectedItems.Count > 0) {
     261          var builder = new StringBuilder();
     262          foreach (ListViewItem selected in itemsListView.SelectedItems) {
     263            builder.AppendLine(selected.Text);
     264          }
     265          Clipboard.SetText(builder.ToString());
    258266        }
    259267      }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using System.Security.AccessControl;
    2223using System.Windows.Forms;
    2324
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using System.Collections.Generic;
    2525using System.Linq;
     26using System.Text;
    2627using System.Windows.Forms;
    2728using HeuristicLab.Collections;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.MainForm;
    30 using HeuristicLab.MainForm.WindowsForms;
    3131using HeuristicLab.PluginInfrastructure;
    3232
     
    3535  [Content(typeof(ItemCollection<>), true)]
    3636  [Content(typeof(IItemCollection<>), false)]
     37  [Content(typeof(ReadOnlyItemCollection<>), true)]
    3738  public partial class ItemCollectionView<T> : ItemView where T : class, IItem {
    3839    protected Dictionary<T, List<ListViewItem>> itemListViewItemMapping;
     
    140141        try {
    141142          return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    142         }
    143         catch (Exception ex) {
     143        } catch (Exception ex) {
    144144          ErrorHandling.ShowErrorDialog(this, ex);
    145145        }
     
    242242          }
    243243        }
     244      } else if (e.KeyData == (Keys.Control | Keys.C)) {
     245        if (itemsListView.SelectedItems.Count > 0) {
     246          var builder = new StringBuilder();
     247          foreach (ListViewItem selected in itemsListView.SelectedItems) {
     248            builder.AppendLine(selected.Text);
     249          }
     250          Clipboard.SetText(builder.ToString());
     251        }
    244252      }
    245253    }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2525using System.Drawing;
    2626using System.Linq;
     27using System.Text;
    2728using System.Windows.Forms;
    2829using HeuristicLab.Collections;
    2930using HeuristicLab.Common;
    3031using HeuristicLab.MainForm;
    31 using HeuristicLab.MainForm.WindowsForms;
    3232using HeuristicLab.PluginInfrastructure;
    3333
     
    3636  [Content(typeof(ItemList<>), true)]
    3737  [Content(typeof(IItemList<>), false)]
     38  [Content(typeof(ReadOnlyItemList<>), true)]
    3839  public partial class ItemListView<T> : ItemView where T : class, IItem {
    3940    protected Dictionary<T, List<ListViewItem>> itemListViewItemMapping;
     
    146147        try {
    147148          return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    148         }
    149         catch (Exception ex) {
     149        } catch (Exception ex) {
    150150          ErrorHandling.ShowErrorDialog(this, ex);
    151151        }
     
    261261          foreach (ListViewItem item in itemsListView.SelectedItems)
    262262            Content.RemoveAt(item.Index);
     263        }
     264      } else if (e.KeyData == (Keys.Control | Keys.C)) {
     265        if (itemsListView.SelectedItems.Count > 0) {
     266          var builder = new StringBuilder();
     267          foreach (ListViewItem selected in itemsListView.SelectedItems) {
     268            builder.AppendLine(selected.Text);
     269          }
     270          Clipboard.SetText(builder.ToString());
    263271        }
    264272      }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemSetView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemSetView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2828  [Content(typeof(ItemSet<>), true)]
    2929  [Content(typeof(IItemSet<>), false)]
     30  [Content(typeof(ReadOnlyItemSet<>), true)]
    3031  public partial class ItemSetView<T> : ItemCollectionView<T> where T : class, IItem {
    3132    protected bool draggedItemsAlreadyContained;
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ItemView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using System;
     23using System.Windows.Forms;
    2224using HeuristicLab.MainForm.WindowsForms;
    2325
     
    2729  /// </summary>
    2830  public partial class ItemView : AsynchronousContentView {
     31    public const int MaximumNestingLevel = 35;
     32
    2933    public new IItem Content {
    3034      get { return (IItem)base.Content; }
     
    3842      InitializeComponent();
    3943    }
     44
     45    protected override void OnInitialized(EventArgs e) {
     46      base.OnInitialized(e);
     47
     48      if (CountParentControls() > MaximumNestingLevel) {
     49        //capture content, needed because it is set at a later time
     50        NestingLevelErrorControl errorControl = new NestingLevelErrorControl(() => Content, this.GetType());
     51        errorControl.Dock = DockStyle.Fill;
     52
     53        Controls.Clear();
     54        Controls.Add(errorControl);
     55      }
     56    }
     57
     58    private int CountParentControls() {
     59      int cnt = 0;
     60      Control parent = Parent;
     61      while (parent != null) {
     62        parent = parent.Parent;
     63        cnt++;
     64      }
     65      return cnt;
     66    }
    4067  }
    4168}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/LogView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/LogView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/MovieView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/MovieView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/NamedItemView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/NamedItemView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorGraphView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorGraphView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorListView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorListView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorSetView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorSetView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorTreeView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorsSidebar.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/OperatorsSidebar.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ParameterCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ParameterizedNamedItemView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ParameterizedNamedItemView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/Plugin.cs.frame

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2626  /// Plugin class for HeuristicLab.Core.Views plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Core.Views", "3.3.10.$WCREV$")]
     28  [Plugin("HeuristicLab.Core.Views", "3.3.11.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Core.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/Properties/AssemblyInfo.cs.frame

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232[assembly: AssemblyCompany("")]
    3333[assembly: AssemblyProduct("HeuristicLab")]
    34 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
     34[assembly: AssemblyCopyright("(c) 2002-2015 HEAL")]
    3535[assembly: AssemblyTrademark("")]
    3636[assembly: AssemblyCulture("")]
     
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.10.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ScopeListView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ScopeListView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ScopeView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ScopeView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/TextDialog.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/TextDialog.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/TypeSelector.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4242      this.searchLabel = new System.Windows.Forms.Label();
    4343      this.searchTextBox = new System.Windows.Forms.TextBox();
     44      this.clearSearchButton = new System.Windows.Forms.Button();
     45      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
     46      this.expandToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     47      this.expandAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     48      this.collapseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     49      this.collapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    4450      this.typeParametersGroupBox = new System.Windows.Forms.GroupBox();
    4551      this.setTypeParameterButton = new System.Windows.Forms.Button();
     
    5662      this.typeParametersSplitContainer.SuspendLayout();
    5763      this.typeParametersGroupBox.SuspendLayout();
     64      this.contextMenuStrip.SuspendLayout();
    5865      this.SuspendLayout();
    5966      //
     
    7582      this.typesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.typesTreeView_AfterSelect);
    7683      this.typesTreeView.VisibleChanged += new System.EventHandler(this.typesTreeView_VisibleChanged);
     84      this.typesTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.typesTreeView_MouseDown);
    7785      //
    7886      // imageList
     
    146154      this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    147155                  | System.Windows.Forms.AnchorStyles.Right)));
     156      this.searchTextBox.Controls.Add(this.clearSearchButton);
    148157      this.searchTextBox.Location = new System.Drawing.Point(29, 3);
    149158      this.searchTextBox.Name = "searchTextBox";
    150159      this.searchTextBox.Size = new System.Drawing.Size(193, 20);
    151160      this.searchTextBox.TabIndex = 1;
    152       this.toolTip.SetToolTip(this.searchTextBox, "Enter string to search for types");
     161      this.toolTip.SetToolTip(this.searchTextBox, "Filters the available Types.\r\nThe search term is tokenized by space and a name ha" +
     162        "s to contain all tokens to be displayed.\r\n(E.g. \"Sym Reg\" matches \"SymbolicRegr" +
     163        "ession\")");
    153164      this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
     165      this.searchTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchTextBox_KeyDown);
     166      //
     167      // clearSearchButton
     168      //
     169      this.clearSearchButton.BackColor = System.Drawing.Color.Transparent;
     170      this.clearSearchButton.Cursor = System.Windows.Forms.Cursors.Default;
     171      this.clearSearchButton.Dock = System.Windows.Forms.DockStyle.Right;
     172      this.clearSearchButton.FlatAppearance.BorderSize = 0;
     173      this.clearSearchButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     174      this.clearSearchButton.ForeColor = System.Drawing.Color.Transparent;
     175      this.clearSearchButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Delete;
     176      this.clearSearchButton.Location = new System.Drawing.Point(543, 0);
     177      this.clearSearchButton.Margin = new System.Windows.Forms.Padding(0);
     178      this.clearSearchButton.Name = "clearSearchButton";
     179      this.clearSearchButton.Size = new System.Drawing.Size(15, 16);
     180      this.clearSearchButton.TabIndex = 0;
     181      this.clearSearchButton.TabStop = false;
     182      this.clearSearchButton.UseVisualStyleBackColor = false;
     183      this.clearSearchButton.Click += new System.EventHandler(this.clearSearchButton_Click);
    154184      //
    155185      // typeParametersGroupBox
     
    213243      this.descriptionTextBox.Size = new System.Drawing.Size(219, 114);
    214244      this.descriptionTextBox.TabIndex = 0;
     245      //
     246      // contextMenuStrip
     247      //
     248      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     249            this.expandToolStripMenuItem,
     250            this.expandAllToolStripMenuItem,
     251            this.collapseToolStripMenuItem,
     252            this.collapseAllToolStripMenuItem});
     253      this.contextMenuStrip.Name = "contextMenuStrip";
     254      this.contextMenuStrip.Size = new System.Drawing.Size(137, 92);
     255      //
     256      // expandToolStripMenuItem
     257      //
     258      this.expandToolStripMenuItem.Name = "expandToolStripMenuItem";
     259      this.expandToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     260      this.expandToolStripMenuItem.Text = "Expand";
     261      this.expandToolStripMenuItem.Click += new System.EventHandler(this.expandToolStripMenuItem_Click);
     262      //
     263      // expandAllToolStripMenuItem
     264      //
     265      this.expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem";
     266      this.expandAllToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     267      this.expandAllToolStripMenuItem.Text = "Expand All";
     268      this.expandAllToolStripMenuItem.Click += new System.EventHandler(this.expandAllToolStripMenuItem_Click);
     269      //
     270      // collapseToolStripMenuItem
     271      //
     272      this.collapseToolStripMenuItem.Name = "collapseToolStripMenuItem";
     273      this.collapseToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     274      this.collapseToolStripMenuItem.Text = "Collapse";
     275      this.collapseToolStripMenuItem.Click += new System.EventHandler(this.collapseToolStripMenuItem_Click);
     276      //
     277      // collapseAllToolStripMenuItem
     278      //
     279      this.collapseAllToolStripMenuItem.Name = "collapseAllToolStripMenuItem";
     280      this.collapseAllToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     281      this.collapseAllToolStripMenuItem.Text = "Collapse All";
     282      this.collapseAllToolStripMenuItem.Click += new System.EventHandler(this.collapseAllToolStripMenuItem_Click);
    215283      //
    216284      // TypeSelector
     
    231299      this.typeParametersSplitContainer.ResumeLayout(false);
    232300      this.typeParametersGroupBox.ResumeLayout(false);
     301      this.contextMenuStrip.ResumeLayout(false);
    233302      this.ResumeLayout(false);
    234303
     
    244313    protected System.Windows.Forms.Label searchLabel;
    245314    protected System.Windows.Forms.TextBox searchTextBox;
     315    protected System.Windows.Forms.Button clearSearchButton;
    246316    protected System.Windows.Forms.ToolTip toolTip;
     317    protected System.Windows.Forms.ContextMenuStrip contextMenuStrip;
     318    protected System.Windows.Forms.ToolStripMenuItem expandToolStripMenuItem;
     319    protected System.Windows.Forms.ToolStripMenuItem expandAllToolStripMenuItem;
     320    protected System.Windows.Forms.ToolStripMenuItem collapseToolStripMenuItem;
     321    protected System.Windows.Forms.ToolStripMenuItem collapseAllToolStripMenuItem;
    247322    protected System.Windows.Forms.SplitContainer typeParametersSplitContainer;
    248323    protected System.Windows.Forms.GroupBox typeParametersGroupBox;
     
    250325    protected System.Windows.Forms.Button setTypeParameterButton;
    251326    protected System.Windows.Forms.ColumnHeader columnHeader1;
    252 
    253327  }
    254328}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/TypeSelector.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
     24using System.Drawing;
    2425using System.Linq;
    2526using System.Reflection;
     
    177178      else {
    178179        searchString = searchString.ToLower();
     180        TreeNode selectedNode = typesTreeView.SelectedNode;
    179181
    180182        if (!searchString.Contains(currentSearchString)) {
    181183          typesTreeView.BeginUpdate();
    182184          // expand search -> restore all tree nodes
    183           TreeNode selectedNode = typesTreeView.SelectedNode;
    184185          typesTreeView.Nodes.Clear();
    185186          foreach (TreeNode node in treeNodes)
    186187            typesTreeView.Nodes.Add((TreeNode)node.Clone());
    187           RestoreSelectedNode(selectedNode);
    188188          typesTreeView.EndUpdate();
    189189        }
    190 
    191190
    192191        // remove nodes
    193192        typesTreeView.BeginUpdate();
     193        var searchTokens = searchString.Split(' ');
    194194        int i = 0;
    195195        while (i < typesTreeView.Nodes.Count) {
    196           int j = 0;
    197           while (j < typesTreeView.Nodes[i].Nodes.Count) {
    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;
    201               typesTreeView.Nodes[i].Nodes[j].Remove();
    202             } else
    203               j++;
    204           }
    205           if (typesTreeView.Nodes[i].Nodes.Count == 0)
    206             typesTreeView.Nodes[i].Remove();
    207           else
    208             i++;
     196          var node = typesTreeView.Nodes[i];
     197          bool remove = FilterNode(node, searchTokens);
     198          if (remove)
     199            typesTreeView.Nodes.RemoveAt(i);
     200          else i++;
    209201        }
    210202        typesTreeView.EndUpdate();
    211203        currentSearchString = searchString;
    212204
    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         }
     205        // select first item
     206        typesTreeView.BeginUpdate();
     207        var firstNode = typesTreeView.Nodes.Count > 0 ? typesTreeView.Nodes[0] : null;
     208        while (firstNode != null && !(firstNode.Tag is Type))
     209          firstNode = firstNode.NextVisibleNode;
     210        if (firstNode != null)
     211          typesTreeView.SelectedNode = firstNode;
    219212
    220213        if (typesTreeView.Nodes.Count == 0) {
     
    225218          typesTreeView.Enabled = true;
    226219        }
     220        typesTreeView.EndUpdate();
     221
     222        RestoreSelectedNode(selectedNode);
    227223        UpdateDescription();
    228224      }
     225    }
     226
     227    private bool FilterNode(TreeNode node, string[] searchTokens) {
     228      if (node.Tag is IPluginDescription) { // Plugin node
     229        int i = 0;
     230        while (i < node.Nodes.Count) {
     231          bool remove = FilterNode(node.Nodes[i], searchTokens);
     232          if (remove)
     233            node.Nodes.RemoveAt(i);
     234          else i++;
     235        }
     236        return node.Nodes.Count == 0;
     237      } if (node.Tag is Type) { // Type node
     238        var text = node.Text;
     239        if (searchTokens.Any(searchToken => !text.ToLower().Contains(searchToken))) {
     240          var typeTag = (Type)node.Tag;
     241          if (typeTag == SelectedType) {
     242            SelectedType = null;
     243            typesTreeView.SelectedNode = null;
     244          }
     245          return true;
     246        }
     247        return false;
     248      }
     249      throw new InvalidOperationException("Encountered neither a plugin nor a type node during tree traversal.");
    229250    }
    230251
     
    355376      SetTypeParameter();
    356377    }
     378    private void searchTextBox_KeyDown(object sender, KeyEventArgs e) {
     379      if (typesTreeView.Nodes.Count == 0)
     380        return;
     381
     382      if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) {
     383        var selectedNode = typesTreeView.SelectedNode;
     384
     385        if (selectedNode == null) { // nothing selected => select first
     386          if (e.KeyCode == Keys.Down) typesTreeView.SelectedNode = typesTreeView.Nodes.Count > 0 ? typesTreeView.Nodes[0] : null;
     387        } else {
     388          if (e.KeyCode == Keys.Down && selectedNode.NextVisibleNode != null)
     389            typesTreeView.SelectedNode = selectedNode.NextVisibleNode;
     390          if (e.KeyCode == Keys.Up && selectedNode.PrevVisibleNode != null)
     391            typesTreeView.SelectedNode = selectedNode.PrevVisibleNode;
     392        }
     393        e.Handled = true;
     394      }
     395    }
     396    private void clearSearchButton_Click(object sender, EventArgs e) {
     397      searchTextBox.Text = string.Empty;
     398      searchTextBox.Focus();
     399    }
     400
     401    private TreeNode toolStripMenuNode = null;
     402    private void typesTreeView_MouseDown(object sender, MouseEventArgs e) {
     403      if (e.Button == MouseButtons.Right) {
     404        Point coordinates = typesTreeView.PointToClient(Cursor.Position);
     405        toolStripMenuNode = typesTreeView.GetNodeAt(coordinates);
     406
     407        if (toolStripMenuNode != null && coordinates.X >= toolStripMenuNode.Bounds.Left &&
     408            coordinates.X <= toolStripMenuNode.Bounds.Right) {
     409          typesTreeView.SelectedNode = toolStripMenuNode;
     410
     411          expandToolStripMenuItem.Enabled =
     412            expandToolStripMenuItem.Visible = !toolStripMenuNode.IsExpanded && toolStripMenuNode.Nodes.Count > 0;
     413          collapseToolStripMenuItem.Enabled = collapseToolStripMenuItem.Visible = toolStripMenuNode.IsExpanded;
     414        } else {
     415          expandToolStripMenuItem.Enabled = expandToolStripMenuItem.Visible = false;
     416          collapseToolStripMenuItem.Enabled = collapseToolStripMenuItem.Visible = false;
     417        }
     418        expandAllToolStripMenuItem.Enabled =
     419          expandAllToolStripMenuItem.Visible =
     420            !typesTreeView.Nodes.OfType<TreeNode>().All(x => TreeNodeIsFullyExpanded(x));
     421        collapseAllToolStripMenuItem.Enabled =
     422          collapseAllToolStripMenuItem.Visible = typesTreeView.Nodes.OfType<TreeNode>().Any(x => x.IsExpanded);
     423        if (contextMenuStrip.Items.Cast<ToolStripMenuItem>().Any(item => item.Enabled))
     424          contextMenuStrip.Show(Cursor.Position);
     425      }
     426    }
     427    private bool TreeNodeIsFullyExpanded(TreeNode node) {
     428      return (node.Nodes.Count == 0) || (node.IsExpanded && node.Nodes.OfType<TreeNode>().All(x => TreeNodeIsFullyExpanded(x)));
     429    }
     430    private void expandToolStripMenuItem_Click(object sender, EventArgs e) {
     431      typesTreeView.BeginUpdate();
     432      if (toolStripMenuNode != null) toolStripMenuNode.ExpandAll();
     433      typesTreeView.EndUpdate();
     434    }
     435    private void expandAllToolStripMenuItem_Click(object sender, EventArgs e) {
     436      typesTreeView.BeginUpdate();
     437      typesTreeView.ExpandAll();
     438      typesTreeView.EndUpdate();
     439    }
     440    private void collapseToolStripMenuItem_Click(object sender, EventArgs e) {
     441      typesTreeView.BeginUpdate();
     442      if (toolStripMenuNode != null) toolStripMenuNode.Collapse();
     443      typesTreeView.EndUpdate();
     444    }
     445    private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e) {
     446      typesTreeView.BeginUpdate();
     447      typesTreeView.CollapseAll();
     448      typesTreeView.EndUpdate();
     449    }
    357450    #endregion
    358451
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/VariableCollectionView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/VariableCollectionView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/VariableValueView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/VariableValueView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core.Views/3.3/VariableView.cs

    r11185 r12694  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
Note: See TracChangeset for help on using the changeset viewer.