本文整理汇总了C#中TheAirline.Model.AirportModel.Airport类的典型用法代码示例。如果您正苦于以下问题:C# Airport类的具体用法?C# Airport怎么用?C# Airport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Airport类属于TheAirline.Model.AirportModel命名空间,在下文中一共展示了Airport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PageAirportDistances
public PageAirportDistances(Airport airport)
{
this.Airport = airport;
InitializeComponent();
StackPanel panelAirports = new StackPanel();
panelAirports.Margin = new Thickness(0, 10, 50, 0);
ContentControl lblHeader = new ContentControl();
lblHeader.ContentTemplate = this.Resources["AirportsHeader"] as DataTemplate;
panelAirports.Children.Add(lblHeader);
ListBox lbAirport = new ListBox();
lbAirport.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
lbAirport.ItemTemplate = this.Resources["AirportItem"] as DataTemplate;
lbAirport.MaxHeight = GraphicsHelpers.GetContentHeight() - 100;
var airports = GameObject.GetInstance().HumanAirline.Airports.FindAll(a=>a!=this.Airport).OrderBy(a=>MathHelpers.GetDistance(a,this.Airport));
foreach (Airport destAirport in airports )
lbAirport.Items.Add(new KeyValuePair<Airport,Airport>(this.Airport,destAirport));
panelAirports.Children.Add(lbAirport);
this.Content = panelAirports;
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:27,代码来源:PageAirportDistances.xaml.cs
示例2: AirlineAirportFacility
public AirlineAirportFacility(Airline airline, Airport airport, AirportFacility facility, DateTime date)
{
this.Airline = airline;
this.Facility = facility;
this.FinishedDate = date;
this.Airport = airport;
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:7,代码来源:AirlineAirportFacility.cs
示例3: ScenarioPassengerDemand
public ScenarioPassengerDemand(double factor, DateTime enddate, Country country, Airport airport)
{
this.Country = country;
this.Factor = factor;
this.EndDate = enddate;
this.Airport = airport;
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:7,代码来源:ScenarioPassengerDemand.cs
示例4: AirportStatics
public AirportStatics(Airport airport)
{
this.AirportDistances = new Dictionary<Airport, double>();
this.PassengerDemand = new List<DestinationDemand>();
this.CargoDemand = new List<DestinationDemand>();
this.Airport = airport;
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:7,代码来源:AirportStatics.cs
示例5: PageAirport
public PageAirport(Airport airport)
{
InitializeComponent();
this.Uid = "1000";
this.Title = Translator.GetInstance().GetString("PageAirport", this.Uid);
this.Airport = airport;
StackPanel airportPanel = new StackPanel();
airportPanel.Margin = new Thickness(10, 0, 10, 0);
airportPanel.Children.Add(createQuickInfoPanel());
airportPanel.Children.Add(createPassengersPanel());
//airportPanel.Children.Add(createFlightsPanel());
//airportPanel.Children.Add(createArrivalsPanel());
//airportPanel.Children.Add(createDeparturesPanel());
StandardContentPanel panelContent = new StandardContentPanel();
panelContent.setContentPage(airportPanel, StandardContentPanel.ContentLocation.Left);
StackPanel panelSideMenu = new PanelAirport(this.Airport);
panelContent.setContentPage(panelSideMenu, StandardContentPanel.ContentLocation.Right);
base.setContent(panelContent);
base.setHeaderContent(this.Title + " - " + this.Airport.Profile.Name);
showPage(this);
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:32,代码来源:PageAirport.xaml.cs
示例6: ScenarioAirlineRoute
public ScenarioAirlineRoute(Airport destination1, Airport destination2, AirlinerType airlinertype, int quantity)
{
this.Destination1 = destination1;
this.Destination2 = destination2;
this.AirlinerType = airlinertype;
this.Quantity = quantity;
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:7,代码来源:ScenarioAirline.cs
示例7: ShowPopUp
public static object ShowPopUp(Airline airline,Airport airport)
{
PopUpWindow window = new PopUpAddCooperation(airline,airport);
window.ShowDialog();
return window.Selected;
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:7,代码来源:PopUpAddCooperation.xaml.cs
示例8: PopUpTerminal
//for creating a new terminal
public PopUpTerminal(Airport airport)
{
this.Airport = airport;
InitializeComponent();
this.Uid = "1000";
this.Title = Translator.GetInstance().GetString("PopUpTerminal", this.Uid);
this.Width = 400;
this.Height = 200;
this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
StackPanel mainPanel = new StackPanel();
mainPanel.Margin = new Thickness(10, 10, 10, 10);
ListBox lbTerminal = new ListBox();
lbTerminal.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
lbTerminal.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
mainPanel.Children.Add(lbTerminal);
// chs 28-01-12: added for name of terminal
txtName = new TextBox();
txtName.Background = Brushes.Transparent;
txtName.BorderBrush = Brushes.Black;
txtName.IsEnabled = this.Terminal == null;
txtName.Width = 100;
txtName.Text = this.Terminal == null ? "Terminal" : this.Terminal.Name;
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal","1007"),txtName));
// chs 11-09-11: added numericupdown for selecting number of gates
nudGates = new ucNumericUpDown();
nudGates.Height = 30;
nudGates.MaxValue = 50;
nudGates.ValueChanged+=new RoutedPropertyChangedEventHandler<decimal>(nudGates_ValueChanged);
nudGates.MinValue = 1;
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1001"), nudGates));
/*
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1002"), UICreator.CreateTextBlock(string.Format("{0:C}",this.Airport.getTerminalPrice()))));
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1003"), UICreator.CreateTextBlock(string.Format("{0:C}",this.Airport.getTerminalGatePrice()))));
*/
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1002"), UICreator.CreateTextBlock(new ValueCurrencyConverter().Convert(this.Airport.getTerminalPrice()).ToString())));
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1003"), UICreator.CreateTextBlock(new ValueCurrencyConverter().Convert(this.Airport.getTerminalGatePrice()).ToString())));
txtDaysToCreate = UICreator.CreateTextBlock("0 days");
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1004"), txtDaysToCreate));
txtTotalPrice = UICreator.CreateTextBlock(new ValueCurrencyConverter().Convert(0).ToString());//UICreator.CreateTextBlock(string.Format("{0:C}", 0));
lbTerminal.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpTerminal", "1005"), txtTotalPrice));
mainPanel.Children.Add(createButtonsPanel());
nudGates.Value = 1;
this.Content = mainPanel;
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:61,代码来源:PopUpTerminal.xaml.cs
示例9: calculateDistance
/// <summary>
/// Calculates the distance from
/// the start airport to all other airports
/// </summary>
/// <param name="start">Startknoten</param>
public void calculateDistance(Airport start)
{
this.Dist[start.Profile.IATACode] = 0;
while (Basis.Count > 0)
{
Airport u = getNodeWithSmallestDistance();
if (u == null)
{
this.Basis.Clear();
}
else
{
foreach (Airport v in getNeighbors(u))
{
double alt = Dist[u.Profile.IATACode] +
getDistanceBetween(u, v);
if (alt < Dist[v.Profile.IATACode])
{
this.Dist[v.Profile.IATACode] = alt;
this.Previous[v.Profile.IATACode] = u;
}
}
this.Basis.Remove(u);
}
}
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:32,代码来源:PassengerRouteFinder.cs
示例10: CombiRoute
//adds a route airliner class to the route
public CombiRoute(string id, Airport destination1, Airport destination2, DateTime startDate, double farePrice, double pricePerUnit)
: base(id, destination1, destination2, startDate,farePrice)
{
this.Type = RouteType.Mixed;
this.PricePerUnit = pricePerUnit;
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:8,代码来源:CombiRoute.cs
示例11: ShowPopUp
public static object ShowPopUp(Airport airport)
{
PopUpWindow window = new PopUpAirportContract(airport);
window.ShowDialog();
return window.Selected;
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:7,代码来源:PopUpAirportContract.xaml.cs
示例12: addDistance
//adds a distance to the airport
public void addDistance(Airport airport, double distance)
{
lock (this.AirportDistances)
{
if (!this.AirportDistances.ContainsKey(airport))
this.AirportDistances.Add(airport, distance);
}
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:9,代码来源:AirportStatics.cs
示例13: Alliance
public Alliance(DateTime formationDate, string name, Airport headquarter)
{
this.FormationDate = formationDate;
this.Name = name;
this.Members = new List<AllianceMember>();
this.PendingMembers = new List<PendingAllianceMember>();
this.Headquarter = headquarter;
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:8,代码来源:Alliance.cs
示例14: AirportMVVM
public AirportMVVM(Airport airport)
{
this.Airport = airport;
this.IsHuman = GameObject.GetInstance().HumanAirline.Airports.Contains(this.Airport);
this.NumberOfFreeGates = this.Airport.Terminals.NumberOfFreeGates;
this.NumberOfAirlines = this.Airport.AirlineContracts.Select(c => c.Airline).Distinct().Count();
this.NumberOfRoutes = AirportHelpers.GetAirportRoutes(this.Airport).Count;
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:8,代码来源:AirportsMVVM.cs
示例15: PopUpAirportContract
public PopUpAirportContract(Airport airport)
{
this.Airport = airport;
this.DataContext = this.Airport;
InitializeComponent();
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:8,代码来源:PopUpAirportContract.xaml.cs
示例16: Alliance
public Alliance(DateTime formationDate, AllianceType type, string name, Airport headquarter)
{
this.FormationDate = formationDate;
this.Type = type;
this.Name = name;
this.Members = new ObservableCollection<AllianceMember>();
this.PendingMembers = new ObservableCollection<PendingAllianceMember>();
this.Headquarter = headquarter;
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:9,代码来源:Alliance.cs
示例17: CheckForExtendGates
//checks an airport for new gates
public static void CheckForExtendGates(Airport airport)
{
int minYearsBetweenExpansions = 5;
if (airport.Terminals.getOrdereredGates() == 0 && GameObject.GetInstance().GameTime.AddYears(-minYearsBetweenExpansions) > airport.LastExpansionDate)
{
Terminal minTerminal = airport.Terminals.AirportTerminals.OrderBy(t => t.Gates.NumberOfGates).First();
Boolean newTerminal = minTerminal.Gates.NumberOfGates > 50;
//extend existing
if (!newTerminal)
{
int numberOfGates = Math.Max(5, minTerminal.Gates.NumberOfGates);
int daysToBuild = numberOfGates * 10 + (newTerminal ? 60 : 0);
long price = numberOfGates * airport.getTerminalGatePrice() + (newTerminal ? airport.getTerminalPrice() : 0);
price = price / 3 * 4;
if (airport.Income > price)
{
for (int i = 0; i < numberOfGates; i++)
{
Gate gate = new Gate(GameObject.GetInstance().GameTime.AddDays(daysToBuild));
gate.Airline = minTerminal.Airline;
minTerminal.Gates.addGate(gate);
}
airport.Income -= price;
airport.LastExpansionDate = GameObject.GetInstance().GameTime;
}
}
//build new terminal
else
{
int numberOfGates = airport.Terminals.getTerminals()[0].Gates.NumberOfDeliveredGates;
int daysToBuild = numberOfGates * 10 + (newTerminal ? 60 : 0);
long price = numberOfGates * airport.getTerminalGatePrice() + (newTerminal ? airport.getTerminalPrice() : 0);
price = price / 3 * 4;
if (airport.Income > price)
{
Terminal terminal = new Terminal(airport, null, "Terminal", numberOfGates, GameObject.GetInstance().GameTime.AddDays(daysToBuild));
airport.addTerminal(terminal);
airport.Income -= price;
airport.LastExpansionDate = GameObject.GetInstance().GameTime;
}
}
}
}
开发者ID:tehknox,项目名称:tap-desktop,代码行数:58,代码来源:AirportHelpers.cs
示例18: Terminal
public Terminal(Airport airport, Airline airline,string name, int gates, DateTime deliveryDate)
{
this.Airport = airport;
this.Airline = airline;
this.Name = name;
this.DeliveryDate = new DateTime(deliveryDate.Year, deliveryDate.Month, deliveryDate.Day);
this.Gates = new Gates(gates, this.DeliveryDate);
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:9,代码来源:Terminal.cs
示例19: FutureSubsidiaryAirline
public FutureSubsidiaryAirline(string name, string iata,Airport airport, Airline.AirlineMentality mentality, Airline.AirlineFocus market, Route.RouteType airlineRouteFocus, string logo)
{
this.Name = name;
this.IATA = iata;
this.PreferedAirport = airport;
this.Mentality = mentality;
this.Market = market;
this.Logo = logo;
this.AirlineRouteFocus = airlineRouteFocus;
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:10,代码来源:FutureSubsidiaryAirline.cs
示例20: PopUpBuildRunway
public PopUpBuildRunway(Airport airport)
{
this.Airport = airport;
InitializeComponent();
this.Uid = "1000";
this.Title = Translator.GetInstance().GetString("PopUpBuildRunway", this.Uid);
this.Width = 400;
this.Height = 210;
this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
StackPanel mainPanel = new StackPanel();
mainPanel.Margin = new Thickness(10, 10, 10, 10);
ListBox lbContent = new ListBox();
lbContent.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
lbContent.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
mainPanel.Children.Add(lbContent);
txtName = new TextBox();
txtName.Width = 200;
txtName.Background = Brushes.Transparent;
txtName.TextChanged += new TextChangedEventHandler(txtName_TextChanged);
lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpBuildRunway", "1001"), txtName));
cbSurface = new ComboBox();
cbSurface.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
cbSurface.Width = 100;
cbSurface.SelectedIndex = 0;
foreach (Runway.SurfaceType surface in this.Airport.Runways.Select(r => r.Surface).Distinct())
cbSurface.Items.Add(surface);
lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpBuildRunway", "1002"), cbSurface));
cbLenght = new ComboBox();
cbLenght.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
cbLenght.Width = 100;
//cbLenght.ItemStringFormat = new NumberMeterToUnitConverter().Convert("{0}").ToString();
cbLenght.SelectedIndex = 0;
for (int i = 1500; i < 4500; i += 250)
cbLenght.Items.Add(i);
lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PopUpBuildRunway", "1003"), cbLenght));
mainPanel.Children.Add(createButtonsPanel());
this.Content = mainPanel;
}
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:55,代码来源:PopUpBuildRunway.xaml.cs
注:本文中的TheAirline.Model.AirportModel.Airport类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论