コード例 #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>());
    }
コード例 #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);
            }
        }
    }