title: Can an attribute references an embeded resource?
body: <p>I'm working on an application that generates a tree structure of nodes. There are many types of nodes, each with specific behavior and properties. I want to attribute each node type with properties including a display name, description, and a 16x16 icon. </p>
  
  <p>Here's the code for the custom attribute I created:</p>
  
  <pre><code>public class NodeTypeInfoAttribute : Attribute
  {
      public NodeTypeInfoAttribute(string displayName, string description, System.Drawing.Image icon)
          : this(displayName, description)
      {
          this.Icon = icon;
      }
  
      public NodeTypeInfoAttribute(string displayName, string description, string iconPath):this(displayName,description)
      {
  
          String absPath;
          if (System.IO.Path.IsPathRooted(iconPath))
          {
              absPath = iconPath;
          }
          else
          {
              string folder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
              absPath = System.IO.Path.Combine(folder, iconPath);
          }
  
          try
          {
              System.Drawing.Image i = System.Drawing.Image.FromFile(absPath);
          }
          catch (System.IO.FileNotFoundException)
          {
              Icon = null;
          }
      }
  
      public NodeTypeInfoAttribute(string displayName, string description)
      {
          this.DisplayName = displayName;
          this.Description = description;
      }
  
      public string DisplayName
      {
          get;
          private set;
      }
  
  
      public string Description
      {
          get;
          private set;
      }
  
      public System.Drawing.Image Icon
      {
          get;
          set;
      }
  
  }
  </code></pre>
  
  <p>Note that I have a constructor that specifies the Icon as a file path, and a constructor that specifies the icon as a <code>System.Drawing.Image</code>. </p>
  
  <p>So ultimately I'd like to be able to use this attribute with an embedded image resource like this.</p>
  
  <pre><code>[NodeTypeInfo("My Node","Sample Description",Properties.Resources.CustomIcon)]
  public class CustomNode:Node
  {
  ...
  </code></pre>
  
  <p>However, this code returns the error</p>
  
  <pre><code>An attribute argument must be a constant expression, typeof expression or 
  array creation` expression of an attribute parameter type
  </code></pre>
  
  <p>Is there some other way I can associate a Type (not an instance) of a class with an icon image?</p>