public override void Set(AaxFileItem fileItem)
        {
            textBoxTitle.Text = fileItem.BookTitle;

            var rtfbld = new RtfBuilder();

            rtfbld.AppendItem(R.HdrAuthor, fileItem.Author);
            rtfbld.AppendItem(R.HdrNarrator, fileItem.Narrator);
            rtfbld.AppendItem(R.HdrSize, $"{fileItem.FileSize / (1024 * 1024)} MB");
            rtfbld.AppendItem(R.HdrDuration, fileItem.Duration.ToStringHMS());
            rtfbld.AppendItem(R.HdrYear, fileItem.PublishingDate?.Year.ToString());
            rtfbld.AppendItem(R.HdrPublisher, fileItem.Publisher);
            rtfbld.AppendItem(R.HdrCopyright, fileItem.Copyright);


            string rtf = rtfbld.ToRtf();

            richTextBoxMeta.Clear();
            richTextBoxMeta.Rtf = rtf;

            var converter = new ImageConverter();

            pictureBox.Image = converter.ConvertFrom(fileItem.Cover) as Image;

            richTextBoxAbstract.Clear();
            richTextBoxAbstract.Text = fileItem.Abstract;
        }
Exemplo n.º 2
0
 public AaxFileItemEx(AaxFileItem fi)
 {
     if (fi is null)
     {
         throw new ArgumentNullException();
     }
     FileItem = fi;
 }
Exemplo n.º 3
0
        private void tsmiPreview_Click(object sender, EventArgs e)
        {
            AaxFileItem fi = getFocusedFileItem();

            if (fi is null)
            {
                return;
            }

            openPreviewForm(fi);
        }
Exemplo n.º 4
0
        private void tsmiDetails_Click(object sender, EventArgs e)
        {
            AaxFileItem fi = getFocusedFileItem();

            if (fi is null)
            {
                return;
            }

            openFileDetailsForm(fi);
        }
Exemplo n.º 5
0
 private void openNonModalForm <F> (AaxFileItem fi, ref F form, FormClosedEventHandler handler) where F : FileItemForm, new()
 {
     if (form is null)
     {
         form = new F {
             Owner = this, Location = _contextMenuPoint, Previewer = _converter
         };
         form.FormClosed += handler;
         form.Set(fi);
         form.Show();
     }
     else
     {
         //form.Location = _contextMenuPoint;
         form.Set(fi);
     }
 }
Exemplo n.º 6
0
        public override void Set(AaxFileItem fileItem)
        {
            if (hasCustomization())
            {
                var result = MsgBox.Show(
                    this, R.MsgPreviewUnsavedChanges, this.Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                switch (result)
                {
                case DialogResult.Cancel:
                    return;

                case DialogResult.Yes:
                    saveChanges();
                    break;
                }
            }

            _fileItem = fileItem;
            updatePreview(false);
        }
Exemplo n.º 7
0
 public virtual void Set(AaxFileItem fileItem)
 {
 }
Exemplo n.º 8
0
 private void openPreviewForm(AaxFileItem fi) => openNonModalForm(fi, ref _previewForm, previewForm_FormClosed);
Exemplo n.º 9
0
 private void openFileDetailsForm(AaxFileItem fi) => openNonModalForm(fi, ref _detailsForm, detailsForm_FormClosed);