System.Threading.WaitHandle.WaitOne C# (CSharp) Method

WaitOne() public method

public WaitOne ( ) : bool
return bool
        public virtual bool WaitOne ()
        {
            //Infinite Timeout
            return  WaitOne(-1,false);
        }

Same methods

WaitHandle::WaitOne ( TimeSpan timeout, bool exitContext ) : bool
WaitHandle::WaitOne ( int millisecondsTimeout, bool exitContext ) : bool
WaitHandle::WaitOne ( long timeout, bool exitContext ) : bool

Usage Example

Esempio n. 1
0
        public DialogResult ShowDialog(MobileRemoteUI parentForm, WaitHandle waitResult, AddressSelector.BluetoothDevice device, BluetoothHidWriter hidWriter)
        {
            _statusLabel.Text = "Connecting...";
            _hidWriter = hidWriter;
            _waitResult = waitResult;
            if (device.Address > 0)
            {
                _existingMachine.Dock = DockStyle.Fill;
                _existingMachine.Visible = true;
                _newMachineLabel.Visible = false;
            }
            else
            {
                _newMachineLabel.Dock = DockStyle.Fill;
                _newMachineLabel.Visible = true;
                _existingMachine.Visible = false;
            }

            timer1.Enabled = true;

            if (waitResult.WaitOne(1000, false))
            {
                //return DialogResult.OK;
            }

            try
            {
                return base.ShowDialog(parentForm);
            }
            finally
            {
                timer1.Enabled = false;
            }
        }
All Usage Examples Of System.Threading.WaitHandle::WaitOne