Exemplo n.º 1
0
 public bool LoadProfile(string name)
 {
     if (Profiles.ContainsKey(name))
     {
         var profile = new MyomiProfile(Profiles[name]);
         this.CurrentProfile = profile;
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 public ProfileManagingTask(MyomiProfile profile)
 {
     this._profile = profile;
 }