示例#1
0
 public ShadowMapping(ConversionContext ctx, XmlWriter writer)
     : base(writer)
 {
     this._ctx = ctx;
 }
 public VMLShapeTypeMapping(ConversionContext ctx, XmlWriter writer)
     : base(writer)
 {
 }
示例#3
0
 public NotesMasterMapping(ConversionContext ctx)
     : base(ctx, ctx.Pptx.PresentationPart.AddNotesMasterPart())
 {
     this.MasterPart = (NotesMasterPart)this.targetPart;
 }
示例#4
0
 public SlideMapping(ConversionContext ctx)
     : base(ctx, ctx.Pptx.PresentationPart.AddSlidePart())
 {
 }
 public ColorSchemeMapping(ConversionContext ctx, XmlWriter writer)
     : base(writer)
 {
     this._ctx = ctx;
 }
示例#6
0
 public PresentationMapping(ConversionContext ctx, ContentPart targetPart)
     : base(XmlWriter.Create(targetPart.GetStream(), ctx.WriterSettings))
 {
     this._ctx       = ctx;
     this.targetPart = targetPart;
 }
示例#7
0
 public MasterLayoutManager(ConversionContext ctx, uint masterId)
 {
     this._ctx     = ctx;
     this.MasterId = masterId;
 }
示例#8
0
 public FillMapping(ConversionContext ctx, XmlWriter writer, PresentationMapping <RegularContainer> parentSlideMapping)
     : base(writer)
 {
     this._ctx = ctx;
     this._parentSlideMapping = parentSlideMapping;
 }
 public SlideTransitionMapping(ConversionContext ctx, XmlWriter writer)
     : base(writer)
 {
     this._ctx = ctx;
 }
示例#10
0
 public TitleMasterMapping(ConversionContext ctx, SlideLayoutPart part)
     : base(ctx, part)
 {
 }
示例#11
0
 public viewPropsMapping(ViewPropertiesPart viewPart, XmlWriterSettings xws, ConversionContext ctx)
     : base(XmlWriter.Create(viewPart.GetStream(), xws))
 {
     this._ctx = ctx;
 }
示例#12
0
 public PresentationPartMapping(ConversionContext ctx)
     : base(ctx, ctx.Pptx.PresentationPart)
 {
 }
 public CharacterRunPropsMapping(ConversionContext ctx, XmlWriter writer)
     : base(writer)
 {
     this._ctx = ctx;
 }
示例#14
0
        //public void Apply(BlipStoreEntry bse, Shape shape, ShapeOptions options, Rectangle bounds, ConversionContext ctx, string spid, ref Point size)
        public void Apply(List <ArrayList> VMLEntriesList, ConversionContext ctx)
        {
            this._ctx = ctx;
            BlipStoreEntry bse;

            this._writer.WriteStartDocument();
            this._writer.WriteStartElement("xml");

            this._writer.WriteStartElement("o", "shapelayout", OpenXmlNamespaces.Office);
            this._writer.WriteAttributeString("v", "ext", OpenXmlNamespaces.VectorML, "edit");
            this._writer.WriteStartElement("o", "idmap", OpenXmlNamespaces.Office);
            this._writer.WriteAttributeString("v", "ext", OpenXmlNamespaces.VectorML, "edit");
            this._writer.WriteAttributeString("data", "1079");
            this._writer.WriteEndElement(); //idmap
            this._writer.WriteEndElement(); //shapelayout

            //v:shapetype
            var type = new PictureFrameType();

            type.Convert(new VMLShapeTypeMapping(this._ctx, this._writer));

            foreach (var VMLEntry in VMLEntriesList)
            {
                bse = (BlipStoreEntry)VMLEntry[0];
                var    options = (ShapeOptions)VMLEntry[2];
                var    bounds  = (Rectangle)VMLEntry[3];
                string spid    = (string)VMLEntry[4];
                var    size    = (Point)VMLEntry[5];

                var imgPart = copyPicture(bse, ref size);
                if (imgPart != null)
                {
                    //v:shape
                    this._writer.WriteStartElement("v", "shape", OpenXmlNamespaces.VectorML);
                    this._writer.WriteAttributeString("id", spid);
                    this._writer.WriteAttributeString("type", "#" + VMLShapeTypeMapping.GenerateTypeId(type));

                    var style = new StringBuilder();


                    style.Append("position:absolute;");
                    style.Append("left:" + (new EmuValue(Utils.MasterCoordToEMU(bounds.Left)).ToPoints()).ToString() + "pt;");
                    style.Append("top:" + (new EmuValue(Utils.MasterCoordToEMU(bounds.Top)).ToPoints()).ToString() + "pt;");
                    style.Append("width:").Append(new EmuValue(Utils.MasterCoordToEMU(bounds.Width)).ToPoints()).Append("pt;");
                    style.Append("height:").Append(new EmuValue(Utils.MasterCoordToEMU(bounds.Height)).ToPoints()).Append("pt;");
                    this._writer.WriteAttributeString("style", style.ToString());

                    foreach (var entry in options.OptionsByID.Values)
                    {
                        switch (entry.pid)
                        {
                        //BORDERS

                        case ShapeOptions.PropertyId.borderBottomColor:
                            var bottomColor = new RGBColor((int)entry.op, RGBColor.ByteOrder.RedFirst);
                            this._writer.WriteAttributeString("o", "borderbottomcolor", OpenXmlNamespaces.Office, "#" + bottomColor.SixDigitHexCode);
                            break;

                        case ShapeOptions.PropertyId.borderLeftColor:
                            var leftColor = new RGBColor((int)entry.op, RGBColor.ByteOrder.RedFirst);
                            this._writer.WriteAttributeString("o", "borderleftcolor", OpenXmlNamespaces.Office, "#" + leftColor.SixDigitHexCode);
                            break;

                        case ShapeOptions.PropertyId.borderRightColor:
                            var rightColor = new RGBColor((int)entry.op, RGBColor.ByteOrder.RedFirst);
                            this._writer.WriteAttributeString("o", "borderrightcolor", OpenXmlNamespaces.Office, "#" + rightColor.SixDigitHexCode);
                            break;

                        case ShapeOptions.PropertyId.borderTopColor:
                            var topColor = new RGBColor((int)entry.op, RGBColor.ByteOrder.RedFirst);
                            this._writer.WriteAttributeString("o", "bordertopcolor", OpenXmlNamespaces.Office, "#" + topColor.SixDigitHexCode);
                            break;
                        }
                    }

                    //v:imageData
                    this._writer.WriteStartElement("v", "imagedata", OpenXmlNamespaces.VectorML);
                    this._writer.WriteAttributeString("o", "relid", OpenXmlNamespaces.Office, imgPart.RelIdToString);
                    this._writer.WriteAttributeString("o", "title", OpenXmlNamespaces.Office, "");
                    this._writer.WriteEndElement(); //imagedata

                    //close v:shape
                    this._writer.WriteEndElement();
                }
            }

            this._writer.WriteEndElement(); //xml
            this._writer.WriteEndDocument();
            this._writer.Flush();
        }