Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/17/13 10:05:34 (11 years ago)
Author:
ascheibe
Message:

#2100 merged r9915-r9916, r9920-r9921, r9935 into stable branch

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.MainForm/3.3/ViewAttribute.cs

    r9456 r9977  
    2828    public ViewAttribute(string name) {
    2929      this.name = name;
     30      this.helpResourcePath = string.Empty;
     31    }
     32
     33    public ViewAttribute(string name, string helpResourcePath) {
     34      this.name = name;
     35      this.helpResourcePath = helpResourcePath;
    3036    }
    3137
     
    3440      get { return this.name; }
    3541      set { this.name = value; }
     42    }
     43
     44    private string helpResourcePath;
     45    public string HelpResourcePath {
     46      get { return this.helpResourcePath; }
     47      set { this.helpResourcePath = value; }
    3648    }
    3749
     
    4759      return viewType.Name;
    4860    }
     61
     62    public static string GetHelpResourcePath(MemberInfo viewType) {
     63      ViewAttribute[] attributes = (ViewAttribute[])viewType.GetCustomAttributes(typeof(ViewAttribute), false);
     64      if (attributes.Length == 1)
     65        return attributes[0].helpResourcePath;
     66      return string.Empty;
     67    }
     68
     69    public static bool HasHelpResourcePath(MemberInfo viewType) {
     70      ViewAttribute[] attributes = (ViewAttribute[])viewType.GetCustomAttributes(typeof(ViewAttribute), false);
     71      if (attributes.Length == 1)
     72        return attributes[0].helpResourcePath != string.Empty;
     73      return false;
     74    }
    4975  }
    5076}
Note: See TracChangeset for help on using the changeset viewer.