UGrokItApi.UgiUiUtil Class Reference

Overview

UgiUiUtil is a collection of static UI utilities for showing alert dialogs. It is used by UgiDefaultConfigurationUi to show UI for configuration

Class Methods

static void HideUI (object o)
 Hide an alert More...
 
static void UpdateAlert (object o, string message)
 Hide an alert More...
 
static object ShowOk (string title, string message, string okButtonTitle="", Action okDelegate=null)
 Show an alert dialog with ok button More...
 
static object ShowOkCancel (string title, string message, Action okDelegate, string okButtonTitle="", string cancelButtonTitle="", Action cancelDelegate=null)
 Show an alert dialog with ok and cancel buttons More...
 
static object Show3ButtonAlert (string title, string message, string button1Title, string button2Title, string cancelButtonTitle, Action button1Delegate, Action button2Delegate, Action cancelDelegate)
 Show an alert with three buttons More...
 
static object ShowChoices (string[] choices, int initialSelectedIndex, string title, string actionButtonTitle, bool canCancel, Action< int, string > actionDelegate, Action< int, string, Action > confirmationDelegate=null, Action cancelDelegate=null)
 Show UI to choose from a list of choices More...
 
static void ShowMenu (string title, Action cancelDelegate, params MenuTitleAndHandler[] items)
 Show a menu More...
 
static void ShowToast (string title, string message, double interval=2.0)
 Show a toast More...
 
static object ShowTextInput (string title, string message, string actionButtonTitle, string initialText, bool allowAutoCorrection, string switchText, bool switchInitialState, Action< string, bool > actionDelegate, Action cancelDelegate=null, ShowTextInputShouldEnableForTextDelegate shouldEnableForTextDelegate=null)
 Input a text string from the user More...
 
static void ShowWaiting (string message, Action cancelDelegate=null)
 Show a waiting alert More...
 
static void UpdateWaiting (string message)
 Updat the message in a waiting alert More...
 
static void HideWaiting ()
 Hide the waiting alert More...
 
static void StopInventoryWithCompletionShowWaiting (Action del)
 Stop inventory, displaying a waiting message More...
 
static void StartDisconnectedAlert (Action cancelDelegate)
 Start displaying a "please connect the grokker" alert if the Grokker is not connected More...
 
static void StopDisconnectedAlert ()
 Stop displaying the disconnected dialog More...
 
static object ShowInventoryError (UgiInventory.InventoryResults result, Action del=null)
 Show an error dialog for an inventory error More...
 
static string GetInventoryErrorMessage (UgiInventory.InventoryResults result)
 Get a string describing an inventory error More...
 
static string GetTagAccessErrorMessage (UgiInventory.TagAccessReturnValues result)
 Get a string describing a tag access error More...
 
static object ShowBarcodeError (Action del=null)
 Show a dialog for a barcode scan error More...
 
static object ShowVersionAlert (string title=null, bool showExtraInfo=false)
 Show an alert with information about the app and about the Grokker More...
 

Instance Methods

delegate bool ShowTextInputShouldEnableForTextDelegate (String value)
 Delegate for determining whether to enable the action button within ShowTextInput More...
 

Properties

static bool IsDisconnectedAlertActive [get]
 See if the disconnected alert is active. More...
 
static string BarcodeScanErrorMessage [get]
 Get the appropriate error message if barcode scan failed More...
 

Structures

class  MenuTitleAndHandler
 Object passed to ShowMenu More...
 

Instance Method Documentation

static void UGrokItApi.UgiUiUtil.HideUI ( object  o)
inlinestatic

Hide an alert

Parameters
oToken for alert to hide
static void UGrokItApi.UgiUiUtil.UpdateAlert ( object  o,
string  message 
)
inlinestatic

Hide an alert

Parameters
oToken for alert to hide
messageText for the body of the alert dialog
static object UGrokItApi.UgiUiUtil.ShowOk ( string  title,
string  message,
string  okButtonTitle = "",
Action  okDelegate = null 
)
inlinestatic

Show an alert dialog with ok button

Returns
Token for the alert dialog
Parameters
titleTitle for the alert
messageText for the body of the alert
okButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
okDelegateCode to execute for "ok"
static object UGrokItApi.UgiUiUtil.ShowOkCancel ( string  title,
string  message,
Action  okDelegate,
string  okButtonTitle = "",
string  cancelButtonTitle = "",
Action  cancelDelegate = null 
)
inlinestatic

Show an alert dialog with ok and cancel buttons

Returns
Token for the alert dialog
Parameters
titleTitle for the alert
messageText for the body of the alert
okDelegateCode to execute for "ok"
okButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
cancelButtonTitleText for the "cancel" button, or "" for the defualt, or null for no cancel button
cancelDelegateCode to execute for "cancel"
static object UGrokItApi.UgiUiUtil.Show3ButtonAlert ( string  title,
string  message,
string  button1Title,
string  button2Title,
string  cancelButtonTitle,
Action  button1Delegate,
Action  button2Delegate,
Action  cancelDelegate 
)
inlinestatic

Show an alert with three buttons

