void OnDeletedThing(ICDEThing pThing, object pPara) { TheThing tThing = pPara as TheThing; if (tThing != null && tThing.IsInit()) { var tThingObj = (tThing.GetObject() as TheConnectionBase); if (tThingObj != null) { tThingObj.Disconnect(true); } } }