Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/14/11 13:59:25 (13 years ago)
Author:
epitzer
Message:

#1530 integrate changes from trunk

Location:
branches/PersistenceSpeedUp
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceSpeedUp

  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs

    r5445 r6760  
    2020#endregion
    2121
     22using System.Drawing;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Collections;
     
    4950    }
    5051
     52    private Color backupColor = Color.Empty;
    5153    protected override void SetEnabledStateOfControls() {
     54      if (backupColor == Color.Empty) backupColor = base.itemsListView.BackColor;
    5255      base.SetEnabledStateOfControls();
    53       base.itemsListView.Enabled = !this.Locked;
     56      if (ReadOnly || Locked)
     57        base.itemsListView.BackColor = ListView.DefaultBackColor;
     58      else
     59        base.itemsListView.BackColor = backupColor;
    5460    }
    5561
     
    7076        bool check = e.NewValue == CheckState.Checked;
    7177        if (Content.ItemChecked(checkedItem) != check) {
    72           Content.SetItemCheckedState(checkedItem, check);
     78          if (!ReadOnly && !Locked) Content.SetItemCheckedState(checkedItem, check);
     79          else e.NewValue = e.CurrentValue;
    7380        }
    7481      }
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs

    r5445 r6760  
    2020#endregion
    2121
     22using System.Drawing;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Collections;
     
    5152    }
    5253
     54    private Color backupColor = Color.Empty;
    5355    protected override void SetEnabledStateOfControls() {
     56      if(backupColor == Color.Empty) backupColor = base.itemsListView.BackColor;
    5457      base.SetEnabledStateOfControls();
    55       base.itemsListView.Enabled = !this.Locked;
     58      if (ReadOnly || Locked)
     59        base.itemsListView.BackColor = ListView.DefaultBackColor;
     60      else
     61        base.itemsListView.BackColor = backupColor;
    5662    }
    5763
     
    7278        bool check = e.NewValue == CheckState.Checked;
    7379        if (Content.ItemChecked(checkedItem) != check) {
    74           Content.SetItemCheckedState(checkedItem, check);
     80          if (!ReadOnly && !Locked) Content.SetItemCheckedState(checkedItem, check);
     81          else e.NewValue = e.CurrentValue;
    7582        }
    7683      }
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/Clipboard.cs

    r5839 r6760  
    2727using System.Threading;
    2828using System.Windows.Forms;
     29using HeuristicLab.Common;
    2930using HeuristicLab.MainForm;
    3031using HeuristicLab.Persistence.Default.Xml;
     
    321322          } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) {
    322323            IEnumerable<T> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<T>();
     324            if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     325              Cloner cloner = new Cloner();
     326              items = items.Select(x => cloner.Clone(x));
     327            }
    323328            foreach (T item in items)
    324               AddItem(e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() : item);
     329              AddItem(item);
    325330          }
    326331        }
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/HeuristicLabCoreViewsPlugin.cs.frame

    r6099 r6760  
    2626  /// Plugin class for HeuristicLab.Core.Views plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Core.Views", "3.3.4.$WCREV$")]
     28  [Plugin("HeuristicLab.Core.Views", "3.3.5.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Core.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r5839 r6760  
    2626using System.Windows.Forms;
    2727using HeuristicLab.Collections;
     28using HeuristicLab.Common;
    2829using HeuristicLab.MainForm;
    2930using HeuristicLab.MainForm.WindowsForms;
     
    4243      get { return (IItemCollection<T>)base.Content; }
    4344      set { base.Content = value; }
     45    }
     46
     47    public bool ShowDetails {
     48      get { return showDetailsCheckBox.Checked; }
     49      set { showDetailsCheckBox.Checked = value; }
    4450    }
    4551
     
    294300        } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) {
    295301          IEnumerable<T> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<T>();
     302          if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     303            Cloner cloner = new Cloner();
     304            items = items.Select(x => cloner.Clone(x));
     305          }
    296306          foreach (T item in items)
    297             Content.Add(e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() : item);
     307            Content.Add(item);
    298308        }
    299309      }
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r5928 r6760  
    2727using System.Windows.Forms;
    2828using HeuristicLab.Collections;
     29using HeuristicLab.Common;
    2930using HeuristicLab.MainForm;
    3031using HeuristicLab.MainForm.WindowsForms;
     
    334335        } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) {
    335336          IEnumerable<T> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<T>();
     337          if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     338            Cloner cloner = new Cloner();
     339            items = items.Select(x => cloner.Clone(x));
     340          }
    336341          foreach (T item in items) {
    337             if (listViewItem != null) Content.Insert(listViewItem.Index, e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() : item);
    338             else Content.Add(e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() : item);
     342            if (listViewItem != null) Content.Insert(listViewItem.Index, item);
     343            else Content.Add(item);
    339344          }
    340345        }
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/Properties/AssemblyInfo.frame

    r6099 r6760  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.4.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.5.$WCREV$")]
  • branches/PersistenceSpeedUp/HeuristicLab.Core.Views/3.3/TypeSelector.cs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/GP.Grammar.Editor/HeuristicLab.Core.Views/3.3/TypeSelector.csmergedeligible
      /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.csmergedeligible
      /branches/CloningRefactoring/HeuristicLab.Core.Views/3.3/TypeSelector.cs4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Core.Views/3.3/TypeSelector.cs5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Core.Views/3.3/TypeSelector.cs5815-6180
      /branches/DataAnalysis/HeuristicLab.Core.Views/3.3/TypeSelector.cs4458-4459,​4462,​4464
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Core.Views/3.3/TypeSelector.cs5060
      /branches/NET40/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs5138-5162
      /branches/ParallelEngine/HeuristicLab.Core.Views/3.3/TypeSelector.cs5175-5192
      /branches/QAPAlgorithms/HeuristicLab.Core.Views/3.3/TypeSelector.cs6350-6627
      /branches/SuccessProgressAnalysis/HeuristicLab.Core.Views/3.3/TypeSelector.cs5370-5682
      /branches/VNS/HeuristicLab.Core.Views/3.3/TypeSelector.cs5594-5752
      /branches/histogram/HeuristicLab.Core.Views/3.3/TypeSelector.cs5959-6341
    r6019 r6760  
    8686
    8787    public virtual void Configure(Type baseType, bool showNotInstantiableTypes, bool showGenericTypes) {
    88       Configure(new List<Type>() { baseType }, showNotInstantiableTypes, showGenericTypes, true);
     88      Configure(baseType, showNotInstantiableTypes, showGenericTypes, (t) => true);
     89    }
     90
     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);
    8993    }
    9094
    9195    public virtual void Configure(IEnumerable<Type> baseTypes, bool showNotInstantiableTypes, bool showGenericTypes, bool assignableToAllTypes) {
     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) {
    92100      if (baseTypes == null) throw new ArgumentNullException();
    93101      if (InvokeRequired)
    94         Invoke(new Action<IEnumerable<Type>, bool, bool, bool>(Configure), baseTypes, showNotInstantiableTypes, showGenericTypes, assignableToAllTypes);
     102        Invoke(new Action<IEnumerable<Type>, bool, bool, bool, Func<Type, bool>>(Configure), baseTypes, showNotInstantiableTypes, showGenericTypes, assignableToAllTypes, typeCondition);
    95103      else {
    96104        this.baseTypes = baseTypes;
     
    120128
    121129          var types = from t in ApplicationManager.Manager.GetTypes(BaseTypes, plugin, !ShowNotInstantiableTypes, assignableToAllTypes)
     130                      where typeCondition(t)
    122131                      orderby t.Name ascending
    123132                      select t;
Note: See TracChangeset for help on using the changeset viewer.