Exemplo n.º 1
0
            //private bool lastDashboardUpdate;

            #endregion Private Fields

            #region Private Methods

            private static CommunicationFrames.Target _frameFromByteArray(byte[] arr)
            {
                var target = new CommunicationFrames.Target();
                var size   = Marshal.SizeOf(target);
                var ptr    = Marshal.AllocHGlobal(size);

                Marshal.Copy(arr, 0, ptr, size);
                target = (CommunicationFrames.Target)Marshal.PtrToStructure(ptr, target.GetType());
                Marshal.FreeHGlobal(ptr);
                return(target);
            }
Exemplo n.º 2
0
            private static void _updateTarget(CommunicationFrames.Target target)
            {
                for (var i = 0; i < _targets.Count; i++)
                {
                    var o = _targets[i];
                    if (o != null && o.Target.ID == target.ID)
                    {
                        _targets.RemoveAt(i);
                    }
                }
                var tmp = new CommunicationFrames.TargetContainer {
                    Target = new CommunicationFrames.Target(target)
                };

                _targets.Add(tmp);
            }