private void LoadFile(FileInfo fInfo) { try { using var stream = fInfo.OpenRead(); using var reader = new BinaryReader(stream); file_ = new SmxFile(reader); } catch (Exception e) { detailbox_.Text = Program.Translations.GetLanguage("ErrorFileLoadProc") + Environment.NewLine + Environment.NewLine + $"{Program.Translations.GetLanguage("Details")}: " + e.Message; return; } RenderFile(); }
private void openFile(Stream stream) { try { using (stream) using (var reader = new BinaryReader(stream)) { file_ = new SmxFile(reader); } } catch (Exception ex) { MessageBox.Show("Could not parse file: " + ex.Message); return; } renderFile(); }
private void LoadFile(FileInfo fInfo) { try { using (var stream = fInfo.OpenRead()) { using (var reader = new BinaryReader(stream)) { file_ = new SmxFile(reader); } } } catch (Exception e) { detailbox_.Text = Program.Translations.ErrorFileLoadProc + Environment.NewLine + Environment.NewLine + $"{Program.Translations.Details}: " + e.Message; return; } renderFile(); }
private void LoadFile(FileInfo fInfo) { try { using (var stream = fInfo.OpenRead()) { using (var reader = new BinaryReader(stream)) { file_ = new SmxFile(reader); } } } catch (Exception e) { detailbox_.Text = "Error while loading and processing the file." + Environment.NewLine + Environment.NewLine + "Details: " + e.Message; return; } renderFile(); }