public static string ToDescriptionString(this StatusText val) { DescriptionAttribute[] attributes = (DescriptionAttribute[])val .GetType() .GetField(val.ToString()) .GetCustomAttributes(typeof(DescriptionAttribute), false); return(attributes.Length > 0 ? attributes[0].Description : string.Empty); }
private void receivedMessage(object _message) { StatusText = _message.ToString(); string[] headMessage = StatusText.ToString().Split('='); if (headMessage.Length == 2) { if (headMessage[0].Contains("password")) { if (headMessage[1].Contains("incorrect")) { } else if (headMessage[1].Contains("correct")) { SelectedIndex = 2; } } } }