Пример #1
0
        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);
        }
Пример #2
0
        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>);
        }