BTool.DeviceForm.OnDisconnectionNotify C# (CSharp) Method

OnDisconnectionNotify() protected method

protected OnDisconnectionNotify ( ConnectInfo &tmpDisconnectInfo ) : void
tmpDisconnectInfo ConnectInfo
return void
        protected void OnDisconnectionNotify(ref ConnectInfo tmpDisconnectInfo)
        {
            disconnectInfo = tmpDisconnectInfo;
            for (int index = 0; index < Connections.Count; ++index)
            {
                if (Connections[index].Handle == disconnectInfo.Handle)
                {
                    DisplayMsg(SharedAppObjs.MsgType.Info, "Device Disconnected\nHandle = 0x" + disconnectInfo.Handle.ToString("X4") + "\nAddr Type = 0x" + Connections[index].AddrType.ToString("X2") + " (" + devUtils.GetGapAddrTypeStr(Connections[index].AddrType) + ")\nBDAddr = " + Connections[index].BDA + "\n");
                    Connections.RemoveAt(index);
                    DisconnectionNotify(this, EventArgs.Empty);
                    if (numConnections > 0)
                        --numConnections;
                    attributesForm.RemoveData(disconnectInfo.Handle);
                    break;
                }
            }
        }