private void ProfilesManager_OnPropertyUpdatedEvent(short key, IObservableProperty property)
 {
     if (key == (short)ObservablePropertiyCodes.DisplayName)
     {
         DisplayName = property.CastTo <ObservableString>().GetValue();
     }
     else if (key == (short)ObservablePropertiyCodes.Avatar)
     {
         LoadAvatarImage(property.Serialize());
     }
     else if (key == (short)ObservablePropertiyCodes.Bronze)
     {
         Bronze = property.CastTo <ObservableFloat>().GetValue().ToString("F2");
     }
     else if (key == (short)ObservablePropertiyCodes.Silver)
     {
         Silver = property.CastTo <ObservableFloat>().GetValue().ToString("F2");
     }
     else if (key == (short)ObservablePropertiyCodes.Gold)
     {
         Gold = property.CastTo <ObservableFloat>().GetValue().ToString("F2");
     }
 }
Beispiel #2
0
 private void ProfilesManager_OnPropertyUpdatedEvent(short key, IObservableProperty property)
 {
     if (key == (short)ObservablePropertiyCodes.DisplayName)
     {
         DisplayName = $"Name: {property.Serialize()}";
     }
     else if (key == (short)ObservablePropertiyCodes.Avatar)
     {
         LoadAvatarImage(property.Serialize());
     }
     else if (key == (short)ObservablePropertiyCodes.Level)
     {
         Level = $"Level: {property.CastTo<ObservableFloat>().GetValue().ToString("F2")}";
     }
     else if (key == (short)ObservablePropertiyCodes.XP)
     {
         XP = $"XP: {property.CastTo<ObservableFloat>().GetValue().ToString("F2")}";
     }
     else if (key == (short)ObservablePropertiyCodes.Gold)
     {
         Gold = $"Gold: {property.CastTo<ObservableFloat>().GetValue().ToString("F2")}";
     }
 }