示例#1
0
        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;
            }
        }
示例#2
0
 private void phoneLine_PhoneLineStateChanged(object sender, RegistrationStateChangedArgs e)
 {
     StateMessageChanged?.Invoke(e.State == RegState.RegistrationSucceeded ? "Online" : e.State.ToString());
 }