Ejemplo n.º 1
0
        /// <summary/>
        public TestObjects(Variation v)
        {
            this.variation = v;
            this.viewport  = null;
            this.visual    = null;
            this.content   = null;

            string ctb = v["ClipToBounds"];
            string o   = v["Opacity"];
            string om  = v["OpacityMask"];
            string c   = v["Clip"];
            string t   = v["Transform"];
            string e   = v["Effect"];
            string ei  = v["EffectInput"];
            string em  = v["EdgeMode"];

            clipToBounds = (ctb == null) ? false : StringConverter.ToBool(ctb);
            clip         = (c == null) ? null : GeometryFactory.MakeGeometry(c);
            opacity      = (o == null) ? 1.0 : StringConverter.ToDouble(o);
            opacityMask  = (om == null) ? null : BrushFactory.MakeBrush(om);
            transform    = (t == null) ? null : Transform2DFactory.MakeTransform2D(t);
            effect       = (e == null) ? null : EffectFactory.MakeEffect(e);
            effectInput  = (ei == null) ? null : EffectInputFactory.MakeEffectInput(ei);
            edgeMode     = (em == null) ? EdgeMode.Unspecified : (EdgeMode)Enum.Parse(typeof(EdgeMode), em);

            // Don't do DPI scaling here.  Avalon needs unscaled input.
            // We will do the scale in the verification code.
            MathEx.RelativeToAbsolute(opacityMask, new Rect(0, 0, v.WindowWidth, v.WindowHeight));

            // Can't scale effectInput here because we don't know the rendered bounds yet.
        }