Background.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ConsoleApplication
  7. {
  8. public abstract class Background
  9. {
  10. private List<KeyValuePair<int, string>> gradientList = null;
  11. private string bgColor;
  12. private float alpha;
  13. private string BgImageLocation;
  14. public Background()
  15. {
  16. bgColor = "ffffff";
  17. BgImageLocation = "No picture";
  18. }
  19. public void setGradientList(List<KeyValuePair<int, string>> list)
  20. {
  21. if (gradientList == null)
  22. gradientList = new List<KeyValuePair<int, string>>();
  23. gradientList = list;
  24. }
  25. public void setBgImageLocation(string loc)
  26. {
  27. BgImageLocation = loc;
  28. }
  29. public string getBgImageLocation()
  30. {
  31. return BgImageLocation;
  32. }
  33. public List<KeyValuePair<int, string>> getGradientList()
  34. {
  35. if (gradientList != null)
  36. return gradientList;
  37. else
  38. return null;
  39. }
  40. public float Alpha
  41. {
  42. get { return alpha; }
  43. set { alpha = 1 - ((value / 1000) / 100);}
  44. }
  45. public string BgColor
  46. {
  47. get { return bgColor; }
  48. set { bgColor = value; }
  49. }
  50. }
  51. }