private ISender GetSender(TelegrafReport telegrafReport) { var senderField = telegrafReport.GetType().GetField("sender", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); return(senderField.GetValue(telegrafReport) as ISender); }
private List <LineProtocolPoint> GetDataPoints(TelegrafReport telegrafReport) { var payloadField = telegrafReport.GetType().GetField("payload", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); LineProtocolPayload payload = (LineProtocolPayload)payloadField.GetValue(telegrafReport); var pointsField = payload.GetType().GetField("_points", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); return(pointsField.GetValue(payload) as List <LineProtocolPoint>); }