23 XmppState.Offline => Colors.Red,
25 XmppState.Authenticating or
26 XmppState.Connecting or
27 XmppState.Registering or
28 XmppState.StartingEncryption or
29 XmppState.StreamNegotiation or
30 XmppState.StreamOpened => Colors.Yellow,
33 XmppState.FetchingRoster or
34 XmppState.RequestingSession or
35 XmppState.SettingPresence =>
Blend(Colors.Yellow, connectedColor, 0.5),
37 XmppState.Connected => connectedColor,
43 private static readonly Color connectedColor = Color.FromRgb(146, 208, 80);
52 public static Color
Blend(Color Color1, Color Color2,
double p)
54 int R = (int)(Color1.Red * (1 - p) + Color2.Red * p + 0.5);
55 int G = (int)(Color1.Green * (1 - p) + Color2.Green * p + 0.5);
56 int B = (int)(Color1.Blue * (1 - p) + Color2.Blue * p + 0.5);
57 int A = (int)(Color1.Alpha * (1 - p) + Color2.Alpha * p + 0.5);
59 return new Color(R, G, B, A);
Extensions for the XmppState enum.
static Color ToColor(this XmppState State)
Returns a color matching the current connection state.
static string ToDisplayText(this XmppState State)
Converts the state to a localized string.
static Color Blend(Color Color1, Color Color2, double p)
Blends two colors.
static string ToDisplayText(this IdentityState State)
Converts the state to a localized string.
A strongly-typed resource class, for looking up localized strings, etc.
static string XmppState_FetchingRoster
Looks up a localized string similar to Fetching roster.
static string IdentityState_Obsoleted
Looks up a localized string similar to Obsoleted.
static string XmppState_Authenticating
Looks up a localized string similar to Authenticating network identity.
static string XmppState_Binding
Looks up a localized string similar to Binding connection.
static string XmppState_Connecting
Looks up a localized string similar to Establishing connection.
static string XmppState_Offline
Looks up a localized string similar to Disconnected.
static string IdentityState_Created
Looks up a localized string similar to Created.
static string XmppState_SettingPresence
Looks up a localized string similar to Registering presence.
static string IdentityState_Compromised
Looks up a localized string similar to Compromised.
static string XmppState_RequestingSession
Looks up a localized string similar to Requesting session.
static string XmppState_Connected
Looks up a localized string similar to Connected.
static string XmppState_StreamOpened
Looks up a localized string similar to Stream established.
static string XmppState_Registering
Looks up a localized string similar to Registering with Service Provider.
static string IdentityState_Rejected
Looks up a localized string similar to Rejected.
static string XmppState_StartingEncryption
Looks up a localized string similar to Encrypting connection.
static string XmppState_Error
Looks up a localized string similar to Connection error.
static string XmppState_StreamNegotiation
Looks up a localized string similar to Negotiating stream.
static string IdentityState_Approved
Looks up a localized string similar to Approved.
Base class that references services in the app.
static IReportingStringLocalizer Localizer
Localization service
IdentityState
Lists recognized legal identity states.
XmppState
State of XMPP connection.