Ejemplo n.º 1
0
        protected override Value Clone()
        {
            PxUnit result = new PxUnit();

            result.RawValue = RawValue;
            return(result);
        }
Ejemplo n.º 2
0
        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);
        }