private void ShowFile(PackageFile file) { bool isBinary = IsBinaryFile(file.Name); long size; string content; if (isBinary) { content = Resources.UnsupportedFormatMessage; using (Stream stream = file.GetStream()) { size = stream.Length; } } else { content = ReadFileContent(file, out size); } var fileInfo = new FileContentInfo( file, file.Path, content, !isBinary, size, DetermineLanguage(file.Name)); ViewModel.ShowFile(fileInfo); }
public void ShowFile(FileContentInfo fileInfo) { ShowContentViewer = true; CurrentFileInfo = fileInfo; }