GtkSharp/doc/en/Gtk/ThreadNotify.xml
Mike Kestner 91d63cee7a updates to latest monodocer -pretty
svn path=/trunk/gtk-sharp/; revision=71149
2007-01-16 16:18:05 +00:00

117 lines
3.9 KiB
XML

<Type Name="ThreadNotify" FullName="Gtk.ThreadNotify">
<TypeSignature Language="C#" Maintainer="auto" Value="public class ThreadNotify : IDisposable" />
<AssemblyInfo>
<AssemblyName>gtk-sharp</AssemblyName>
<AssemblyPublicKey>
</AssemblyPublicKey>
<AssemblyVersion>2.10.0.0</AssemblyVersion>
</AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Docs>
<summary>Multi-threaded integration with Gtk support.</summary>
<remarks>
<para>
You should consider using <see cref="M:Gtk.Application.Invoke" /> instead of this class as it
provides a simpler interface.
</para>
<para>The ThreadNotify class is used to invoke methods in the Gtk+ thread. Since Gtk is not a thread-safe toolkit, only a single thread at a time might be making calls into Gtk.</para>
<para>Typically applications will be executing the main Gtk+ main loop and when threads are done processing work, they invoke <see cref="M:Gtk.ThreadNotify.WakeupMain()" /> to invoke a method on the main Gtk+ thread.</para>
<example>
<code lang="C#">
using Gtk;
class Demo {
static ThreadNotify notify;
static void Main ()
{
Application.Init ();
notify = new ThreadNotify (new ReadyEvent (ready));
Application.Run ();
}
static void ready ()
{
// Update the GUI with computation values.
}
static void ThreadRoutine ()
{
LargeComputation ();
notify.WakeupMain ();
}
static void LargeComputation ()
{
// lots of processing here
}
}
</code>
</example>
</remarks>
</Docs>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Members>
<Member MemberName="WakeupMain">
<MemberSignature Language="C#" Value="public void WakeupMain ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Wakeup the main thread, and invoke delegate.</summary>
<remarks>This methods wakes up the Gtk+ main thread and executes the delegate that was specified at construction time in the Gtk+ thread. </remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ThreadNotify (Gtk.ReadyEvent re);" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters>
<Parameter Name="re" Type="Gtk.ReadyEvent" />
</Parameters>
<Docs>
<summary>ThreadNotify constructor</summary>
<param name="re">A ReadyEvent delegate.</param>
<remarks>The method referenced by the delegate will be invoked on the Gtk+ mainloop whenever any thread invokes the <see cref="M:Gtk.ThreadNotify.WakeupMain ()" /> method.</remarks>
</Docs>
</Member>
<Member MemberName="Close">
<MemberSignature Language="C#" Value="public void Close ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added</summary>
<remarks />
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<summary>To be added</summary>
<param name="disposing">a <see cref="T:System.Boolean" /></param>
<remarks />
</Docs>
</Member>
</Members>
</Type>