示例#1
0
 private void AddUserProfile()
 {
    SoundProfile userProfile = new SoundProfile(false);
    userProfile.DisplayName = SoundProfile.ProfileName_User;
    userProfile.Restore();
    Profiles.Add(userProfile);
 }
示例#2
0
      private SoundProfile CreateProfileFromDirectory(DirectoryInfo profileDir, bool readOnly)
      {
         SoundProfile profile = new SoundProfile(readOnly);

         // Name the profile after the directory.
         profile.DisplayName = profileDir.Name;

         // Look in this directory for files named the same as the SoundItem.Name
         // property.  We do this by inserting the name between the profile path
         // and the expected sound file extension, then checking if that file exists.
         foreach (SoundItem item in profile.SoundItems)
         {
            string fullPath = Path.Combine(profileDir.FullName, item.Name.ToString());
            fullPath = Path.ChangeExtension(fullPath, c_soundFileExtension);
            if (File.Exists(fullPath))
               item.FilePath = fullPath;
         }

         return profile;
      }
示例#3
0
 private void AddEmptyProfile()
 {
    SoundProfile emptyProfile = new SoundProfile(true);
    emptyProfile.DisplayName = SoundProfile.ProfileName_Empty;
    Profiles.Add(emptyProfile);
 }