Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/10 16:15:21 (14 years ago)
Author:
mkommend
Message:

first version of redesigned MainForm (ticket #857)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm/3.2/ContentAttribute.cs

    r2540 r2696  
    1919 */
    2020#endregion
     21
    2122using System;
    2223using System.Collections.Generic;
     
    5051    public static bool CanViewType(Type viewType, Type content) {
    5152      ContentAttribute[] attributes = (ContentAttribute[])viewType.GetCustomAttributes(typeof(ContentAttribute), false);
    52       return attributes.Any(a => a.type.IsAssignableFrom(content));
     53      return attributes.Any(a => content.IsAssignableTo(a.type));
    5354    }
    5455
    55     public static IEnumerable<Type> GetViewableTypes(Type viewType) {
    56       ContentAttribute[] attributes = (ContentAttribute[])viewType.GetCustomAttributes(typeof(ContentAttribute), false);
    57       return from a in attributes
    58              select a.type;
    59     }
    60 
    61     public static bool IsDefaultViewForType(Type viewType, Type content) {
    62       ContentAttribute[] attributes = (ContentAttribute[])viewType.GetCustomAttributes(typeof(ContentAttribute), false);
    63       return attributes.Any(a => a.isDefaultView && a.type == content);
    64     }
    65 
    66     public static IEnumerable<Type> GetDefaultViewableTypes(Type viewType) {
     56    internal static IEnumerable<Type> GetDefaultViewableTypes(Type viewType) {
    6757      ContentAttribute[] attributes = (ContentAttribute[])viewType.GetCustomAttributes(typeof(ContentAttribute), false);
    6858      return from a in attributes
Note: See TracChangeset for help on using the changeset viewer.