/// <summary> /// Switches to the requested profile /// </summary> /// <param name="Id">Id of the profile to switch to</param> public void SwitchProfile(int Id) { var profileMemento = ActiveProfile.MakeMemento(); ProfileCaretaker.AddOrUpdateProfile(profileMemento); var newProfile = ProfileCaretaker.GetProfile(Id); ActiveProfile.LoadMemento(newProfile); }
/// <summary> /// Creates a new profile and sets it as active /// </summary> public void NewProfile() { if (ActiveProfile == null) { ActiveProfile = new Profile(ProfileCaretaker.TotalProfiles); } else { ProfileCaretaker.AddOrUpdateProfile(ActiveProfile.MakeMemento()); } ActiveProfile.ItemCollection.Clear(); ActiveProfile.Id = ProfileCaretaker.TotalProfiles; ProfileCaretaker.AddOrUpdateProfile(ActiveProfile.MakeMemento()); }