Inheritance: DomainEntity
示例#1
0
 void OnUnitTypeChanged(UnitType unitType)
 {
     var viewmodel = (from vm in AllUnitTypes where vm.Id == unitType.Id select vm).FirstOrDefault();
     if (viewmodel == null)
     {
         viewmodel = new SingleUnitTypeViewModel(unitType);
         AllUnitTypes.Add(viewmodel);
     }
     else
         viewmodel.ExchangeData(unitType);
     OnPropertyChanged("ItemSelected");
     OnPropertyChanged("ItemsSelected");
 }
 public SingleUnitTypeViewModel(UnitType unitType)
 {
     _unitType = unitType;
     base.DisplayName = unitType.Name;
 }
示例#3
0
 private static UnitType SetId(UnitType unitType, int id)
 {
     var field = typeof(UnitType).GetProperty("Id"); //, BindingFlags.Instance | BindingFlags.SetProperty);
     if (field != null)
         field.SetValue(unitType, id, null);
     return unitType;
 }
 public void ExchangeData(UnitType unitType)
 {
     _unitType = unitType;
 }
示例#5
0
 public EditUnitType(UnitType unitType)
 {
     UnitType = unitType;
 }