private StringBuilder SetSpeed(Speed speed, StringBuilder sb) { switch (SpeedParameter) { case SpeedParameter.KMPH: sb.Append(speed.KMPH.ToString("0.0") + " km/h"); break; case SpeedParameter.MPS: sb.Append(speed.MPS.ToString("0.0") + " m/s"); break; case SpeedParameter.Knot: sb.Append(speed.Knot.ToString("0.0") + " kn"); break; default: break; } return sb; }
public static Speed FromMPS(double mps) { var speed = new Speed(); speed.MPS = mps; return speed; }
public static Speed FromKnot(double knot) { var speed = new Speed(); speed.Knot = knot; return speed; }
public static Speed FromKMPH(double kmph) { var speed = new Speed(); speed.KMPH = kmph; return speed; }