Ejemplo n.º 1
0
 private void MediaOpened(object sender, EventArgs args)
 {
     if (this.openingDialog == null)
     {
         return;
     }
     this.openingDialog.Close(new bool?(true));
     this.openingDialog = (MediaOpener.MediaFileOpeningDialog)null;
 }
Ejemplo n.º 2
0
        private void MediaFailed(object sender, ExceptionEventArgs args)
        {
            if (this.openingDialog == null)
            {
                return;
            }
            string targetPath = this.openingDialog.TargetPath;

            this.openingDialog.Close(new bool?(false));
            this.openingDialog = (MediaOpener.MediaFileOpeningDialog)null;
            this.messageManager.ShowError(string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.MediaDocumentTypeMediaFailedDialogMessage, new object[2]
            {
                (object)targetPath,
                args == null || args.ErrorException == null ? (object)string.Empty : (object)args.ErrorException.Message
            }));
        }
Ejemplo n.º 3
0
        public bool?OpenMedia()
        {
            this.openingDialog = new MediaOpener.MediaFileOpeningDialog(this.actualPath);
            MediaPlayer player = new MediaPlayer();

            this.AttachMediaPlayer(player);
            bool?nullable = new bool?();

            try
            {
                try
                {
                    player.Open(this.uri);
                }
                catch (NotSupportedException ex)
                {
                    int num = (int)this.messageManager.ShowMessage(StringTable.MediaPlayerTenRequired);
                    return(new bool?(false));
                }
                catch (COMException ex)
                {
                    int num = (int)this.messageManager.ShowMessage(StringTable.MediaInsertOutOfResources);
                    return(new bool?(false));
                }
                if (this.openingDialog != null)
                {
                    nullable = this.openingDialog.ShowDialog();
                    if (this.openingDialog != null)
                    {
                        this.openingDialog = (MediaOpener.MediaFileOpeningDialog)null;
                    }
                }
            }
            finally
            {
                this.DetachMediaPlayer(player);
            }
            if (nullable.HasValue && nullable.Value)
            {
                this.player = player;
            }
            return(nullable);
        }