public void ShowMedia(GDMMultimediaRecord mediaRec, bool modal) { if (mediaRec == null) { throw new ArgumentNullException("mediaRec"); } GDMFileReferenceWithTitle fileRef = mediaRec.FileReferences[0]; MultimediaKind mmKind = GKUtils.GetMultimediaKind(fileRef.MultimediaFormat); if (mmKind == MultimediaKind.mkNone) { return; } bool externalViewer = !GlobalOptions.Instance.EmbeddedMediaPlayer && ((mmKind == MultimediaKind.mkAudio || mmKind == MultimediaKind.mkVideo)); if (externalViewer) { string targetFile = fContext.MediaLoad(fileRef); GKUtils.LoadExtFile(targetFile); } else { //var mediaViewer = AppHost.Container.Resolve<IMediaViewerWin>(this); MediaViewerWin mediaViewer = new MediaViewerWin(this); try { try { mediaViewer.FileRef = fileRef; if (modal) { mediaViewer.Show(); } else { mediaViewer.ShowInTaskbar = true; mediaViewer.Show(); } } finally { if (modal) { mediaViewer.Dispose(); } } } catch (Exception ex) { if (mediaViewer != null) { mediaViewer.Dispose(); } Logger.LogWrite("BaseWinSDI.ShowMedia(): " + ex.Message); } } }
public void ShowMedia(GDMMultimediaRecord mediaRec, bool modal) { if (mediaRec == null) { throw new ArgumentNullException("mediaRec"); } GDMFileReferenceWithTitle fileRef = mediaRec.FileReferences[0]; if (fileRef == null) { return; } if (!GKUtils.UseEmbeddedViewer(fileRef.MultimediaFormat)) { string targetFile = fContext.MediaLoad(fileRef); GKUtils.LoadExtFile(targetFile); } else { //var mediaViewer = AppHost.Container.Resolve<IMediaViewerWin>(this); MediaViewerWin mediaViewer = new MediaViewerWin(this); try { try { mediaViewer.Multimedia = mediaRec; mediaViewer.FileRef = fileRef; if (modal) { mediaViewer.ShowDialog(); } else { mediaViewer.ShowInTaskbar = true; mediaViewer.Show(); } } finally { if (modal) { mediaViewer.Dispose(); } } } catch (Exception ex) { if (mediaViewer != null) { mediaViewer.Dispose(); } Logger.WriteError("BaseWinSDI.ShowMedia()", ex); } } }
public override void TearDown() { fDialog.Dispose(); }