Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/12/13 16:59:51 (11 years ago)
Author:
sforsten
Message:

#2022:

  • the properties of Item are cached
  • added solution file and build commands
Location:
branches/ImprovingItemListView
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ImprovingItemListView

    • Property svn:ignore set to
      *.suo
  • branches/ImprovingItemListView/HeuristicLab.Core/3.3/Item.cs

    r7259 r9314  
    3232  [Item("Item", "Base class for all HeuristicLab items.")]
    3333  public abstract class Item : IItem {
     34    private string itemName;
    3435    public virtual string ItemName {
    35       get { return ItemAttribute.GetName(this.GetType()); }
     36      get {
     37        if (itemName == null) {
     38          itemName = ItemAttribute.GetName(this.GetType());
     39        }
     40        return itemName;
     41      }
    3642    }
     43    private string itemDescription;
    3744    public virtual string ItemDescription {
    38       get { return ItemAttribute.GetDescription(this.GetType()); }
     45      get {
     46        if (itemName == null) {
     47          itemName = ItemAttribute.GetDescription(this.GetType());
     48        }
     49        return itemName;
     50      }
    3951    }
     52    private Version itemVersion;
    4053    public Version ItemVersion {
    41       get { return ItemAttribute.GetVersion(this.GetType()); }
     54      get {
     55        if (itemVersion == null) {
     56          itemVersion = ItemAttribute.GetVersion(this.GetType());
     57        }
     58        return itemVersion;
     59      }
    4260    }
    4361    public static Image StaticItemImage {
    4462      get { return HeuristicLab.Common.Resources.VSImageLibrary.Class; }
    4563    }
     64    private Image itemImage;
    4665    public virtual Image ItemImage {
    47       get { return ItemAttribute.GetImage(this.GetType()); }
     66      get {
     67        if (itemImage == null) {
     68          itemImage = ItemAttribute.GetImage(this.GetType());
     69        }
     70        return itemImage;
     71      }
    4872    }
    4973
Note: See TracChangeset for help on using the changeset viewer.