Inheritance: INotifyPropertyChanged
Exemplo n.º 1
0
        public AirlinerClassMVVM(AirlinerClass type, int seating, int regularSeating, int maxseats, Boolean changeableSeats = false)
        {
            this.Type    = type.Type;
            this.Seating = seating;
            this.RegularSeatingCapacity = regularSeating;
            this.ChangeableSeats        = changeableSeats;
            this.MaxSeats         = maxseats;
            this.MaxSeatsCapacity = maxseats;
            this.ChangedFacility  = false;

            this.Facilities = new ObservableCollection <AirlinerFacilityMVVM>();

            foreach (AirlinerFacility.FacilityType facType in Enum.GetValues(typeof(AirlinerFacility.FacilityType)))
            {
                AirlinerFacilityMVVM facility = new AirlinerFacilityMVVM(facType, this);

                foreach (AirlinerFacility fac in AirlinerFacilities.GetFacilities(facType))
                {
                    facility.Facilities.Add(fac);
                }


                AirlinerFacility selectedFacility = type.getFacility(facType) == null?AirlinerFacilities.GetBasicFacility(facType) : type.getFacility(facType);

                facility.SelectedFacility = selectedFacility;

                this.Facilities.Add(facility);
            }
        }
Exemplo n.º 2
0
        public AirlinerClassMVVM(AirlinerClass type, int seating, int regularSeating, int maxseats,  Boolean changeableSeats = false)
        {
            this.Type = type.Type;
            this.Seating = seating;
            this.RegularSeatingCapacity = regularSeating;
            this.ChangeableSeats = changeableSeats;
            this.MaxSeats = maxseats;
            this.MaxSeatsCapacity = maxseats;
            this.ChangedFacility = false;

            this.Facilities = new ObservableCollection<AirlinerFacilityMVVM>();

            foreach (AirlinerFacility.FacilityType facType in Enum.GetValues(typeof(AirlinerFacility.FacilityType)))
            {
                AirlinerFacilityMVVM facility = new AirlinerFacilityMVVM(facType,this);

                foreach (AirlinerFacility fac in AirlinerFacilities.GetFacilities(facType))
                    facility.Facilities.Add(fac);

                AirlinerFacility selectedFacility = type.getFacility(facType) == null ? AirlinerFacilities.GetBasicFacility(facType) : type.getFacility(facType);
                facility.SelectedFacility = selectedFacility;

               this.Facilities.Add(facility);

            }
        }
        public AirlinerClassMVVM(AirlinerClass.ClassType type, int seating, int regularSeating, int maxseats, Boolean changeableSeats = false)
        {
            this.Type = type;
            this.Seating = seating;
            this.RegularSeatingCapacity = regularSeating;
            this.ChangeableSeats = changeableSeats;
            this.MaxSeats = maxseats;
            this.MaxSeatsCapacity = maxseats;

            this.Facilities = new List<AirlinerFacilityMVVM>();

            foreach (AirlinerFacility.FacilityType facType in Enum.GetValues(typeof(AirlinerFacility.FacilityType)))
            {
                AirlinerFacilityMVVM facility = new AirlinerFacilityMVVM(facType,this);

                foreach (AirlinerFacility fac in AirlinerFacilities.GetFacilities(facType))
                    facility.Facilities.Add(fac);

                this.Facilities.Add(facility);

            }
        }