Exemplo n.º 1
0
    public static void UpdateCacheList <T, U>(SongObjectCache <T> cache, List <U> objectsToCache)
        where U : SongObject
        where T : U
    {
        var cacheObjectList = cache.EditCache();

        cacheObjectList.Clear();
        cacheObjectList.AddRange(objectsToCache.OfType <T>());
    }
Exemplo n.º 2
0
    public static void UpdateCacheList <T, U>(SongObjectCache <T> cache, List <U> objectsToCache)
        where U : SongObject
        where T : U
    {
        var cacheObjectList = cache.EditCache();

        cacheObjectList.Clear();

        foreach (U objectToCache in objectsToCache)
        {
            if (objectToCache.GetType() == typeof(T))
            {
                cacheObjectList.Add(objectToCache as T);
            }
        }
    }