Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. //using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.ComponentModel;
  8. namespace CryptoMiningSystem
  9. {
  10. public /*abstract*/ class Component : IComponent
  11. {
  12. private string model;
  13.  
  14. public string Model
  15. {
  16. get { return model; }
  17. set
  18. {
  19. if (string.IsNullOrEmpty(value)) throw new ArgumentException("Model cannot be null or empty!");
  20. model = value;
  21. }
  22. }
  23. private decimal price;
  24.  
  25. public decimal Price
  26. {
  27. get { return price; }
  28. set
  29. {
  30. if (value <= 0 || value > 10000) throw new ArgumentException("Price cannot be less or equal to 0 and more than 10000!");
  31. price = value;
  32. }
  33. }
  34. private int generation;
  35.  
  36. public int Generation
  37. {
  38. get { return generation; }
  39. set
  40. {
  41. if (value <= 0) throw new ArgumentException("Generation cannot be 0 or negative!");
  42. generation = value;
  43. }
  44. }
  45. private int lifeWorkingHours;
  46.  
  47. public event EventHandler Disposed;
  48.  
  49. public int LifeWorkingHours
  50. {
  51. get { return lifeWorkingHours; }
  52. set { lifeWorkingHours = value; }
  53. }
  54.  
  55. public ISite Site { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
  56.  
  57. public void Dispose()
  58. {
  59. //throw new NotImplementedException();
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement