コード例 #1
0
ファイル: SoundController.cs プロジェクト: Rampant-ai/Senesco
 private void AddUserProfile()
 {
    SoundProfile userProfile = new SoundProfile(false);
    userProfile.DisplayName = SoundProfile.ProfileName_User;
    userProfile.Restore();
    Profiles.Add(userProfile);
 }
コード例 #2
0
ファイル: SoundController.cs プロジェクト: Rampant-ai/Senesco
      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
ファイル: SoundController.cs プロジェクト: Rampant-ai/Senesco
 private void AddEmptyProfile()
 {
    SoundProfile emptyProfile = new SoundProfile(true);
    emptyProfile.DisplayName = SoundProfile.ProfileName_Empty;
    Profiles.Add(emptyProfile);
 }