Пример #1
0
		/// <summary>
		/// Adds the specified station to this State
		/// </summary>
		/// <param name="fpc"></param>
		/// <param name="station"></param>
		public void AddNewStateStation(FpcWindowVm fpc, StationVm station)
		{
			//if no station is already there and no name or code is set, set them to station's
			if (!ContentsList.Any(x => !x.IsDropIndicator) && State.Name == "*" && State.Code == "*")
			{
				State.Name = station.Name;
				State.Code = station.Code;
			}

			//create model for StateStation
			var ss = new Soheil.Model.StateStation
			{
				State = this.State.Model,
				Station = station.Model,
			};

			//create vm for StateStation and add it
			ContentsList.Add(new StateStationVm(fpc, ss)
			{
				Container = this,
				Containment = station,
				IsExpanded = true,
			});
		}
Пример #2
0
		public StationMachineVm(Model.StationMachine model, StationVm station)
		{
			Model = model;
			Station = station;
			Machine = new MachineVm(model.Machine, new MachineFamilyVm(model.Machine.MachineFamily));
		}