Example #1
0
        //creates an item for an advertisering type
        private UIElement createAdvertisementTypeItem(AdvertisementType.AirlineAdvertisementType type)
        {
            if (this.Airline.IsHuman)
            {
                ComboBox cbType = new ComboBox();
                cbType.ItemTemplate = this.Resources["AdvertisementItem"] as DataTemplate;
                cbType.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
                cbType.Width = 200;

                cbAdvertisements.Add(type, cbType);

                foreach (AdvertisementType aType in AdvertisementTypes.GetTypes(type))
                {
                    cbType.Items.Add(aType);
                }

                cbType.SelectedItem = this.Airline.getAirlineAdvertisement(type);

                return(cbType);
            }
            // chs, 2011-17-10 changed so it is not possible to change the advertisement type for a CPU airline
            else
            {
                return(UICreator.CreateTextBlock(this.Airline.getAirlineAdvertisement(type).Name));
            }
        }
 /*!returns the basic advertisement
  */
 public static AdvertisementType GetBasicType(AdvertisementType.AirlineAdvertisementType type)
 {
     return(GetTypes(type).Find((delegate(AdvertisementType t) { return t.ReputationLevel == 0; })));
 }
 /*!returns the advertisement type for a specific type with a name
  */
 public static AdvertisementType GetType(AdvertisementType.AirlineAdvertisementType type, string name)
 {
     return(GetTypes(type).Find((delegate(AdvertisementType t) { return t.Name == name; })));
 }
 /*!returns the advertisement types for a specific type
  */
 public static List <AdvertisementType> GetTypes(AdvertisementType.AirlineAdvertisementType type)
 {
     return(types.FindAll((delegate(AdvertisementType t) { return t.Type == type; })));
 }
Example #5
0
 //returns the advertisement for the airline for a specific type
 public AdvertisementType getAirlineAdvertisement(AdvertisementType.AirlineAdvertisementType type)
 {
     return(this.Advertisements[type]);
 }
Example #6
0
 public AirlineAdvertisementMVVM(AdvertisementType.AirlineAdvertisementType type)
 {
     this.Type = type;
 }