Exemplo n.º 1
0
 private void CreatePingers(int cnt)
 {
     for (var i = 1; i <= cnt; i++)
     {
         Pingers.Add(new Ping());
     }
 }
        /// <summary>
        /// Creates a new instance of the <see cref="I3dPingersWrapper"/> class.
        /// Should be disposed.
        /// </summary>
        /// <param name="logCallback">The logging callback.</param>
        public I3dPingersWrapper(Action <I3dLogLevel, string> logCallback, I3dIpList ipList)
        {
            _logCallback = logCallback;

            int code = i3d_ping_pingers_create(out _ptr, ipList.Ptr);

            I3dErrorValidator.Validate(code);

            code = i3d_ping_pingers_set_logger(_ptr, LogCallback, _ptr);
            I3dErrorValidator.Validate(code);

            lock (Pingers)
            {
                Pingers.Add(_ptr, this);
            }
        }