C# Class SIP_Agent.Helper.UI

Common helper functions for managing the UI
Afficher le fichier Open project: anroots/SIP-Agent

Méthodes publiques

Свойство Type Description
ERROR_BRUSH System.Windows.Media.Brush
SUCCESS_BRUSH System.Windows.Media.Brush
flashBackground System.Windows.Media.Brush
flashObject object

Méthodes publiques

Méthode Description
CmbIndexByValue ( ComboBox combo, int s ) : int

Searches combobox items by their value

TodayDate ( System.DateTime Date ) : string

Returns a short DateString if the input date is today, long DateString otherwise

flash ( object sender, System.Windows.Media.Brush color = null, int duration = 4000 ) : void

Flash an UI element to give visual feedback on action result. An example would be flashing the Save button red after an unsuccessful save.

timer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Called when the flashing timer activates. Resets the background,

Method Details

CmbIndexByValue() public static méthode

Searches combobox items by their value
public static CmbIndexByValue ( ComboBox combo, int s ) : int
combo System.Windows.Controls.ComboBox Reference to to combobox (SetValuePath)
s int Searched value
Résultat int

TodayDate() public static méthode

Returns a short DateString if the input date is today, long DateString otherwise
public static TodayDate ( System.DateTime Date ) : string
Date System.DateTime
Résultat string

flash() public static méthode

Flash an UI element to give visual feedback on action result. An example would be flashing the Save button red after an unsuccessful save.
public static flash ( object sender, System.Windows.Media.Brush color = null, int duration = 4000 ) : void
sender object The target object (button)
color System.Windows.Media.Brush The Brush to paint the object with
duration int How long to flash
Résultat void

timer_Elapsed() public static méthode

Called when the flashing timer activates. Resets the background,
public static timer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void
sender object
e System.Timers.ElapsedEventArgs
Résultat void

Property Details

ERROR_BRUSH public_oe static_oe property

The brush used when painting objects on errors
public static Brush,System.Windows.Media ERROR_BRUSH
Résultat System.Windows.Media.Brush

SUCCESS_BRUSH public_oe static_oe property

The brush used when painting objects on success
public static Brush,System.Windows.Media SUCCESS_BRUSH
Résultat System.Windows.Media.Brush

flashBackground public_oe static_oe property

Stores the original background of a flashing object
public static Brush,System.Windows.Media flashBackground
Résultat System.Windows.Media.Brush

flashObject public_oe static_oe property

Stores the object awaiting flash cancellation
public static object flashObject
Résultat object