Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2021
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1. [TypeConverter(typeof(ExpandableObjectConverter))]
  2. public class LevelIIColorCollection : ICloneable
  3. {
  4.     [Browsable(false), XmlIgnore]
  5.     public System.Windows.Media.Brush[] MyBrushes;
  6.  
  7.     public LevelIIColorCollection()
  8.     {
  9.         MyBrushes = new System.Windows.Media.Brush[2];
  10.     }
  11.  
  12.     public object Clone()
  13.     {
  14.         LevelIIColorCollection newCollection = new LevelIIColorCollection()
  15.         {
  16.             Level01Color    = Level01Color,
  17.             Level02Color    = Level02Color
  18.         };
  19.  
  20.         return newCollection;
  21.     }
  22.  
  23.     public override string ToString()
  24.     {
  25.         return string.Empty;
  26.     }
  27.  
  28.     [XmlIgnore]
  29.     [Display(Name = "Level 1 Color", Order = 6, GroupName = "Parameters")]
  30.     public Brush Level01Color
  31.     {
  32.         get { return MyBrushes[0]; }
  33.         set { MyBrushes[0] = value; }
  34.     }
  35.  
  36.     [Browsable(false)]
  37.     public string Level01ColorSerializable
  38.     {
  39.         get { return Serialize.BrushToString(Level01Color); }
  40.         set { Level01Color = Serialize.StringToBrush(value); }
  41.     }
  42.  
  43.     [XmlIgnore]
  44.     [Display(Name = "Level 2 Color", Order = 7, GroupName = "Parameters")]
  45.     public Brush Level02Color
  46.     {
  47.         get { return MyBrushes[1]; }
  48.         set { MyBrushes[1] = value; }
  49.     }
  50.  
  51.     [Browsable(false)]
  52.     public string Level02ColorSerializable
  53.     {
  54.         get { return Serialize.BrushToString(Level02Color); }
  55.         set { Level02Color = Serialize.StringToBrush(value); }
  56.     }
  57. }
  58.  
  59. *********************************CREATE PROPERTY TYPE FOR INDICATOR TO USE*********************************
  60. [Display(Name = "Level II Colors", Description = "Level II Colors", Order = 6, GroupName = "Parameters")]
  61. public LevelIIColorCollection LevelIIColors
  62. { get; set; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement