Boo.Lang.Runtime.DispatcherCache.Get C# (CSharp) Метод

Get() публичный Метод

Gets a dispatcher from the cache if available otherwise invokes factory to produce one and then cache it.
public Get ( DispatcherKey key, DispatcherFactory factory ) : Dispatcher
key DispatcherKey the dispatcher key
factory DispatcherFactory function to produce a dispatcher in case one it's not yet available
Результат Dispatcher
        public Dispatcher Get(DispatcherKey key, DispatcherFactory factory)
        {
            Dispatcher dispatcher;
            if (!_cache.TryGetValue(key, out dispatcher))
            {
                lock (_cache)
                {
                    if (!_cache.TryGetValue(key, out dispatcher))
                    {
                        dispatcher = factory();
                        _cache.Add(key, dispatcher);
                    }
                }
            }
            return dispatcher;
        }
DispatcherCache