private bool ProcessFile(string _entry) { var _fullPath = _entry; if (System.IO.Path.GetExtension(_entry) != ".zip") { return(false); } _entry = System.IO.Path.GetFileName(_entry); var _Matches = _Regex_ParseFileName.Match(_entry); if (!_Matches.Success) { Console.WriteLine("Unable to parse file name: {0}.", _entry); return(false); } var _Title = _Matches.Groups[1]?.Value; var _Second = _Matches.Groups[2]?.Value; var _Third = _Matches.Groups[3]?.Value; var _Year = new ulong(); var _Developer = ""; if (ulong.TryParse(_Second, out _Year)) { _Developer = _Third; } else if (ulong.TryParse(_Third, out _Year)) { _Developer = _Second; } else { Console.WriteLine("Unable to parse file name: {0}.", _entry); return(false); } var _item = new GameMetadataModel() { Path = _fullPath, Title = _Title.Trim(), Year = _Year, Developer = _Developer.Trim() }; m_DataList.Add(_item); return(true); }
private bool FilterGrid(GameMetadataModel _object) { if (m_TextFilter == null || m_TextFilter.Length == 0) { return(true); } var _key = m_TextFilter.ToLower(); if (_object.Title.ToLower().Contains(_key) || _object.Developer.ToLower().Contains(_key) || _object.Path.ToLower().Contains(_key)) { return(true); } return(false); }