本文整理汇总了C#中TheAirline.Model.AirlineModel.Airline类的典型用法代码示例。如果您正苦于以下问题:C# Airline类的具体用法?C# Airline怎么用?C# Airline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Airline类属于TheAirline.Model.AirlineModel命名空间,在下文中一共展示了Airline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowPopUp
public static object ShowPopUp(Airline airline,Airport airport)
{
PopUpWindow window = new PopUpAddCooperation(airline,airport);
window.ShowDialog();
return window.Selected;
}
示例2: AirlineAirportFacility
public AirlineAirportFacility(Airline airline, Airport airport, AirportFacility facility, DateTime date)
{
this.Airline = airline;
this.Facility = facility;
this.FinishedDate = date;
this.Airport = airport;
}
示例3: PageAirlinePilots
public PageAirlinePilots(Airline airline)
{
this.Airline = airline;
InitializeComponent();
StackPanel panelPilots = new StackPanel();
panelPilots.Margin = new Thickness(0, 10, 50, 0);
TextBlock txtHeader = new TextBlock();
txtHeader.Uid = "1001";
txtHeader.Margin = new Thickness(0, 0, 0, 0);
txtHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
txtHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
txtHeader.FontWeight = FontWeights.Bold;
txtHeader.Text = Translator.GetInstance().GetString("PageAirlinePilots", txtHeader.Uid);
panelPilots.Children.Add(txtHeader);
ContentControl ccHeader = new ContentControl();
ccHeader.ContentTemplate = this.Resources["PilotsHeader"] as DataTemplate;
ccHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
panelPilots.Children.Add(ccHeader);
lbPilots = new ListBox();
lbPilots.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
lbPilots.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
lbPilots.ItemTemplate = this.Resources["PilotItem"] as DataTemplate;
lbPilots.MaxHeight = GraphicsHelpers.GetContentHeight() / 2;
panelPilots.Children.Add(lbPilots);
this.Content = panelPilots;
showPilots();
}
示例4: ChangePaxDemand
//changes the demand for all airports belonging to an airline with a factor
public static void ChangePaxDemand(Airline airline, double factor)
{
foreach (Airport a in airline.Airports)
{
ChangePaxDemand(a, factor);
}
}
示例5: ShowPopUp
public static object ShowPopUp(Airline airline)
{
PopUpWindow window = new PopUpCodeshareAgreement(airline);
window.ShowDialog();
return window.Selected;
}
示例6: AirlineStartData
public AirlineStartData(Airline airline)
{
this.Airline = airline;
this.Routes = new List<StartDataRoute>();
this.Airliners = new List<StartDataAirliners>();
this.OriginRoutes = new List<StartDataRoutes>();
}
示例7: PageFinances
public PageFinances(Airline airline)
{
//binds and initializes page
InitializeComponent();
this.Language = XmlLanguage.GetLanguage(new CultureInfo(AppSettings.GetInstance().getLanguage().CultureInfo, true).IetfLanguageTag);
SetLocalDefaults(airline);
// binds top level budgets and buttons
Button btnApply = (Button)this.FindName("buttonApply");
Button btnReset = (Button)this.FindName("buttonReset");
Button btn1Year = (Button)this.FindName("_1year");
Button btn5Year = (Button)this.FindName("_5year");
Button btn10Year = (Button)this.FindName("_10year");
Viewbox panelContent = (Viewbox)this.FindName("panelViewbox");
setMaximums(airline);
BudgetHelpers.SetDefaults(airline);
SetLocalDefaults(airline);
SetOverviewPanel(airline, 1);
//event handlers
btnApply.Click += new RoutedEventHandler(btnApply_Click);
btnReset.Click += new RoutedEventHandler(btnReset_Click);
btn1Year.Click += new RoutedEventHandler(btn1Year_Click);
btn5Year.Click += new RoutedEventHandler(btn5Year_Click);
btn10Year.Click += new RoutedEventHandler(btn10Year_Click);
this.RemoveLogicalChild(panelContent);
base.setContent(panelContent);
showPage(this);
}
示例8: getStatisticsValue
//returns the value for a statistics type for an airline for a year
public double getStatisticsValue(int year, Airline airline, StatisticsType type)
{
if (this.Stats.ContainsKey(year))
{
AirportStatisticsValue value = this.Stats[year].Find(asv => asv.Airline == airline && asv.Stat == type);
if (value != null) return value.Value;
}
return 0;
}
示例9: 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);
}
示例10: addStatisticsValue
//adds the value for a statistics type to an airline for a year
public void addStatisticsValue(int year, Airline airline, StatisticsType type, int value)
{
AirportStatisticsValue item = this.Stats.Find(s => s.Year == year && s.Airline == airline && s.Stat.Shortname == type.Shortname);
if (item == null)
this.Stats.Add(new AirportStatisticsValue(airline, year, type, value));
else
item.Value += value;
}
示例11: PopUpCodeshareAgreement
public PopUpCodeshareAgreement(Airline airline)
{
this.Airline = airline;
this.DataContext = this.Airline;
this.Price = AirlineHelpers.GetCodesharingPrice(this.Airline,GameObject.GetInstance().HumanAirline);
this.TicketSalePercent = CodeshareAgreement.TicketSalePercent;
InitializeComponent();
}
示例12: GenerateEvents
//generates x number of events for each event type for the current year. Should be called only from OnNewYear
public static void GenerateEvents(Airline airline)
{
Random rnd = new Random();
Dictionary<RandomEvent.EventType, double> eventOccurences = new Dictionary<TheAirline.Model.GeneralModel.RandomEvent.EventType, double>();
int eFreq = 0;
double secEvents;
double safEvents;
double polEvents;
double maintEvents;
double custEvents;
double empEvents;
//sets an overall event frequency based on an airlines total overall rating
int totalRating = airline.Ratings.CustomerHappinessRating + airline.Ratings.EmployeeHappinessRating + airline.Ratings.SafetyRating + airline.Ratings.SecurityRating;
if (totalRating < 300)
{
eFreq = (int)rnd.Next(1, 6);
}
else if (totalRating < 200)
{
eFreq = (int)rnd.Next(4, 10);
}
else if (totalRating < 100)
{
eFreq = (int)rnd.Next(8, 16);
}
else eFreq = (int)rnd.Next(0, 4);
//gets the event proportions and multiplies them by total # events to get events per type
List<double> probs = GetEventProportions(airline);
custEvents = (int)eFreq * probs[0];
empEvents = (int)eFreq * probs[1];
secEvents = (int)eFreq * probs[2];
safEvents = (int)eFreq * probs[3];
maintEvents = (int)eFreq * probs[4];
polEvents = eFreq - custEvents - empEvents - secEvents - maintEvents;
eventOccurences.Add(RandomEvent.EventType.Customer, custEvents);
eventOccurences.Add(RandomEvent.EventType.Employee, empEvents);
eventOccurences.Add(RandomEvent.EventType.Maintenance, maintEvents);
eventOccurences.Add(RandomEvent.EventType.Safety, safEvents);
eventOccurences.Add(RandomEvent.EventType.Security, secEvents);
eventOccurences.Add(RandomEvent.EventType.Political, polEvents);
/*
//generates the given number of events for each type
foreach (KeyValuePair<RandomEvent.EventType, double> v in eventOccurences)
{
int k = (int)v.Value;
List<RandomEvent> list = RandomEvents.GetEvents(v.Key, k, airline);
foreach (RandomEvent e in list)
{
airline.EventLog.Add(e);
}
}
*/
}
示例13: PageAirlineInsurances
public PageAirlineInsurances(Airline airline)
{
this.Airline = airline;
InitializeComponent();
this.DataContext = this.Airline;
clearValues();
}
示例14: AddPassengerHappiness
//adds happiness to an airline
public static void AddPassengerHappiness(Airline airline)
{
lock (HappinessPercent)
{
if (HappinessPercent.ContainsKey(airline))
HappinessPercent[airline] += 1;
else
HappinessPercent.Add(airline, 1);
}
}
示例15: setStatisticsValue
//sets the value for a statistics type for an airline for a year
public void setStatisticsValue(int year, Airline airline, StatisticsType type, int value)
{
if (!(this.Stats.ContainsKey(year)))
this.Stats.Add(year, new List<AirportStatisticsValue>());
AirportStatisticsValue statValue = this.Stats[year].Find(asv => asv.Airline == airline && asv.Stat == type);
if (statValue != null)
statValue.Value = value;
else
this.Stats[year].Add(new AirportStatisticsValue(airline, type, value));
}