void ProcessEvent(string eventInfo) { if (string.IsNullOrWhiteSpace(eventInfo)) { return; } var info = eventInfo.Split(new char[] { '#' }, StringSplitOptions.RemoveEmptyEntries); switch (info[0]) { case "RaiseMessage": RaiseMessage?.Invoke(info[1]); break; case "StateMessageChanged": StateMessageChanged?.Invoke(info[1]); break; case "StateChanged": StateChanged?.Invoke((PhoneState)Enum.Parse(typeof(PhoneState), info[1])); break; } }
private void phoneLine_PhoneLineStateChanged(object sender, RegistrationStateChangedArgs e) { StateMessageChanged?.Invoke(e.State == RegState.RegistrationSucceeded ? "Online" : e.State.ToString()); }