A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
1.3 KiB

// -----------------------------------------------------------------------
// <copyright file="IPlatformThreadingInterface.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Platform
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Perspex.Threading;
/// <summary>
/// Provides platform-specific services relating to threading.
/// </summary>
public interface IPlatformThreadingInterface
{
bool HasMessages();
/// <summary>
/// Process a single message from the windowing system, blocking until one is available.
/// </summary>
void ProcessMessage();
/// <summary>
/// Starts a timer.
/// </summary>
/// <param name="interval">The interval.</param>
/// <param name="tick">The action to call on each tick.</param>
/// <returns>An <see cref="IDisposable"/> used to stop the timer.</returns>
IDisposable StartTimer(TimeSpan interval, Action tick);
/// <summary>
/// Sends a message that causes <see cref="ProcessMessage"/> to exit.
/// </summary>
void Wake();
}
}