Returns
Token for the alert dialog
Parameters
titleTitle for the alert
messageText for the body of the alert
button1TitleText for button 1
button2TitleText for button 1
cancelButtonTitleText for the "cancel" button, or "" for the defualt, or nil for no cancel button
button1DelegateCode to execute for button 1
button2DelegateCode to execute for button 2
cancelDelegateCode to execute for "cancel"
static object UGrokItApi.UgiUiUtil.ShowChoices ( string[]  choices,
int  initialSelectedIndex,
string  title,
string  actionButtonTitle,
bool  canCancel,
Action< int, string >  actionDelegate,
Action< int, string, Action >  confirmationDelegate = null,
Action  cancelDelegate = null 
)
inlinestatic

Show UI to choose from a list of choices

Returns
Token for the UI
Parameters
choicesChoices to choose from
initialSelectedIndexChoice to select initially
titleTitle for the alert
actionButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
canCanceltrue if the user can cancel
actionDelegateCode to execute if the user makes a choice
confirmationDelegateCode to execute to confirm the choice, or null of no confirmation
cancelDelegateCode to execute for "cancel"
static void UGrokItApi.UgiUiUtil.ShowMenu ( string  title,
Action  cancelDelegate,
params MenuTitleAndHandler[]  items 
)
inlinestatic

Show a menu

Parameters
titleTitle for the menu
cancelDelegateCode to execute for "cancel"
itemsItems for the menu
static void UGrokItApi.UgiUiUtil.ShowToast ( string  title,
string  message,
double  interval = 2.0 
)
inlinestatic

Show a toast

Parameters
titleTitle for the toast
messageText for the body of the toast
intervalTime to display the toast
delegate bool UGrokItApi.UgiUiUtil.ShowTextInputShouldEnableForTextDelegate ( String  value)

Delegate for determining whether to enable the action button within ShowTextInput

Returns
true to enable the action button
Parameters
valueText the user has input
static object UGrokItApi.UgiUiUtil.ShowTextInput ( string  title,
string  message,
string  actionButtonTitle,
string  initialText,
bool  allowAutoCorrection,
string  switchText,
bool  switchInitialState,
Action< string, bool >  actionDelegate,
Action  cancelDelegate = null,
ShowTextInputShouldEnableForTextDelegate  shouldEnableForTextDelegate = null 
)
inlinestatic

Input a text string from the user

Returns
Token for the UI
Parameters
titleTitle for the alert
messageMessage for the alert
actionButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
initialTextInitial text
allowAutoCorrectiontrue to allow auto-correction
switchTexttext for radio button, or null for no radio button
switchInitialStateinitial state for radio button
actionDelegateCode to execute for "ok"
cancelDelegateCode to execute for "cancel"
shouldEnableForTextDelegateCode to determine if the action button should be enabled
static void UGrokItApi.UgiUiUtil.ShowWaiting ( string  message,
Action  cancelDelegate = null 
)
inlinestatic

Show a waiting alert

Parameters
messageMessage
cancelDelegateCode to execute if the user cancels. If null then no cancel button is shown
static void UGrokItApi.UgiUiUtil.UpdateWaiting ( string  message)
inlinestatic

Updat the message in a waiting alert

Parameters
messageNew message
static void UGrokItApi.UgiUiUtil.HideWaiting ( )
inlinestatic

Hide the waiting alert

static void UGrokItApi.UgiUiUtil.StopInventoryWithCompletionShowWaiting ( Action  del)
inlinestatic

Stop inventory, displaying a waiting message

Parameters
delCode to execute after inventory is stopped
static void UGrokItApi.UgiUiUtil.StartDisconnectedAlert ( Action  cancelDelegate)
inlinestatic

Start displaying a "please connect the grokker" alert if the Grokker is not connected

Parameters
cancelDelegateCode to execute if the user cancels
static void UGrokItApi.UgiUiUtil.StopDisconnectedAlert ( )
inlinestatic

Stop displaying the disconnected dialog

static object UGrokItApi.UgiUiUtil.ShowInventoryError ( UgiInventory.InventoryResults  result,
Action  del = null 
)
inlinestatic

Show an error dialog for an inventory error

Returns
Token for the UI
Parameters
resultThe inventory error
delDelegate to call after alert
static string UGrokItApi.UgiUiUtil.GetInventoryErrorMessage ( UgiInventory.InventoryResults  result)
inlinestatic

Get a string describing an inventory error

Returns
The inventory error message.
Parameters
resultThe inventory error
static string UGrokItApi.UgiUiUtil.GetTagAccessErrorMessage ( UgiInventory.TagAccessReturnValues  result)
inlinestatic

Get a string describing a tag access error

Returns
The tag access error message.
Parameters
resultThe tag taccess error
static object UGrokItApi.UgiUiUtil.ShowBarcodeError ( Action  del = null)
inlinestatic

Show a dialog for a barcode scan error

Returns
Token for the UI
Parameters
delDelegate to call after alert
static object UGrokItApi.UgiUiUtil.ShowVersionAlert ( string  title = null,
bool  showExtraInfo = false 
)
inlinestatic

Show an alert with information about the app and about the Grokker

Returns
Token for the UI
Parameters
titleTitle for the alert, or null to use the app'sname and version
showExtraInfotrue to show debugging information

Property Documentation

bool UGrokItApi.UgiUiUtil.IsDisconnectedAlertActive
staticget

See if the disconnected alert is active.

true if disconnected alert is active; otherwise, false.

string UGrokItApi.UgiUiUtil.BarcodeScanErrorMessage
staticget

Get the appropriate error message if barcode scan failed

The message