private void OpenFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.OpenDevilDaggersRootFolder(); bool?openResult = openDialog.ShowDialog(); if (openResult == true) { byte[] sourceFileBytes = File.ReadAllBytes(openDialog.FileName); AnalyzerFileResult?result = TryReadResourceFile(openDialog.FileName, sourceFileBytes) ?? TryReadParticleFile(openDialog.FileName, sourceFileBytes); if (result == null) { App.Instance.ShowMessage("File not recognized", "Make sure to open one of the following binary files: audio, core, dd, particle"); } else { ShowFileResult(result); } } }