title: Setting flag variable in c# web application
body: <p>I have written one code Using property in text box and I am setting some values like this </p>
  
  <pre><code>public string Color
  { 
  get{}; 
  set
    { 
       SetColor(value);
    } 
  } 
  
  private void SetColor(string level)
  {
      switch(level.ToLower())
      {
       case "high":
       textbox1.BackColor = System.Drawing.Color.Red;
       break;
  
       case "medium":
       textbox1.BackColor = System.Drawing.Color.Green;
       break;
  
       case "low":
       textbox1.BackColor = System.Drawing.Color.Yellow;
       break;
     }
  }
  </code></pre>
  
  <p>But my main aim is that I need to set flag, if the flag is High it should show red font, similarly if the flag is medium it should show yellow font in label.</p>
  
  <pre><code>public static class EnumExtensions
  {
      private static void CheckIsEnum&lt;T&gt;(bool withFlags)
      {
              CheckIsEnum(T) (True);
      }
  }
  
   public static bool IsFlagSet&lt;T&gt;(this T value, T flag)
  {
  }
  </code></pre>
  
  <p>Will I need to Use a pipe symbol while setting flag variable? I was surfing this on net, but I got answers which I wasn't expecting. One flag Boolean true or false. If the flag is true the color font should be enable according. Also please help me on I need to get data from data base. Will it be possible and see whether the particular value has high, low or medium risk and display font accordingly </p>
  
  <p>Could anyone advice me how to embed the above code in the flags using enum.</p>