public override void DataSet(string myPath, string myPattern)
{
string[] fileList = Directory.GetFiles(myPath, myPattern, SearchOption.AllDirectories);
Regex regexMov = new Regex(MovieContents.REGEX_MOVIE_EXTENTION, RegexOptions.IgnoreCase);
Regex regexJpg = new Regex(@".*\.jpg$|.*\.jpeg$", RegexOptions.IgnoreCase);
Regex regexLst = new Regex(@".*\.wpl$|.*\.asx$", RegexOptions.IgnoreCase);
foreach (string file in fileList)
{
listFileInfo.Add(new common.FileContents(file, myPath));
if (regexMov.IsMatch(file))
MovieCount++;
if (regexJpg.IsMatch(file))
ImageCount++;
if (regexLst.IsMatch(file))
ListCount++;
if (regexJpg.IsMatch(file) && ImageCount == 1)
StartImagePathname = file;
}
ColViewListFileInfo = CollectionViewSource.GetDefaultView(listFileInfo);
if (ColViewListFileInfo != null && ColViewListFileInfo.CanSort == true)
{
ColViewListFileInfo.SortDescriptions.Clear();
ColViewListFileInfo.SortDescriptions.Add(new SortDescription("FileInfo.LastWriteTime", ListSortDirection.Ascending));
}
}