Example #1
0
        public void AddQuery(MediaQuery newMediaQuery)
        {
            var cache = GetMediaQueryFromCache(byMedia: newMediaQuery.Media);

            if (cache == null)
            {
                cache = new MediaQueryCache
                {
                    MediaRequested = newMediaQuery.Media,
                };
                mediaQueries.Add(cache);
            }
            cache.MediaQueries.Add(newMediaQuery);
        }
Example #2
0
        public void AddQuery(MediaQuery newMediaQuery)
        {
            bool byMediaProperties(MediaQueryCache q) => q.MediaRequested == newMediaQuery.Media;

            var cache = mediaQueries.Find(byMediaProperties);

            if (cache == null)
            {
                cache = new MediaQueryCache
                {
                    MediaRequested = newMediaQuery.Media,
                };
                mediaQueries.Add(cache);
            }
            cache.MediaQueries.Add(newMediaQuery);
        }