private void updateRegistration(IMbnRegistration registrationInterface) { try { lblRegMode.Text = Enum.GetName(typeof(MBN_REGISTER_MODE), registrationInterface.GetRegisterMode()).Replace("MBN_REGISTER_MODE_", ""); lblRegState.Text = Enum.GetName(typeof(MBN_REGISTER_STATE), registrationInterface.GetRegisterState()).Replace("MBN_REGISTER_STATE_", ""); lblRegName.Text = registrationInterface.GetProviderName(); lblRegId.Text = registrationInterface.GetProviderID(); //Update the list as well uint age; for (int i = 0; i < lastScannedNetworks.Length; i++) { if (lastScannedNetworks[i].providerID.Equals(registrationInterface.GetProviderID())) { lastScannedNetworks[i].providerState = (uint)registrationInterface.GetRegisterState(); } } PopulateNetworks(lastScannedNetworks); //Check if manual or automatic chkRegMode.Checked = registrationInterface.GetRegisterMode().Equals(MBN_REGISTER_MODE.MBN_REGISTER_MODE_AUTOMATIC); grpScan.Enabled = !chkRegMode.Checked; } catch (Exception ex) { //whatever } }
private void ProcessOnSetRegisterModeComplete(IMbnRegistration newInterface, uint requestID, int status) { MBN_REGISTER_STATE state = newInterface.GetRegisterState(); LogMessage("ProcessOnSetRegisterModeComplete. State: " + state.ToString()); if (state == MBN_REGISTER_STATE.MBN_REGISTER_STATE_ROAMING || state == MBN_REGISTER_STATE.MBN_REGISTER_STATE_HOME || state == MBN_REGISTER_STATE.MBN_REGISTER_STATE_PARTNER) { LogMessage("Registered to " + newInterface.GetProviderName()); } this.Invoke((MethodInvoker) delegate() { updateRegistration(newInterface); }); }
private void ProcessOnRegisterStateChange(IMbnRegistration newInterface) { MBN_REGISTER_STATE state = newInterface.GetRegisterState(); LogMessage("ProcessOnRegisterStateChange. State: " + state.ToString() + " Name: " + newInterface.GetProviderName()); this.Invoke((MethodInvoker) delegate() { updateRegistration(newInterface); }); }