public override bool Equals(object obj) { DriSecurityPairingStatus pairingStatus = obj as DriSecurityPairingStatus; if (pairingStatus != null && this == pairingStatus) { return(true); } return(false); }
/// <summary> /// Handle UPnP evented state variable changes. /// </summary> /// <param name="stateVariable">The state variable that has changed.</param> /// <param name="newValue">The new value of the state variable.</param> private void OnStateVariableChanged(CpStateVariable stateVariable, object newValue) { try { if (stateVariable.Name.Equals("PCRLock") || stateVariable.Name.Equals("Lock")) { _tunerLocked = (bool)newValue; if (_eventSignalLock != null) { _eventSignalLock.Set(); } } else if (stateVariable.Name.Equals("CardStatus")) { DriCasCardStatus oldStatus = _cardStatus; _cardStatus = (DriCasCardStatus)(string)newValue; if (oldStatus != _cardStatus) { Log.Log.Info("DRI CC: device {0} CableCARD status update, old status = {1}, new status = {2}", _cardId, oldStatus, _cardStatus); } } else if (stateVariable.Name.Equals("CardMessage")) { if (!string.IsNullOrEmpty(newValue.ToString())) { Log.Log.Info("DRI CC: device {0} received message from the CableCARD, current status = {1}, message = {2}", _cardId, _cardStatus, newValue); } } else if (stateVariable.Name.Equals("MMIMessage")) { HandleMmiMessage((byte[])newValue); } else if (stateVariable.Name.Equals("DescramblingStatus")) { DriCasDescramblingStatus oldStatus = _descramblingStatus; _descramblingStatus = (DriCasDescramblingStatus)(string)newValue; if (oldStatus != _descramblingStatus) { Log.Log.Info("DRI CC: device {0} descrambling status update, old status = {1}, new status = {2}", _cardId, oldStatus, _descramblingStatus); } } else if (stateVariable.Name.Equals("DrmPairingStatus")) { DriSecurityPairingStatus oldStatus = _pairingStatus; _pairingStatus = (DriSecurityPairingStatus)(string)newValue; if (oldStatus != _pairingStatus) { Log.Log.Info("DRI CC: device {0} pairing status update, old status = {1}, new status = {2}", _cardId, oldStatus, _pairingStatus); } } else { Log.Log.Debug("DRI CC: device {0} state variable {1} for service {2} changed to {3}", _cardId, stateVariable.Name, stateVariable.ParentService.FullQualifiedName, newValue ?? "[null]"); } } catch (Exception ex) { Log.Log.Error("DRI CC: failed to handle state variable change\r\n{0}", ex); } }