first commit
This commit is contained in:
31
DCIT.App/Presentation/UserDialogService.cs
Normal file
31
DCIT.App/Presentation/UserDialogService.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user