当前位置: 首页>>代码示例>>C#>>正文


C# AirlineModel.Airline类代码示例

本文整理汇总了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;
        }
开发者ID:tehknox,项目名称:tap-desktop,代码行数:7,代码来源:PopUpAddCooperation.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: 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();
        }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:34,代码来源:PageAirlinePilots.xaml.cs

示例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);
     }
 }
开发者ID:tehknox,项目名称:tap-desktop,代码行数:8,代码来源:PassengerHelpers.cs

示例5: ShowPopUp

        public static object ShowPopUp(Airline airline)
        {
            PopUpWindow window = new PopUpCodeshareAgreement(airline);
            window.ShowDialog();

            return window.Selected;
        }
开发者ID:tehknox,项目名称:tap-desktop,代码行数:7,代码来源:PopUpCodeshareAgreement.xaml.cs

示例6: AirlineStartData

 public AirlineStartData(Airline airline)
 {
     this.Airline = airline;
     this.Routes = new List<StartDataRoute>();
     this.Airliners = new List<StartDataAirliners>();
     this.OriginRoutes = new List<StartDataRoutes>();
 }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:7,代码来源:AirlineStartData.cs

示例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);
        }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:33,代码来源:PageFinances.xaml.cs

示例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;
 }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:10,代码来源:AirportStatistics.cs

示例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);
        }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:9,代码来源:Terminal.cs

示例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;
        }
开发者ID:tehknox,项目名称:tap-desktop,代码行数:10,代码来源:AirportStatistics.cs

示例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();
        }
开发者ID:tehknox,项目名称:tap-desktop,代码行数:9,代码来源:PopUpCodeshareAgreement.xaml.cs

示例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);
                }
            }
            */
        }
开发者ID:tehknox,项目名称:tap-desktop,代码行数:57,代码来源:EventsHelpers.cs

示例13: PageAirlineInsurances

        public PageAirlineInsurances(Airline airline)
        {
            this.Airline = airline;

            InitializeComponent();

            this.DataContext = this.Airline;

            clearValues();
        }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:10,代码来源:PageAirlineInsurances.xaml.cs

示例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);
     }
 }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:11,代码来源:PassengerHelpers.cs

示例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));
 }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:11,代码来源:AirportStatistics.cs


注:本文中的TheAirline.Model.AirlineModel.Airline类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。