32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
using DCIT.App.Forms;
|
|
using DCIT.Core.Models;
|
|
|
|
namespace DCIT.App.Presentation
|
|
{
|
|
public sealed class UserDialogService : IUserDialogService
|
|
{
|
|
public DialogResult ShowMessage(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
|
{
|
|
return MessageBox.Show(owner, text, caption, buttons, icon);
|
|
}
|
|
|
|
public AutoExtractPreviewResult ShowAutoExtractPreview(IWin32Window owner, IList<ExtractionCandidate> candidates)
|
|
{
|
|
using (var preview = new AutoExtractPreviewForm(candidates))
|
|
{
|
|
var dialogResult = preview.ShowDialog(owner);
|
|
return new AutoExtractPreviewResult
|
|
{
|
|
DialogResult = dialogResult,
|
|
SelectedCandidates = preview.SelectedCandidates == null
|
|
? new List<ExtractionCandidate>()
|
|
: preview.SelectedCandidates.ToList(),
|
|
};
|
|
}
|
|
}
|
|
}
|
|
}
|