private void previewBtn_Click(object sender, EventArgs e) { if (this.fileBox.SelectedItem != "" && this.fileBox.SelectedItem != null) { var file = this.currentFolderFiles[this.fileBox.SelectedIndex]; if (file.Extension == ".png" || file.Extension == ".bmp" || file.Extension == ".jpeg" || file.Extension == ".jpg" || file.Extension == ".gif") { var preview = new PreviewForm(new Bitmap(file.FullName)); preview.Show(); } else if (file.Extension == ".ogg") { if (this.stopPreviewBtn.Enabled != true) { this.stopPreviewBtn.Enabled = true; } if (this.currentlyPlayingSound != null) { this.currentlyPlayingSound.Stop(); this.currentlyPlayingSound = null; } this.currentlyPlayingSound = this.soundEngine.Play2D(file.FullName); } else if (file.Extension == ".js" || file.Extension == ".xml" || file.Extension == ".json" || file.Extension == ".html" || file.Extension == ".txt") { var preview = new PreviewForm(file.FullName, false); preview.Show(); } else if (file.Extension == ".rpgsave") { var preview = new PreviewForm(file.FullName, true); preview.Show(); } } }