Alerts, editors and timers
Dialog definitions, text editors, timers and status messages.
In this documentation
- Beep.Forms
- Architecture
- Authoring in the Object Navigator
- WinForms runtime
- WPF runtime
- End-to-end example
- Remote UI limitations
- Overview
- Context menus
- Blocks and items
- Triggers
- Lists of values
- Validation
- Master detail
- Navigation and queries
- Alerts, editors and timers
- Calling other forms
- Form menus
- Hosting in WinForms step by step
- Hosting in WPF step by step
- Saving and loading forms
- The IDE toolbar and dialogs
- Troubleshooting
Alerts
manager.CreateAlert("ConfirmDelete", "Delete", "Delete this order?",
AlertStyle.Question, "Yes", "No");
AlertResult r = await manager.ShowAlertByNameAsync("ConfirmDelete");
CreateAlert(name, title, message, style, button1Text, button2Text, button3Text) defaults to style None and button text "OK". AlertStyle is Information, Caution, Stop, Question or None. AlertResult is Button1, Button2, Button3 or None. None means the alert was dismissed or no UI provider is present.
Also available: ShowAlertAsync(title, message, ...), GetAlert, GetAllAlerts, RemoveAlert, ClearAllAlerts, AlertExists, ShowInfoAsync and ConfirmAsync, which returns true when the first button was chosen.
Alerts need a provider passed to the manager constructor as alertProvider: WinFormAlertProvider for WinForms or BeepWpfAlertProvider for WPF.
Editors
CreateEditor(name, title, width, height, wrapText, showScrollBar) defaults to "Edit Text", 480, 320, true, true. ShowEditorAsync(block, item) returns an EditorResult with Committed and Value. Attach an editor to an item with manager.ItemProperties.SetItemEditor(block, item, editorName). An item with none uses EditorDefinition.SystemDefault(). Also: GetEditor, GetAllEditors, RemoveEditor, ClearAllEditors, EditorExists.
Providers: WinFormEditorProvider and BeepWpfEditorProvider, passed as editorProvider.
Timers
CreateTimer(name, interval, repeating) starts the timer at once. repeating is false by default. TimerState is Created, Running, Paused, Expired or Deleted. The manager has GetAllTimers and TimerExists. The host has DeleteTimer, GetTimer and GetTimers.
When a timer fires the host raises TimerFired with TimerName, FireCount and FiredAt, and the engine fires the form level WhenTimerExpired trigger.
Messages
SetMessage(text, level) and ClearMessage() drive the status line. The host raises MessageRaised and MessageCleared with BlockName, Message and Level. NotificationRaised carries a message and a kind. The host helpers are ShowInfo, ShowWarning and ShowError.