42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace KMBIM.Revit.Tools.Cmd.PipeConnection
|
|
{
|
|
public class RequestForPipeConnect
|
|
{
|
|
// Storing the value as a plain Int makes using the interlocking mechanism simpler
|
|
private ResolverForPipeConnect m_resolver = null;
|
|
|
|
/// <summary>
|
|
/// Take - The Idling handler calls this to obtain the latest request.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is not a getter! It takes the request and replaces it
|
|
/// with 'None' to indicate that the request has been "passed on".
|
|
/// </remarks>
|
|
///
|
|
public ResolverForPipeConnect Take()
|
|
{
|
|
return (ResolverForPipeConnect)Interlocked.Exchange(ref m_resolver, (ResolverForPipeConnect)null);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Make - The Dialog calls this when the user presses a command button there.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// It replaces any older request previously made.
|
|
/// </remarks>
|
|
///
|
|
public void Make(ResolverForPipeConnect resolver)
|
|
{
|
|
Interlocked.Exchange(ref m_resolver, resolver);
|
|
}
|
|
}
|
|
}
|