public static void RenameProfile(ProfileModel profile, string name) { if (string.IsNullOrEmpty(name)) return; // Remove the old profile DeleteProfile(profile); // Update the profile, creating a new file profile.Name = name; AddOrUpdate(profile); }