示例#1
0
        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);
        }
示例#2
0
 public void ShowFile(FileContentInfo fileInfo)
 {
     ShowContentViewer = true;
     CurrentFileInfo = fileInfo;
 }