Don't include empty namespace in sample lookup

This commit is contained in:
smoogipoo 2018-07-02 14:35:03 +09:00
parent 7f832e34c0
commit 189194ee8d
1 changed files with 9 additions and 4 deletions

View File

@ -34,11 +34,16 @@ public class SampleInfo
/// </summary>
public int Volume;
public virtual IEnumerable<string> LookupNames => new[]
public virtual IEnumerable<string> LookupNames
{
$"{Namespace}/{Bank}-{Name}",
$"{Bank}-{Name}" // Without namespace as a fallback
};
get
{
if (!string.IsNullOrEmpty(Namespace))
yield return $"{Namespace}/{Bank}-{Name}";
yield return $"{Bank}-{Name}"; // Without namespace as a fallback even when we have a namespace
}
}
public SampleInfo Clone() => (SampleInfo)MemberwiseClone();
}