public PanelPilot(PagePilots parent, Pilot pilot) { this.ParentPage = parent; this.Pilot = pilot; InitializeComponent(); StackPanel panelPilot = new StackPanel(); 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("PanelPilot", txtHeader.Uid); panelPilot.Children.Add(txtHeader); ListBox lbPilotInformation = new ListBox(); lbPilotInformation.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem"); lbPilotInformation.ItemContainerStyleSelector = new ListBoxItemStyleSelector(); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1002"), UICreator.CreateTextBlock(this.Pilot.Profile.Name))); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1003"), UICreator.CreateTextBlock(this.Pilot.Profile.Birthdate.ToShortDateString()))); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1004"), UICreator.CreateTownPanel(this.Pilot.Profile.Town))); ContentControl lblFlag = new ContentControl(); lblFlag.SetResourceReference(ContentControl.ContentTemplateProperty, "CountryFlagLongItem"); lblFlag.Content = new CountryCurrentCountryConverter().Convert(this.Pilot.Profile.Town.Country); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1005"), lblFlag)); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1006"), UICreator.CreateTextBlock(this.Pilot.EducationTime.ToShortDateString()))); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1007"), UICreator.CreateTextBlock(this.Pilot.Rating.ToString()))); // lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1008"), UICreator.CreateTextBlock(string.Format("{0:C}", ((int)this.Pilot.Rating) * 1000)))); double pilotBasePrice = GameObject.GetInstance().HumanAirline.Fees.getValue(FeeTypes.GetType("Pilot Base Salary"));//GeneralHelpers.GetInflationPrice(133.53);< lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1008"), UICreator.CreateTextBlock(new ValueCurrencyConverter().Convert(((int)this.Pilot.Rating) * pilotBasePrice).ToString()))); panelPilot.Children.Add(lbPilotInformation); panelPilot.Children.Add(createButtonsPanel()); this.Content = panelPilot; }
public PanelPilot(PagePilots parent, Pilot pilot) { this.ParentPage = parent; this.Pilot = pilot; InitializeComponent(); StackPanel panelPilot = new StackPanel(); 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("PanelPilot", txtHeader.Uid); panelPilot.Children.Add(txtHeader); ListBox lbPilotInformation = new ListBox(); lbPilotInformation.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem"); lbPilotInformation.ItemContainerStyleSelector = new ListBoxItemStyleSelector(); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot","1002"), UICreator.CreateTextBlock(this.Pilot.Profile.Name))); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1003"), UICreator.CreateTextBlock(this.Pilot.Profile.Birthdate.ToShortDateString()))); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1004"), UICreator.CreateTownPanel(this.Pilot.Profile.Town))); ContentControl lblFlag = new ContentControl(); lblFlag.SetResourceReference(ContentControl.ContentTemplateProperty, "CountryFlagLongItem"); lblFlag.Content = new CountryCurrentCountryConverter().Convert(this.Pilot.Profile.Town.Country); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1005"), lblFlag)); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1006"), UICreator.CreateTextBlock(this.Pilot.EducationTime.ToShortDateString()))); lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1007"), UICreator.CreateTextBlock(this.Pilot.Rating.ToString()))); // lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1008"), UICreator.CreateTextBlock(string.Format("{0:C}", ((int)this.Pilot.Rating) * 1000)))); double pilotBasePrice = GameObject.GetInstance().HumanAirline.Fees.getValue(FeeTypes.GetType("Pilot Base Salary"));//GeneralHelpers.GetInflationPrice(133.53);< lbPilotInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelPilot", "1008"), UICreator.CreateTextBlock(new ValueCurrencyConverter().Convert(((int)this.Pilot.Rating) * pilotBasePrice).ToString()))); panelPilot.Children.Add(lbPilotInformation); panelPilot.Children.Add(createButtonsPanel()); this.Content = panelPilot; }
public PanelFlightSchool(PagePilots parent, FlightSchool flighschool) { this.ParentPage = parent; this.FlightSchool = flighschool; InitializeComponent(); StackPanel panelFlightSchool = new StackPanel(); 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("PanelFlightSchool", txtHeader.Uid); panelFlightSchool.Children.Add(txtHeader); ListBox lbFSInformation = new ListBox(); lbFSInformation.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem"); lbFSInformation.ItemContainerStyleSelector = new ListBoxItemStyleSelector(); lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1002"), UICreator.CreateTextBlock(this.FlightSchool.Name))); lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1003"), UICreator.CreateTextBlock(this.FlightSchool.NumberOfInstructors.ToString()))); txtStudents = UICreator.CreateTextBlock(this.FlightSchool.NumberOfStudents.ToString()); lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1006"), txtStudents)); txtTrainingAircrafts = UICreator.CreateTextBlock(this.FlightSchool.TrainingAircrafts.Count.ToString()); lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1009"), txtTrainingAircrafts)); panelFlightSchool.Children.Add(lbFSInformation); panelFlightSchool.Children.Add(createInstructorsPanel()); panelFlightSchool.Children.Add(createTrainingAircraftsPanel()); panelFlightSchool.Children.Add(createStudentsPanel()); panelFlightSchool.Children.Add(createButtonsPanel()); this.Content = panelFlightSchool; showInstructors(); showStudents(); showTrainingAircrafts(); }