// Taken from http://www.w3.org/TR/css3-mediaqueries/ section 4 private static bool IsSetFeature(Model.Media type, string featureName) { switch (featureName.ToLowerInvariant()) { case " grid": case "device-height": case "device-width": case "height": case "width": return(type.In(Visual) || type.In(Tacticle)); case "resolution": case "device-aspect-ratio": case "aspect-ratio": case "orientation": return(type.In(Bitmap)); case "monochrome": case "color-index": case "color": return(type.In(Visual)); case "scan": return(type == Model.Media.tv); default: throw new InvalidOperationException("Unexpected feature name [" + featureName + "]"); } }