using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Autodesk.Revit.DB;
namespace KMBIM
{
///
/// 대화상자에서 가능한 요청
///
///
public enum KDCSRequestId : int
{
///
/// None
///
None = 0,
///
/// "Avoidance" request
///
Avoidance = 1
}
public class KDCSRequest
{
// Storing the value as a plain Int makes using the interlocking mechanism simpler
private Resolver m_resolver = null;
///
/// Take - The Idling handler calls this to obtain the latest request.
///
///
/// This is not a getter! It takes the request and replaces it
/// with 'None' to indicate that the request has been "passed on".
///
///
public Resolver Take()
{
return (Resolver)Interlocked.Exchange(ref m_resolver, (Resolver)null);
}
///
/// Make - The Dialog calls this when the user presses a command button there.
///
///
/// It replaces any older request previously made.
///
///
public void Make(Resolver resolver)
{
Interlocked.Exchange(ref m_resolver, (Resolver)resolver);
}
}
}