<Type Name="MainLoop" FullName="Mono.Terminal.MainLoop">
  <TypeSignature Language="C#" Value="public class MainLoop" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MainLoop extends System.Object" />
  <AssemblyInfo>
    <AssemblyName>Terminal.Gui</AssemblyName>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>
              Simple main loop implementation that can be used to monitor
              file descriptor, run timers and idle handlers.
            </summary>
    <remarks>
              Monitoring of file descriptors is only available on Unix, there
              does not seem to be a way of supporting this on Windows.
            </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public MainLoop ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <Parameters />
      <Docs>
        <summary>
             Default constructor
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public MainLoop (Mono.Terminal.IMainLoopDriver driver);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Mono.Terminal.IMainLoopDriver driver) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters>
        <Parameter Name="driver" Type="Mono.Terminal.IMainLoopDriver" />
      </Parameters>
      <Docs>
        <param name="driver">To be added.</param>
        <summary>
             Creates a new Mainloop, to run it you must provide a driver, and choose
             one of the implementations UnixMainLoop, NetMainLoop or WindowsMainLoop.
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="AddIdle">
      <MemberSignature Language="C#" Value="public Func&lt;bool&gt; AddIdle (Func&lt;bool&gt; idleHandler);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Func`1&lt;bool&gt; AddIdle(class System.Func`1&lt;bool&gt; idleHandler) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Func&lt;System.Boolean&gt;</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="idleHandler" Type="System.Func&lt;System.Boolean&gt;" />
      </Parameters>
      <Docs>
        <param name="idleHandler">To be added.</param>
        <summary>
              Executes the specified @idleHandler on the idle loop.  The return value is a token to remove it.
            </summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="AddTimeout">
      <MemberSignature Language="C#" Value="public object AddTimeout (TimeSpan time, Func&lt;Mono.Terminal.MainLoop,bool&gt; callback);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance object AddTimeout(valuetype System.TimeSpan time, class System.Func`2&lt;class Mono.Terminal.MainLoop, bool&gt; callback) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Object</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="time" Type="System.TimeSpan" />
        <Parameter Name="callback" Type="System.Func&lt;Mono.Terminal.MainLoop,System.Boolean&gt;" />
      </Parameters>
      <Docs>
        <param name="time">To be added.</param>
        <param name="callback">To be added.</param>
        <summary>
               Adds a timeout to the mainloop.
             </summary>
        <returns>To be added.</returns>
        <remarks>
               When time time specified passes, the callback will be invoked.
               If the callback returns true, the timeout will be reset, repeating
               the invocation. If it returns false, the timeout will stop.
            
               The returned value is a token that can be used to stop the timeout
               by calling RemoveTimeout.
             </remarks>
      </Docs>
    </Member>
    <Member MemberName="AddWatch">
      <MemberSignature Language="C#" Value="public object AddWatch (int fileDescriptor, Mono.Terminal.MainLoop.Condition condition, Func&lt;Mono.Terminal.MainLoop,bool&gt; callback);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance object AddWatch(int32 fileDescriptor, valuetype Mono.Terminal.MainLoop/Condition condition, class System.Func`2&lt;class Mono.Terminal.MainLoop, bool&gt; callback) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Object</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="fileDescriptor" Type="System.Int32" />
        <Parameter Name="condition" Type="Mono.Terminal.MainLoop+Condition" />
        <Parameter Name="callback" Type="System.Func&lt;Mono.Terminal.MainLoop,System.Boolean&gt;" />
      </Parameters>
      <Docs>
        <param name="fileDescriptor">To be added.</param>
        <param name="condition">To be added.</param>
        <param name="callback">To be added.</param>
        <summary>
              Watches a file descriptor for activity.
             </summary>
        <returns>To be added.</returns>
        <remarks>
              When the condition is met, the provided callback
              is invoked.  If the callback returns false, the
              watch is automatically removed.
            
              The return value is a token that represents this watch, you can
              use this token to remove the watch by calling RemoveWatch.
             </remarks>
      </Docs>
    </Member>
    <Member MemberName="Driver">
      <MemberSignature Language="C#" Value="public Mono.Terminal.IMainLoopDriver Driver { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class Mono.Terminal.IMainLoopDriver Driver" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Mono.Terminal.IMainLoopDriver</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>
            The current IMainLoopDriver in use.
            </summary>
        <value>The driver.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="EventsPending">
      <MemberSignature Language="C#" Value="public bool EventsPending (bool wait = false);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool EventsPending(bool wait) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="wait" Type="System.Boolean" />
      </Parameters>
      <Docs>
        <param name="wait">To be added.</param>
        <summary>
              Determines whether there are pending events to be processed.
            </summary>
        <returns>To be added.</returns>
        <remarks>
              You can use this method if you want to probe if events are pending.
              Typically used if you need to flush the input queue while still
              running some of your own code in your main thread. 
            </remarks>
      </Docs>
    </Member>
    <Member MemberName="Invoke">
      <MemberSignature Language="C#" Value="public void Invoke (Action action);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Invoke(class System.Action action) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="action" Type="System.Action" />
      </Parameters>
      <Docs>
        <param name="action">To be added.</param>
        <summary>
              Runs @action on the thread that is processing events
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="MainIteration">
      <MemberSignature Language="C#" Value="public void MainIteration ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void MainIteration() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>
               Runs one iteration of timers and file watches
             </summary>
        <remarks>
               You use this to process all pending events (timers, idle handlers and file watches).
            
               You can use it like this:
                 while (main.EvensPending ()) MainIteration ();
             </remarks>
      </Docs>
    </Member>
    <Member MemberName="RemoveIdle">
      <MemberSignature Language="C#" Value="public void RemoveIdle (Func&lt;bool&gt; idleHandler);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveIdle(class System.Func`1&lt;bool&gt; idleHandler) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="idleHandler" Type="System.Func&lt;System.Boolean&gt;" />
      </Parameters>
      <Docs>
        <param name="idleHandler">To be added.</param>
        <summary>
              Removes the specified idleHandler from processing.
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="RemoveTimeout">
      <MemberSignature Language="C#" Value="public void RemoveTimeout (object token);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveTimeout(object token) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="token" Type="System.Object" />
      </Parameters>
      <Docs>
        <param name="token">To be added.</param>
        <summary>
              Removes a previously scheduled timeout
            </summary>
        <remarks>
              The token parameter is the value returned by AddTimeout.
            </remarks>
      </Docs>
    </Member>
    <Member MemberName="RemoveWatch">
      <MemberSignature Language="C#" Value="public void RemoveWatch (object token);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveWatch(object token) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="token" Type="System.Object" />
      </Parameters>
      <Docs>
        <param name="token">To be added.</param>
        <summary>
              Removes an active watch from the mainloop.
            </summary>
        <remarks>
              The token parameter is the value returned from AddWatch
            </remarks>
      </Docs>
    </Member>
    <Member MemberName="Run">
      <MemberSignature Language="C#" Value="public void Run ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Run() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>
              Runs the mainloop.
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Stop">
      <MemberSignature Language="C#" Value="public void Stop ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Stop() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>
              Stops the mainloop.
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="WindowsKeyPressed">
      <MemberSignature Language="C#" Value="public Action&lt;ConsoleKeyInfo&gt; WindowsKeyPressed;" />
      <MemberSignature Language="ILAsm" Value=".field public class System.Action`1&lt;valuetype System.ConsoleKeyInfo&gt; WindowsKeyPressed" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Action&lt;System.ConsoleKeyInfo&gt;</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>
            This event is raised when a key is pressed when using the Windows driver.
            </summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
