Show / Hide Table of Contents

# Class NetMainLoop

Mainloop intended to be used with the .NET System.Console API, and can be used on Windows and Unix, it is cross platform but lacks things like file descriptor monitoring.

##### Inheritance

System.Object
NetMainLoop

##### Implements

IMainLoopDriver

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class NetMainLoop : IMainLoopDriver

##### Remarks

This implementation is used for both NetDriver and FakeDriver.

### Constructors

#### NetMainLoop(Func<ConsoleKeyInfo>)

Initializes the class.

##### Declaration

    public NetMainLoop(Func<ConsoleKeyInfo> consoleKeyReaderFn = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.ConsoleKeyInfo> | consoleKeyReaderFn | The method to be called to get a key from the console.

##### Remarks

Passing a consoleKeyReaderfn is provided to support unit test sceanrios.

### Fields

#### KeyPressed

Invoked when a Key is pressed.

##### Declaration

    public Action<ConsoleKeyInfo> KeyPressed

##### Field Value

Type | Description
--- | ---
System.Action<System.ConsoleKeyInfo> |

### Explicit Interface Implementations

#### IMainLoopDriver.EventsPending(Boolean)

##### Declaration

    bool IMainLoopDriver.EventsPending(bool wait)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | wait |

##### Returns

Type | Description
--- | ---
System.Boolean |

#### IMainLoopDriver.MainIteration()

##### Declaration

    void IMainLoopDriver.MainIteration()

#### IMainLoopDriver.Setup(MainLoop)

##### Declaration

    void IMainLoopDriver.Setup(MainLoop mainLoop)

##### Parameters

Type | Name | Description
--- | --- | ---
MainLoop | mainLoop |

#### IMainLoopDriver.Wakeup()

##### Declaration

    void IMainLoopDriver.Wakeup()

### Implements

IMainLoopDriver