Inheritance: INotifyPropertyChanged
        public PageAirportFacilities(AirportMVVM airport)
        {
            Airport = airport;
            DataContext = Airport;

            FacilityTypes =
                Enum.GetValues(typeof(AirportFacility.FacilityType)).Cast<AirportFacility.FacilityType>().ToList();

            if (!airport.Airport.Terminals.AirportTerminals.Exists(t => t.Type == Terminal.TerminalType.Cargo))
                FacilityTypes.Remove(AirportFacility.FacilityType.Cargo);

            InitializeComponent();

            var view = (CollectionView)CollectionViewSource.GetDefaultView(lbFacilities.ItemsSource);
            view.SortDescriptions.Clear();

            var sortAirlineDescription = new SortDescription(
                "Facility.Airline.Profile.Name",
                ListSortDirection.Ascending);
            view.SortDescriptions.Add(sortAirlineDescription);

            var sortFacilityDescription = new SortDescription(
                "Facility.Facility.Shortname",
                ListSortDirection.Ascending);
            view.SortDescriptions.Add(sortFacilityDescription);
        }
        public PageAirportInfo(AirportMVVM airport)
        {
            this.Airport = airport;
            this.DataContext = this.Airport;

            this.ContractTypes = new List<AirportContract.ContractType>();

            foreach (AirportContract.ContractType type in Enum.GetValues(typeof(AirportContract.ContractType)))
            {
                this.ContractTypes.Add(type);
            }

            InitializeComponent();

            /*
            CollectionView viewDemands = (CollectionView)CollectionViewSource.GetDefaultView(lvDemand.ItemsSource);
            viewDemands.GroupDescriptions.Clear();

            viewDemands.GroupDescriptions.Add(new PropertyGroupDescription("Type"));

            SortDescription sortTypeDescription = new SortDescription("Type", ListSortDirection.Ascending);
            viewDemands.SortDescriptions.Add(sortTypeDescription);

            SortDescription sortPassengersDescription = new SortDescription("Passengers", ListSortDirection.Descending);
            viewDemands.SortDescriptions.Add(sortPassengersDescription);
            */
        }
        public PageAirportInfo(AirportMVVM airport)
        {
            this.Airport     = airport;
            this.DataContext = this.Airport;

            this.ContractTypes = new List <AirportContract.ContractType>();

            foreach (AirportContract.ContractType type in Enum.GetValues(typeof(AirportContract.ContractType)))
            {
                this.ContractTypes.Add(type);
            }

            InitializeComponent();



            /*
             * CollectionView viewDemands = (CollectionView)CollectionViewSource.GetDefaultView(lvDemand.ItemsSource);
             * viewDemands.GroupDescriptions.Clear();
             *
             * viewDemands.GroupDescriptions.Add(new PropertyGroupDescription("Type"));
             *
             * SortDescription sortTypeDescription = new SortDescription("Type", ListSortDirection.Ascending);
             * viewDemands.SortDescriptions.Add(sortTypeDescription);
             *
             * SortDescription sortPassengersDescription = new SortDescription("Passengers", ListSortDirection.Descending);
             * viewDemands.SortDescriptions.Add(sortPassengersDescription);
             */
        }
示例#4
0
        public PageAirportInfo(AirportMVVM airport)
        {
            this.Airport     = airport;
            this.DataContext = this.Airport;

            InitializeComponent();

            CollectionView viewTerminals = (CollectionView)CollectionViewSource.GetDefaultView(lvTerminals.ItemsSource);

            viewTerminals.GroupDescriptions.Clear();

            PropertyGroupDescription groupDescription = new PropertyGroupDescription("Type");

            viewTerminals.GroupDescriptions.Add(groupDescription);



            CollectionView viewDemands = (CollectionView)CollectionViewSource.GetDefaultView(lvDemand.ItemsSource);

            viewDemands.GroupDescriptions.Clear();

            viewDemands.GroupDescriptions.Add(new PropertyGroupDescription("Type"));

            SortDescription sortTypeDescription = new SortDescription("Type", ListSortDirection.Ascending);

            viewDemands.SortDescriptions.Add(sortTypeDescription);

            SortDescription sortPassengersDescription = new SortDescription("Passengers", ListSortDirection.Descending);

            viewDemands.SortDescriptions.Add(sortPassengersDescription);
        }
        public PageAirportGateSchedule(AirportMVVM airport)
        {
            this.Airport = airport;

            this.DataContext = this.Airport;

            InitializeComponent();
        }
