I=(S=Uno.ResourceManager = function(){
}).prototype;

S.AddFactory = function(key, factory)
{
    if (Uno.ResourceManager.factories == null)
    {
        Uno.ResourceManager.factories = Uno.Dictionary__string__Uno_ResourceManager_CreateResource.$0();
    }

    if (Uno.ResourceManager.resources == null)
    {
        Uno.ResourceManager.resources = Uno.Dictionary__string__object.$0();
    }

    Uno.ResourceManager.factories.Add(key, factory);
};

S.GetResource = function(key)
{
    var result = null;

    if (Uno.ResourceManager.resources.TryGetValue(key, ref(function(){return result}, function($){result=$}, this)))
    {
        return result;
    }

    result = Uno.ResourceManager.factories.indexer(key).Invoke();
    Uno.ResourceManager.resources.Add(key, result);
    return result;
};
