BlinkStickDotNet.BlinkStick.SetFeature C# (CSharp) Метод

SetFeature() приватный Метод

private SetFeature ( byte buffer ) : void
buffer byte
Результат void
        private void SetFeature(byte[] buffer)
        {
            int attempt = 0;
            while (attempt < 5)
            {
                attempt++;
                try
                {
                    stream.SetFeature(buffer);
                    break;
                }
                catch (System.IO.IOException e)
                {
                    if (e.InnerException is System.ComponentModel.Win32Exception)
                    {
                        System.ComponentModel.Win32Exception win32Exception = e.InnerException as System.ComponentModel.Win32Exception;

                        if (win32Exception != null && win32Exception.NativeErrorCode == 0)
                            return;
                    }

                    if (attempt == 5)
                        throw;

                    if (!WaitThread(20))
                        return;
                }
            }
        }