How do I get data from an anonymous type that's been converted to an object?
<p>I'm creating a delayed function manager so that you can call <code>TimeManager.DelayedCall(uniqueid, delay, action)</code> to make <code>action</code> get invoked in <code>delay</code> seconds. However, I'm running into some trouble. Here's the code so far.</p>

<pre><code>private static Dictionary&lt;string, object&gt; delays = new Dictionary&lt;string, object&gt;();

public static void Think(float dt)
{
        timestep = dt * timescale;

        time += timestep;

        foreach (KeyValuePair&lt;string, object&gt; kv in delays)
        {
            if (time &gt; kv.Value.ourtime)
            {
                kv.Value.action();
            }
        }
}

public static void DelayedCall(string id, float delay, Action a)
{
        delays[id] = new { ourtime = time + delay, action = a };
}
</code></pre>

<p>This code doesn't compile. Because I'm converting the anonymous type from the <code>DelayedCall</code> function to an <code>object</code>, I cannot get the variables <code>ourtime</code> and <code>action</code> from it in the <code>Think</code> function! Does anyone know how to fix this, or how to do this in a better way?</p>
