public void SetRoute(IList <TransportMethod> meansOfTransport) { Guard.ArgumentNotNull(() => meansOfTransport, meansOfTransport); if (meansOfTransport.Count == 0) { throw new InvalidOperationException( "Attempted to set means of transport to an empty list. Notification: " + this.NotificationId); } var builder = new StringBuilder(); TransportMethod previousMeans = default(TransportMethod); for (int i = 0; i < meansOfTransport.Count; i++) { if (previousMeans == meansOfTransport[i]) { throw new InvalidOperationException( "Attempted to set means of transport with two consecutive means of transport being the same. The sequence was: " + string.Join(string.Empty, meansOfTransport.Select(mot => EnumHelper.GetShortName(mot)))); } builder.Append(EnumHelper.GetShortName(meansOfTransport[i])); if (i < meansOfTransport.Count - 1) { builder.Append(Separator); } previousMeans = meansOfTransport[i]; } this.MeansOfTransportInternal = builder.ToString(); }
private void TransportComboBox_SelectedIndexChanged(object sender, EventArgs args) { TransportMethod method = (TransportMethod)TransportComboBox.SelectedItem; SetView(method.View); SharedData.Instance.Transport = method.Transport; }
public EncoderUnit(string transcoder, string arguments, TransportMethod inputMethod, TransportMethod outputMethod, LogStream logStream) { this.transcoderPath = transcoder; this.arguments = arguments; this.inputMethod = inputMethod; this.outputMethod = outputMethod; this.logStream = logStream; }
public ActionResult DeleteConfirmed(int id) { TransportMethod transportMethod = db.TransportMethods.Find(id); db.TransportMethods.Remove(transportMethod); db.SaveChanges(); return(RedirectToAction("Index")); }
public EncoderConfig(string displayName,bool useTranscoding, string fileName, string args, TransportMethod inputMethod, TransportMethod outputMethod) { this.displayName = displayName; this.useTranscoding = useTranscoding; this.fileName = fileName; this.args = args; this.inputMethod = inputMethod; this.outputMethod = outputMethod; }
public EncoderConfig(string displayName, bool useTranscoding, string fileName, string args, TransportMethod inputMethod, TransportMethod outputMethod) { this.displayName = displayName; this.useTranscoding = useTranscoding; this.fileName = fileName; this.args = args; this.inputMethod = inputMethod; this.outputMethod = outputMethod; }
public ActionResult Edit([Bind(Include = "TransportMethodID,TransportMode,TransportClass,AvgMPG,CityMPG,HwyMPG,CO2Lbs,MakeID,ModelID,YearID,OptionID,Make,Model,Year,Options")] TransportMethod transportMethod) { if (ModelState.IsValid) { db.Entry(transportMethod).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MakeID = new SelectList(db.Makes, "MakeID", "MakeName", transportMethod.MakeID); ViewBag.ModelID = new SelectList(db.Models, "ModelID", "ModelName", transportMethod.ModelID); ViewBag.OptionID = new SelectList(db.Options, "OptionID", "OptionName", transportMethod.OptionID); ViewBag.YearID = new SelectList(db.Years, "YearID", "Year1", transportMethod.YearID); return(View(transportMethod)); }
// GET: TransportMethods/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TransportMethod transportMethod = db.TransportMethods.Find(id); if (transportMethod == null) { return(HttpNotFound()); } return(View(transportMethod)); }
public ActionResult Create([Bind(Include = "TransportMethodID,TransportMode,TransportClass,AvgMPG,CityMPG,HwyMPG,CO2Lbs,MakeID,ModelID,YearID,OptionID,Make,Model,Year,Options")] TransportMethod transportMethod) { if (ModelState.IsValid) { transportMethod.TransportMode = "Automobile"; db.TransportMethods.Add(transportMethod); db.SaveChanges(); return(RedirectToAction("Create", "Commutes")); } ViewBag.MakeID = new SelectList(db.Makes, "MakeID", "MakeName", transportMethod.MakeID); ViewBag.ModelID = new SelectList(db.Models, "ModelID", "ModelName", transportMethod.ModelID); ViewBag.OptionID = new SelectList(db.Options, "OptionID", "OptionName", transportMethod.OptionID); ViewBag.YearID = new SelectList(db.Years, "YearID", "Year1", transportMethod.YearID); return(View(transportMethod)); }
// GET: TransportMethods/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TransportMethod transportMethod = db.TransportMethods.Find(id); if (transportMethod == null) { return(HttpNotFound()); } ViewBag.MakeID = new SelectList(db.Makes, "MakeID", "MakeName", transportMethod.MakeID); ViewBag.ModelID = new SelectList(db.Models, "ModelID", "ModelName", transportMethod.ModelID); ViewBag.OptionID = new SelectList(db.Options, "OptionID", "OptionName", transportMethod.OptionID); ViewBag.YearID = new SelectList(db.Years, "YearID", "Year1", transportMethod.YearID); return(View(transportMethod)); }
public EncoderUnit(string transcoder, string arguments, TransportMethod inputMethod, TransportMethod outputMethod, LogStream logStream, StreamContext context) : this(transcoder, arguments, inputMethod, outputMethod, logStream) { this.context = context; }