예제 #1
0
 public Battery(BatteryType batteryType, int? hoursIdle = null, int? hoursTalk = null)
 {
     this.Model = batteryType.ToString();
     this.HoursIdle = hoursIdle;
     this.HoursTalk = hoursTalk;
     this.batteryType = batteryType;
 }
예제 #2
0
        public override string ToString()
        {
            string returnmessage = $"Battery type:\t\t {BatteryType.ToString()}\n";

            returnmessage += $"Capacity:\t\t {Capacity}\n";
            returnmessage += $"Is built-in:\t\t {Builtinb}\n";
            returnmessage += $"Is Wireless charged:\t {Wirelesschrgb}\n";
            return(returnmessage);
        }
예제 #3
0
 public override string ToString()
 {
     if (BatteryType != null)
     {
         return(BatteryType.ToString());
     }
     if (Indicator != null)
     {
         return(Indicator.Value.ToString());
     }
     if (PortTypes == null)
     {
         return("Invalid");
     }
     if (PortTypes.Length == 0)
     {
         return("Empty port plate");
     }
     return("Port plate [" + PortTypes.JoinString(", ") + "]");
 }
예제 #4
0
 public override string ToString()
 {
     return(BatteryType.ToString() + " " + Model.ToString());
 }