Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using CryptoMiningSystem.Entities.Components.Contracts;/*
- {
- public interface IComponent*/
- namespace CryptoMiningSystem
- {
- public abstract class Component : IComponent
- {
- private string model;
- public string Model
- {
- get { return model; }
- set
- {
- if (string.IsNullOrEmpty(value)) throw new ArgumentException("Model cannot be null or empty!");
- model = value;
- }
- }
- private decimal price;
- public decimal Price
- {
- get { return price; }
- set
- {
- //<=
- if (value < 0 || value > 10000) throw new ArgumentException(" Price cannot be less or equal to 0 and more than 10000!");
- price = value;
- }
- }
- private int generation;
- public int Generation
- {
- get { return generation; }
- set
- {
- if (value <= 0) throw new ArgumentException("Generation cannot be 0 or negative!");
- generation = value;
- }
- }
- private int lifeWorkingHours;
- public event EventHandler Disposed;
- public int LifeWorkingHours
- {
- get { return lifeWorkingHours; }
- set { lifeWorkingHours = value; }
- }
- //public ISite Site { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
- public void Dispose()
- {
- //throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement