Exemple #1
0
        private OpenP4kFileResult OpenP4kFile(IFileInfo p4kFile)
        {
            try
            {
                _p4k = new ZipFile(p4kFile.FullName)
                {
                    Key = _key
                };
                var fileTypes = new Dictionary <string, int>();
                FileSystem = new GenerateFileSystem().Generate(_p4k, fileTypes);
                FileName   = p4kFile.FullName;
                Statistics = new P4kFileStatistics(fileTypes);
            }
            catch (Exception ex)
            {
                DisposeCurrentP4k();
                return(new OpenP4kFileResult(ex.Message));
            }

            if (_outputDirectory.Path == null)
            {
                _outputDirectory.Path = p4kFile.DirectoryName;
            }

            _onUiThread.Do(Changed.Raise);

            return(new OpenP4kFileResult());
        }
        private void CreateRootItems()
        {
            foreach (var disposable in RootItems)
            {
                disposable.Dispose();
            }

            _uiDispatch.Do(() =>
            {
                RootItems.Clear();

                CreateContainedDirectories();
                CreateContainedFiles();
            });

            SearchFoundNoMatch = null;
            PropertyChanged.Raise(this, nameof(SearchFoundNoMatch));
        }
Exemple #3
0
        private void RemoveContentsThatDoNotMatchSearchTerm()
        {
            if (!_search.FileResults.Any())
            {
                return;
            }

            var contentsToRemove = Children.Where(c => !ContainsOrIsAnyFileSearchResult(c))
                                   .ToArray();

            foreach (var content in contentsToRemove)
            {
                _uiDispatch.Do(() => Children.Remove(content));
            }
        }