Class UnityModalButtonFactory
Unity-specific factory for creating interactive button components for modal dialogs.
Generates buttons with associated event handlers and submit actions based on provided data.
Encapsulates the complex button creation process including theme sound mapping and event wiring.
Implements
Inherited Members
Namespace: Serenity.Modal.Infrastructure.Factories
Assembly: Serenity.UnityModal.Infrastructure.dll
Syntax
public class UnityModalButtonFactory : IModalButtonFactory
Constructors
UnityModalButtonFactory(IUiComponentFactory, IFoundationViewElementFactory, AudioPlayerPlayClip, string, IEventDispatcherService, IUiService, ILogService)
Initializes a new instance of the UnityModalButtonFactory class.
Declaration
public UnityModalButtonFactory(IUiComponentFactory submitFactory, IFoundationViewElementFactory foundationViewElementFactory, AudioPlayerPlayClip audioPlayerPlayClip, string audioPlayerServiceId, IEventDispatcherService eventDispatcherService, IUiService uiService, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| IUiComponentFactory | submitFactory | Factory for creating submit button UI components. |
| IFoundationViewElementFactory | foundationViewElementFactory | Factory for creating foundation view elements. |
| AudioPlayerPlayClip | audioPlayerPlayClip | Audio playback functionality for UI sounds. |
| string | audioPlayerServiceId | Identifier for the audio player service. |
| IEventDispatcherService | eventDispatcherService | Service for dispatching button submit events. |
| IUiService | uiService | UI service for theme sounds resolution. |
| ILogService | logService | Service for logging operations. |
Methods
CreateModalButtons(List<SerializedComponentData>, IUiThemeDefinition)
Declaration
public List<IUiInteractable> CreateModalButtons(List<SerializedComponentData> buttonsData, IUiThemeDefinition theme)
Parameters
| Type | Name | Description |
|---|---|---|
| List<SerializedComponentData> | buttonsData | |
| IUiThemeDefinition | theme |
Returns
| Type | Description |
|---|---|
| List<IUiInteractable> |