public RouteFacility(string uid, FacilityType type, string name, int serviceLevel, ExpenseType eType, double expense, FeeType feeType,AirlineFacility requires) { this.Type = type; this.Name = name; this.Uid = uid; this.ServiceLevel = serviceLevel; this.EType = eType; this.ExpensePerPassenger = expense; this.FeeType = feeType; this.Requires = requires; }
//returns the value of a specific fee type public double getValue(FeeType type) { lock (this.Fees) { if (!this.Fees.ContainsKey(type)) { this.Fees.Add(type, type.DefaultValue); } } return this.Fees[type]; }
//returns the list of fees of a specific type public static List<FeeType> GetTypes(FeeType.eFeeType type) { return GetTypes().FindAll(delegate(FeeType t) { return t.Type == type; }); }
//adds a type to the list public static void AddType(FeeType type) { types.Add(type.Name, type); }
//creates the slider for a wage type private WrapPanel createWageSlider(FeeType type) { WrapPanel sliderPanel = new WrapPanel(); TextBlock txtValue = UICreator.CreateTextBlock(new ValueCurrencyConverter().Convert(this.FeeValues[type]).ToString());//UICreator.CreateTextBlock(string.Format("{0:C}", this.FeeValues[type])); txtValue.VerticalAlignment = VerticalAlignment.Bottom; txtValue.Margin = new Thickness(5, 0, 0, 0); txtValue.Tag = type; Slider slider = new Slider(); slider.Width = 200; slider.Value = this.FeeValues[type]; slider.Tag = txtValue; slider.Maximum = type.MaxValue; slider.Minimum = type.MinValue; slider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(slider_ValueChanged); slider.TickFrequency = (type.MaxValue - type.MinValue) / slider.Width; slider.IsSnapToTickEnabled = true; slider.IsMoveToPointEnabled = true; sliderPanel.Children.Add(slider); sliderPanel.Children.Add(txtValue); return sliderPanel; }
//sets the value of a specific fee type public void setValue(FeeType type, double value) { this.Fees[type] = value; }
public RouteFacility(string uid, FacilityType type, string name, int serviceLevel, ExpenseType eType, double expense, FeeType feeType) : this(uid,type,name,serviceLevel,eType,expense,feeType,null) { }
public AirlineFeeMVVM(FeeType feeType, double value) { this.FeeType = feeType; this.Value = value; }
public AirlineFeeMVVM(FeeType feeType, double value) { this.FeeType = feeType; this.Value = value; if (this.FeeType.MaxValue - this.FeeType.MinValue < 4) this.Frequency = 0.05; else this.Frequency = 0.25; }