Advertisement
Guest User

Untitled

a guest
May 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. [AmbientValue(typeof(Color), "Empty")]
  2. [Category("Appearance")]
  3. [DefaultValue(typeof(Color), "White")]
  4. [Description("The color used for painting alert text.")]
  5. public Color AlertForeColor
  6. {
  7. get
  8. {
  9. if (this.alertForeColorValue == Color.Empty &&
  10. this.Parent != null)
  11. {
  12. return Parent.ForeColor;
  13. }
  14.  
  15. return this.alertForeColorValue;
  16. }
  17.  
  18. set
  19. {
  20. this.alertForeColorValue = value;
  21. }
  22. }
  23.  
  24. private static Color defaultAlertForeColorValue = Color.White;
  25.  
  26. private static Color ambientColorValue = Color.Empty;
  27.  
  28. // This method is used by designers to enable resetting the
  29. // property to its default value.
  30. public void ResetAlertForeColor()
  31. {
  32. this.AlertForeColor = AttributesDemoControl.defaultAlertForeColorValue;
  33. }
  34.  
  35. // This method indicates to designers whether the property
  36. // value is different from the ambient value, in which case
  37. // the designer should persist the value.
  38. private bool ShouldSerializeAlertForeColor()
  39. {
  40. return (this.alertForeColorValue != AttributesDemoControl.ambientColorValue);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement