PdfSharp.Drawing.XGraphics.AddTransform C# (CSharp) Method

AddTransform() private method

Gets or sets the transformation matrix.
private AddTransform ( PdfSharp.Drawing.XMatrix transform, XMatrixOrder order ) : void
transform PdfSharp.Drawing.XMatrix
order XMatrixOrder
return void
    void AddTransform(XMatrix transform, XMatrixOrder order)
    {
      //if (!this.transform.Equals(value))
      {
        XMatrix matrix = this.transform;
        matrix.Multiply(transform, order);
        this.transform = matrix;
        matrix = this.defaultViewMatrix;
        matrix.Multiply(this.transform, XMatrixOrder.Prepend);
#if GDI
        if (this.targetContext == XGraphicTargetContext.GDI)
        {
#if DEBUG
          System.Drawing.Drawing2D.Matrix m = (System.Drawing.Drawing2D.Matrix)matrix;
          this.gfx.Transform = m;
#else
          this.gfx.Transform = (System.Drawing.Drawing2D.Matrix)matrix;
#endif
        }
#endif
#if WPF
        if (this.targetContext == XGraphicTargetContext.WPF)
        {
#if !SILVERLIGHT
          MatrixTransform mt = new MatrixTransform(transform.ToWpfMatrix());
#else
          MatrixTransform mt = new MatrixTransform();
          mt.Matrix = transform.ToWpfMatrix();
#endif
          if (order == XMatrixOrder.Append)
            mt = (MatrixTransform)mt.Inverse;
          this.gsStack.Current.SetTransform(mt);
        }
#endif
        if (this.renderer != null)
          this.renderer.Transform = this.transform;
      }
    }