示例#6
0
        public PageAirportGateSchedule(AirportMVVM airport)
        {
            this.Airport = airport;

            this.DataContext = this.Airport;

            InitializeComponent();
        }
        public PageAirport(Airport airport)
        {
            this.Loaded += PageAirport_Loaded;
            this.Airport = new AirportMVVM(airport);

            this.Distances = new List<AirportDistanceMVVM>();

            foreach (Airport destination in GameObject.GetInstance().HumanAirline.Airports.Where(a => a != this.Airport.Airport))
                this.Distances.Add(new AirportDistanceMVVM(destination, MathHelpers.GetDistance(destination, this.Airport.Airport)));

            InitializeComponent();
        }
        public PageAirportTraffic(AirportMVVM airport)
        {
            this.Airport = airport;
            this.DataContext = this.Airport;

            InitializeComponent();

            CollectionView viewTraffic = (CollectionView)CollectionViewSource.GetDefaultView(lvTraffic.ItemsSource);
            viewTraffic.GroupDescriptions.Clear();

            viewTraffic.GroupDescriptions.Add(new PropertyGroupDescription("Type"));
        }
        public PageAirportTraffic(AirportMVVM airport)
        {
            this.Airport     = airport;
            this.DataContext = this.Airport;

            InitializeComponent();

            CollectionView viewTraffic = (CollectionView)CollectionViewSource.GetDefaultView(lvTraffic.ItemsSource);

            viewTraffic.GroupDescriptions.Clear();

            viewTraffic.GroupDescriptions.Add(new PropertyGroupDescription("Type"));
        }
        public PageAirport(Airport airport)
        {
            this.Loaded += PageAirport_Loaded;
            this.Airport = new AirportMVVM(airport);

            this.Distances = new List <AirportDistanceMVVM>();

            foreach (Airport destination in GameObject.GetInstance().HumanAirline.Airports.Where(a => a != this.Airport.Airport))
            {
                this.Distances.Add(new AirportDistanceMVVM(destination, MathHelpers.GetDistance(destination, this.Airport.Airport)));
            }

            InitializeComponent();
        }
        public PageAirportFacilities(AirportMVVM airport)
        {
            this.Airport = airport;
            this.DataContext = this.Airport;

            this.FacilityTypes = Enum.GetValues(typeof(AirportFacility.FacilityType)).Cast<AirportFacility.FacilityType>().ToList();

            InitializeComponent();

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(lbFacilities.ItemsSource);
            view.SortDescriptions.Clear();

            SortDescription sortAirlineDescription = new SortDescription("Airline.Profile.Name", ListSortDirection.Ascending);
            view.SortDescriptions.Add(sortAirlineDescription);
        }
示例#12
0
        public PageAirportFacilities(AirportMVVM airport)
        {
            this.Airport     = airport;
            this.DataContext = this.Airport;

            this.FacilityTypes = Enum.GetValues(typeof(AirportFacility.FacilityType)).Cast <AirportFacility.FacilityType>().ToList();

            InitializeComponent();

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(lbFacilities.ItemsSource);

            view.SortDescriptions.Clear();

            SortDescription sortAirlineDescription = new SortDescription("Airline.Profile.Name", ListSortDirection.Ascending);

            view.SortDescriptions.Add(sortAirlineDescription);
        }
        public PageAirportDemand(AirportMVVM airport)
        {
            this.Airport = airport;
            this.DataContext = this.Airport;

            InitializeComponent();

            CollectionView viewDemands = (CollectionView)CollectionViewSource.GetDefaultView(lvDemand.ItemsSource);
            viewDemands.GroupDescriptions.Clear();

            viewDemands.GroupDescriptions.Add(new PropertyGroupDescription("Type"));

            SortDescription sortTypeDescription = new SortDescription("Type", ListSortDirection.Ascending);
            viewDemands.SortDescriptions.Add(sortTypeDescription);

            SortDescription sortPassengersDescription = new SortDescription("Passengers", ListSortDirection.Descending);
            viewDemands.SortDescriptions.Add(sortPassengersDescription);
        }
        public PageAirportDemand(AirportMVVM airport)
        {
            Airport = airport;
            DataContext = Airport;

            InitializeComponent();

            var viewDemandsIntl = (CollectionView)CollectionViewSource.GetDefaultView(lvDemandIntl.ItemsSource);

            var sortTypeDescription = new SortDescription("Type", ListSortDirection.Ascending);
            viewDemandsIntl.SortDescriptions.Add(sortTypeDescription);

            var sortPassengersDescription = new SortDescription("Passengers", ListSortDirection.Descending);
            viewDemandsIntl.SortDescriptions.Add(sortPassengersDescription);

            var viewDemandsDomestic = (CollectionView)CollectionViewSource.GetDefaultView(lvDemandDomestic.ItemsSource);

            var sortTypeDomesticDescription = new SortDescription("Type", ListSortDirection.Ascending);
            viewDemandsDomestic.SortDescriptions.Add(sortTypeDomesticDescription);

            var sortPassengersDomesticDescription = new SortDescription("Passengers", ListSortDirection.Descending);
            viewDemandsDomestic.SortDescriptions.Add(sortPassengersDomesticDescription);
        }