title: How to declare the default value of an enumerated property?
body: <p>How do i set the default value of an enumerated property?</p>
  
  <p>e.g.:  </p>
  
  <pre><code>public enum SearchBoxMode { Instant, Regular };
  
  
  [DefaultValue(SearchBoxMode.Instant)]
  public SearchBoxMode Mode { get { return mode; } set { mode = value;  } }    
  
  [DefaultValue((int)SearchBoxMode.Instant)]
  public SearchBoxMode Mode { get { return mode; } set { mode = value;  } }    
  
  [DefaultValue(SearchBoxMode.GetType(), "Instant")]
  public SearchBoxMode Mode { get { return mode; } set { mode = value;  } }    
  
  [DefaultValue(SearchBoxMode.GetType(), "SearchBoxMode.Instant")]
  public SearchBoxMode Mode { get { return mode; } set { mode = value;  } }    
  </code></pre>
  
  <hr>
  
  <p>Unrelated question: How do i get the <code>Type</code> of an enumeration? e.g.</p>
  
  <pre><code>Type type = DialogResult.GetType();
  </code></pre>
  
  <p>does not work.</p>