Advertisement
Guest User

Untitled

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