using System;
using TestDialogManager.Interfaces;
using TestDialogManager.Renderers;

namespace TestDialogManager.Services
{
    public class DialogService
    {
        private readonly RendererService _rendererService;

        public DialogService(RendererService rendererService)
        {
            _rendererService = rendererService;
        }

        public void ShowMessageDialog(string messageText, string headerText = null,
            DialogButtons dialogButtons = DialogButtons.Ok, DialogImage dialogImage = DialogImage.None,
            Action<DialogResult> callback = null, object parameter = null, bool closeWhenOverlayClicked = false)
        {
            _rendererService.AddRendererAction(new FmMessageDialogRenderer(Guid.NewGuid(), messageText,
                headerText, dialogButtons, dialogImage, callback, parameter, closeWhenOverlayClicked));
        }
    }
}
