public bool LoadProfile(string name) { if (Profiles.ContainsKey(name)) { var profile = new MyomiProfile(Profiles[name]); this.CurrentProfile = profile; return(true); } return(false); }
public bool AddNewProfile(MyomiProfile toAdd) { //first, check to see if there are duplicated names if (Profiles.Any(profile => profile.Key == toAdd.Name)) { return(false); } this.Profiles.Add(toAdd.Name, toAdd.ID); //after we add it, we would like to set the focus to this profile this.CurrentProfile = toAdd; return(true); }
private static void CreateProfile() { Console.WriteLine("What would you like to name your new profile?"); string profileName = Console.ReadLine(); var profile = new MyomiProfile(profileName); if (Context.Instance.AddNewProfile(profile)) { Console.WriteLine("The new profile has been added, the current profile has been set to it"); } else { Console.WriteLine("There is already a profile with the name {0}", profileName); } }
public ProfileManagingTask(MyomiProfile profile) { this._profile = profile; }