CHelper now fully static
This commit is contained in:
1 parent
e6f70daf63
commit
78870ae26d
11 files changed
+30
-46
No files matched your search
@@ -7,8 +7,9 @@ using System.Text;
|
||||
|
||||
namespace Vocaluxe.Menu
|
||||
{
|
||||
public class CHelper
|
||||
public static class CHelper
|
||||
{
|
||||
|
||||
public static int nCk(int n, int k)
|
||||
{
|
||||
if (k > n)
|
||||
@@ -128,17 +129,17 @@ namespace Vocaluxe.Menu
|
||||
|
||||
|
||||
|
||||
public List<string> ListFiles(string path, string cast)
|
||||
public static List<string> ListFiles(string path, string cast)
|
||||
{
|
||||
return ListFiles(path, cast, false, false);
|
||||
}
|
||||
|
||||
public List<string> ListFiles(string path, string cast, bool recursive)
|
||||
public static List<string> ListFiles(string path, string cast, bool recursive)
|
||||
{
|
||||
return ListFiles(path, cast, recursive, false);
|
||||
}
|
||||
|
||||
public List<string> ListFiles(string path, string cast, bool recursive, bool fullpath)
|
||||
public static List<string> ListFiles(string path, string cast, bool recursive, bool fullpath)
|
||||
{
|
||||
List<string> files = new List<string>();
|
||||
DirectoryInfo dir = new DirectoryInfo(path);
|
||||
@@ -151,7 +152,6 @@ namespace Vocaluxe.Menu
|
||||
if (!fullpath)
|
||||
files.Add(file.Name);
|
||||
else
|
||||
//files.Add(Path.Combine(file.DirectoryName, file.Name));
|
||||
files.Add(file.FullName);
|
||||
}
|
||||
|
||||
|
||||
@@ -818,11 +818,9 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
private void CheckFiles()
|
||||
{
|
||||
CHelper Helper = new CHelper();
|
||||
|
||||
if(this.CoverFileName == String.Empty){
|
||||
List<string> files = Helper.ListFiles(this.Folder, "*.jpg", false);
|
||||
files.AddRange(Helper.ListFiles(this.Folder, "*.png", false));
|
||||
List<string> files = CHelper.ListFiles(this.Folder, "*.jpg", false);
|
||||
files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false));
|
||||
foreach(String file in files)
|
||||
{
|
||||
if (Regex.IsMatch(file, @".[CO].", RegexOptions.IgnoreCase) && (Regex.IsMatch(file, @"" + Regex.Escape(this.Title), RegexOptions.IgnoreCase) || Regex.IsMatch(file, @"" + Regex.Escape(this.Artist), RegexOptions.IgnoreCase)))
|
||||
@@ -834,8 +832,8 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
if (this.BackgroundFileName == String.Empty)
|
||||
{
|
||||
List<string> files = Helper.ListFiles(this.Folder, "*.jpg", false);
|
||||
files.AddRange(Helper.ListFiles(this.Folder, "*.png", false));
|
||||
List<string> files = CHelper.ListFiles(this.Folder, "*.jpg", false);
|
||||
files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false));
|
||||
foreach (String file in files)
|
||||
{
|
||||
|
||||
|
||||
Reference in new issue
Block a user