|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AvalonDock.Controls
{
class ReentrantFlag
{
public class _ReentrantFlagHandler : IDisposable
{
ReentrantFlag _owner;
public _ReentrantFlagHandler(ReentrantFlag owner)
{
_owner = owner;
_owner._flag = true;
}
public void Dispose()
{
_owner._flag = false;
}
}
bool _flag = false;
public _ReentrantFlagHandler Enter()
{
if (_flag)
throw new InvalidOperationException();
return new _ReentrantFlagHandler(this);
}
public bool CanEnter
{
get { return !_flag; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
The Windows Presentation Foundation (WPF) and C# are among my favorites and so I developed
Edi
and a few other projects on
GitHub. I am normally an algorithms and structure type but WPF has such interesting UI sides that I cannot help myself but get into it.
https://de.linkedin.com/in/dirkbahle