blob: d7da0c72aa15e8fc41b4c1ffd0a676945acc5260 (
plain)
| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 05 4d 00 00 02 b7 08 02 00 00 00 3e aa f9 | .PNG........IHDR...M.........>.. |
| 0020 | f3 00 00 00 09 70 48 59 73 00 00 0b 13 00 00 0b 13 01 00 9a 9c 18 00 00 00 07 74 49 4d 45 07 e2 | .....pHYs.................tIME.. |
| 0040 | 02 1a 0d 35 38 50 d7 1d c9 00 00 20 00 49 44 41 54 78 da ec 7d 79 74 5b e5 99 fe d5 be ef 91 65 | ...58P.......IDATx..}yt[.......e |
| 0060 | 59 96 77 3b de e2 d8 ce 42 96 86 3d d0 34 a5 0d 9c 76 da 4c 87 02 a7 74 a1 d3 69 4b 29 4c 87 d3 | Y.w;....B..=.4...v.L...t..iK)L.. |
| 0080 | f9 b5 9c 72 5a da 29 43 4b a7 9c a1 0c a5 74 18 da 02 a5 14 0a 81 a6 40 58 02 59 ed d8 89 d7 78 | ...rZ.)CK.....t........@X.Y....x |
| 00a0 | 97 64 59 96 b5 ef 57 db ef 8f e7 e4 3b aa 2c b9 31 50 48 e0 7d fe d0 51 1c 59 be ba ba f7 fb de | .dY...W.....;.,.1PH.}..Q.Y...... |
| 00c0 | e7 7d 9f f7 79 05 f9 7c 9e 23 10 08 04 02 81 40 20 10 08 04 02 81 f0 be 80 90 4e 01 81 40 20 10 | .}..y..|.#.....@..........N..@.. |
| 00e0 | 08 04 02 81 40 20 10 08 c4 f3 09 04 02 81 40 20 10 08 04 02 81 40 20 10 cf 27 10 08 04 02 81 40 | ....@.........@......@...'.....@ |
| 0100 | 20 10 08 04 02 81 40 3c 9f 40 20 10 08 04 02 81 40 20 10 08 04 02 f1 7c 02 81 40 20 10 08 04 02 | ......@<.@......@......|..@..... |
| 0120 | 81 40 20 10 88 e7 13 08 04 02 81 40 20 10 08 04 02 81 40 20 9e 4f 20 10 08 04 02 81 40 20 10 0// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
using System.Threading;
namespace Tango.Scripting.Editors.Utils
{
/// <summary>
/// Invokes an action when it is disposed.
/// </summary>
/// <remarks>
/// This class ensures the callback is invoked at most once,
/// even when Dispose is called on multiple threads.
/// </remarks>
sealed class CallbackOnDispose : IDisposable
{
Action action;
public CallbackOnDispose(Action action)
{
Debug.Assert(action != null);
this.action = action;
}
public void Dispose()
{
Action a = Interlocked.Exchange(ref action, null);
if (a != null) {
a();
}
}
}
}
|