Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/19/11 03:17:35 (13 years ago)
Author:
swagner
Message:

Implemented static item image properties to avoid instance creation in TypeSelector and NewItemDialog (#1651)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Attributes/ItemAttribute.cs

    r5445 r7201  
    2121
    2222using System;
     23using System.Drawing;
    2324using System.Linq;
    2425using System.Reflection;
     
    8283      }
    8384    }
     85    public static Image GetImage(Type type) {
     86      var staticItemImageProperty = type.GetProperty("StaticItemImage", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
     87      return staticItemImageProperty == null ? null : (Image)staticItemImageProperty.GetValue(null, null);
     88    }
    8489  }
    8590}
Note: See TracChangeset for help on using the changeset viewer.