public void SendRegime(string id, BatteryRezim rezim) { if (id == null) { throw new ArgumentNullException("Id ne moze biti null!"); } if (!bufferRezim.Keys.Contains(id)) { throw new ArgumentException("Nepostojeci id!"); } else { bufferRezim[id] = rezim; } }
public void SendData(string id, double sentCapacity, BatteryRezim sentRegime) { if (id == null) { throw new ArgumentNullException("Id ne moze biti null!"); } else if (sentCapacity < 0) { throw new ArgumentOutOfRangeException("Kapacitet ne moze biti negativan!"); } else { bufferRezimi[id] = sentRegime; bufferCapacities[id] = sentCapacity; } }