Ejemplo n.º 1
0
 private void recreateRewardList()
 {
     RewardSummary.Clear();
     foreach (var element in Encounters)
     {
         RewardSummary.Add(element.Reward);
     }
 }
Ejemplo n.º 2
0
 private void recreateRewardList()
 {
     RewardSummary.Clear();
     foreach (var element in Stages)
     {
         RewardSummary.AddRange(element.RewardSummary);
         RewardSummary.Add(element.AdditionalReward);
     }
 }
Ejemplo n.º 3
0
 private void encounters_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
     {
         recreateRewardList();
         RewardSummary.Clear();
     }
     else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
     {
         foreach (Encounter element in e.NewItems)
         {
             element.PropertyChanged += encounterReward_PropertyChanged;
         }
         recreateRewardList();
     }
     else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace)
     {
         foreach (Encounter element in e.OldItems ?? new List <Encounter>())
         {
             element.PropertyChanged -= encounterReward_PropertyChanged;
         }
         foreach (Encounter element in e.NewItems)
         {
             element.PropertyChanged += encounterReward_PropertyChanged;
         }
         recreateRewardList();
     }
     else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
     {
         foreach (Encounter element in e.OldItems)
         {
             element.PropertyChanged -= encounterReward_PropertyChanged;
         }
         recreateRewardList();
     }
 }