public ScreenMediaType(ReflowDocument doc) { // Load all the values now: Css.Value width = new Css.Units.PxUnit(Width); Css.Value height = new Css.Units.PxUnit(Height); Css.Value aspect = new Css.Units.DecimalUnit((float)Width / (float)Height); // Pull in the default values: // Note that if any are numeric and 0, it treats it as a null. // (which in turn makes the feature unavailable, as expected by the HasFeature property). this["width"] = width; this["height"] = height; this["device-width"] = width; this["device-height"] = height; this["aspect-ratio"] = aspect; this["device-aspect-ratio"] = aspect; this["orientation"] = new Css.Units.TextUnit(Landscape?"landscape":"portrait"); this["resolution"] = new Css.Units.DecimalUnit(Resolution); this["color"] = new Css.Units.DecimalUnit(Color); this["color-index"] = new Css.Units.DecimalUnit(ColorIndex); this["monochrome"] = new Css.Units.DecimalUnit(Monochrome); this["scan"] = new Css.Units.TextUnit(Scan); this["grid"] = new Css.Units.DecimalUnit(Grid); // Ready! Ready(doc); }
protected override Value Clone() { TextUnit result = new TextUnit(); result.RawValue = RawValue; return(result); }
public override bool Equals(Value value) { if (value == null) { return(false); } TextUnit tu = value as TextUnit; if (tu == null) { return(false); } return(tu.RawValue == RawValue); }