示例#1
0
        private void lnkAirlineFacility_click(object sender, RoutedEventArgs e)
        {
            AirlineFacility facility = (AirlineFacility)((Hyperlink)sender).Tag;

            if (facility.Shortname == "Maintenance")
            {
                PageNavigator.NavigateTo(new PageAirlineFacilityMaintenance(facility));
            }
        }
示例#2
0
        public PageAirlineFacilityMaintenance(AirlineFacility facility)
        {
            this.AirlinersToMaintain = new List <FleetAirliner>();
            this.AirlineFacility     = facility;
            this.Classes             = new List <AirlinerClass>();

            InitializeComponent();

            StackPanel facilityPanel = new StackPanel();

            facilityPanel.Margin = new Thickness(10, 0, 10, 0);

            TextBlock txtHeader = new TextBlock();

            txtHeader.Uid = "1001";
            txtHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            txtHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
            txtHeader.FontWeight = FontWeights.Bold;
            txtHeader.Text       = Translator.GetInstance().GetString("PageAirlineFacilityMaintenance", txtHeader.Uid);

            facilityPanel.Children.Add(txtHeader);

            ContentControl ccHeader = new ContentControl();

            ccHeader.ContentTemplate     = this.Resources["FleetHeader"] as DataTemplate;
            ccHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;

            facilityPanel.Children.Add(ccHeader);

            ListBox lbAirliners = new ListBox();

            lbAirliners.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbAirliners.ItemTemplate = this.Resources["AirlinerItem"] as DataTemplate;
            lbAirliners.MaxHeight    = GraphicsHelpers.GetContentHeight() / 2;

            foreach (FleetAirliner airliner in GameObject.GetInstance().HumanAirline.DeliveredFleet)
            {
                lbAirliners.Items.Add(airliner);
            }

            facilityPanel.Children.Add(lbAirliners);
            facilityPanel.Children.Add(createClassesPanel());
            facilityPanel.Children.Add(createButtonsPanel());

            StandardContentPanel panelContent = new StandardContentPanel();

            panelContent.setContentPage(facilityPanel, StandardContentPanel.ContentLocation.Left);

            base.setContent(panelContent);

            base.setHeaderContent(this.AirlineFacility.Name);

            showPage(this);
        }
示例#3
0
 public RouteFacility(string uid, FacilityType type, string name, int serviceLevel, ExpenseType eType, double expense, FeeType feeType, AirlineFacility requires)
 {
     this.Type                = type;
     this.Name                = name;
     this.Uid                 = uid;
     this.ServiceLevel        = serviceLevel;
     this.EType               = eType;
     this.ExpensePerPassenger = expense;
     this.FeeType             = feeType;
     this.Requires            = requires;
 }
示例#4
0
        private void ButtonRemove_Click(object sender, RoutedEventArgs e)
        {
            AirlineFacility facility = (AirlineFacility)((Button)sender).Tag;

            WPFMessageBoxResult result = WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2103"), string.Format(Translator.GetInstance().GetString("MessageBox", "2103", "message"), facility.Name), WPFMessageBoxButtons.YesNo);

            if (result == WPFMessageBoxResult.Yes)
            {
                this.Airline.removeFacility(facility);

                showFacilities();
            }
        }
示例#5
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            AirlineFacility facility = (AirlineFacility)((Button)sender).Tag;

            if (facility.Price > GameObject.GetInstance().HumanAirline.Money)
            {
                WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2101"), Translator.GetInstance().GetString("MessageBox", "2101", "message"), WPFMessageBoxButtons.Ok);
            }
            else
            {
                WPFMessageBoxResult result = WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2102"), string.Format(Translator.GetInstance().GetString("MessageBox", "2102", "message"), facility.Name), WPFMessageBoxButtons.YesNo);

                if (result == WPFMessageBoxResult.Yes)
                {
                    this.Airline.addFacility(facility);

                    AirlineHelpers.AddAirlineInvoice(this.Airline, GameObject.GetInstance().GameTime, Invoice.InvoiceType.Purchases, -facility.Price);


                    showFacilities();
                }
            }
        }
示例#6
0
 public void RemoveFacility(AirlineFacility facility)
 {
     Facilities.Remove(facility);
 }
示例#7
0
 //removes an airport from the airline
 //adds a facility to the airline
 public void AddFacility(AirlineFacility facility)
 {
     Facilities.Add(facility);
 }
 public AirlineFacilityMVVM(Models.Airlines.Airline airline, AirlineFacility facility, MVVMType type)
 {
     Type = type;
     Airline = airline;
     Facility = facility;
 }
 public RouteFacility(
     string uid,
     FacilityType type,
     string name,
     int serviceLevel,
     ExpenseType eType,
     double expense,
     FeeType feeType,
     AirlineFacility requires)
 {
     Type = type;
     Name = name;
     Uid = uid;
     ServiceLevel = serviceLevel;
     EType = eType;
     ExpensePerPassenger = expense;
     FeeType = feeType;
     Requires = requires;
 }
示例#10
0
 public AirlineFacilityMVVM(Airline airline, AirlineFacility facility, MVVMType type)
 {
     this.Type     = type;
     this.Airline  = airline;
     this.Facility = facility;
 }