Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#@ template debug="false" hostspecific="true" language="C#" #>
- <#@ assembly name="System.Core" #>
- <#@ import namespace="System.Linq" #>
- <#@ import namespace="System.IO" #>
- <#@ output extension=".cs" #>
- namespace MyNamespace
- {
- public enum SoundNames
- {
- <#
- string path = this.Host.ResolvePath("");
- Directory.SetCurrentDirectory(path);
- string soundFilesPath = @".\Sounds\";
- var soundNames = Directory
- .GetFiles(soundFilesPath, "*.*", SearchOption.AllDirectories)
- .Where(file => file.ToLower().EndsWith("wav") || file.ToLower().EndsWith("mp3"))
- .Select(soundFilePath => Path.GetFileNameWithoutExtension(soundFilePath))
- .ToList();
- foreach (var name in soundNames)
- {
- #>
- <#= name #>,
- <#
- }
- #>
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement