public XmlElement ToXml(XmlDocument doc) { var type = fillStyleType; var ele = doc.CreateElement("MorphFillStyle"); ele.SetAttribute("fillStyleType", fillStyleType.ToString()); if (type == 0x00) { ele.SetAttribute("startColor", startColor.ToString()); ele.SetAttribute("endColor", endColor.ToString()); } else if (type == 0x10 || type == 0x12) { ele.SetAttribute("startGradientMatrix", startGradientMatrix.ToString()); ele.SetAttribute("endGradientMatrix", endGradientMatrix.ToString()); ele.AppendChild(gradient.ToXml(doc)); } else if (type == 0x40 || type == 0x41 || type == 0x42 || type == 0x43) { ele.SetAttribute("bitmapId", bitmapId.ToString()); ele.SetAttribute("startBitmapMatrix", startBitmapMatrix.ToString()); ele.SetAttribute("endBitmapMatrix", endBitmapMatrix.ToString()); } return(ele); }
public byte buttonType;//表示DefineButton1/表示DefineButton2 public XmlElement ToXml(XmlDocument doc) { var ele = doc.CreateElement("ButtonRecord"); ele.SetAttribute("buttonReserved", buttonReserved.ToString()); ele.SetAttribute("buttonHasBlendMode", buttonHasBlendMode.ToString()); ele.SetAttribute("buttonHasFilterList", buttonHasFilterList.ToString()); ele.SetAttribute("buttonStateHitTest", buttonStateHitTest.ToString()); ele.SetAttribute("buttonStateDown", buttonStateDown.ToString()); ele.SetAttribute("buttonStateOver", buttonStateOver.ToString()); ele.SetAttribute("buttonStateUp", buttonStateUp.ToString()); ele.SetAttribute("characterID", characterID.ToString()); ele.SetAttribute("placeDepth", placeDepth.ToString()); ele.SetAttribute("placeMatrix", placeMatrix.ToString()); if (buttonType == 2) { ele.AppendChild(colorTransform.ToXml(doc)); if (buttonHasFilterList) { ele.AppendChild(filterList.ToXml(doc)); } if (buttonHasBlendMode) { ele.SetAttribute("blendMode", blendMode.ToString()); } } ele.SetAttribute("buttonType", buttonType.ToString()); return(ele); }
public override XmlElement ToXml(XmlDocument doc) { var ele = CreateXmlElement(doc, "PlaceObject"); ele.SetAttribute("characterId", characterId.ToString()); ele.SetAttribute("depth", depth.ToString()); ele.SetAttribute("matrix", matrix.ToString()); ele.AppendChild(colorTransform.ToXml(doc)); return(ele); }
public XmlElement ToXml(XmlDocument doc) { var ele = doc.CreateElement("FillStyle"); //fillStyleType var fillStyleTypeEle = doc.CreateElement("FillStyleType"); fillStyleTypeEle.InnerText = fillStyleType.ToString(); ele.AppendChild(fillStyleTypeEle); //color if (fillStyleType == 0x00) { var colorEle = doc.CreateElement("Color"); colorEle.InnerText = color.ToString(); ele.AppendChild(colorEle); } //gradientMatrix if (fillStyleType == 0x10 || fillStyleType == 0x12 || fillStyleType == 0x13) { var gradientMatrixEle = doc.CreateElement("GradientMatrix"); gradientMatrixEle.InnerText = gradientMatrix.ToString(); ele.AppendChild(gradientMatrixEle); } //gradient if (fillStyleType == 0x10 || fillStyleType == 0x12) { ele.AppendChild(((GradientRecord)gradient).ToXml(doc)); } else if (fillStyleType == 0x13) { ele.AppendChild(((FocalGradientRecord)gradient).ToXml(doc)); } if (fillStyleType == 0x40 || fillStyleType == 0x41 || fillStyleType == 0x42 || fillStyleType == 0x43) { //bitmapId var bitmapIdEle = doc.CreateElement("BitmapId"); bitmapIdEle.InnerText = bitmapId.ToString(); ele.AppendChild(bitmapIdEle); //bitmapMatrix var bitmapMatrixEle = doc.CreateElement("BitmapMatrix"); bitmapMatrixEle.InnerText = bitmapMatrix.ToString(); ele.AppendChild(bitmapMatrixEle); } return(ele); }
//public clipActions; public override XmlElement ToXml(XmlDocument doc) { var ele = CreateXmlElement(doc, "PlaceObject2"); ele.SetAttribute("placeFlagHasClipActions", placeFlagHasClipActions.ToString()); ele.SetAttribute("placeFlagHasClipDepth", placeFlagHasClipDepth.ToString()); ele.SetAttribute("placeFlagHasName", placeFlagHasName.ToString()); ele.SetAttribute("placeFlagHasRatio", placeFlagHasRatio.ToString()); ele.SetAttribute("placeFlagHasColorTransform", placeFlagHasColorTransform.ToString()); ele.SetAttribute("placeFlagHasCharacter", placeFlagHasCharacter.ToString()); ele.SetAttribute("placeFlagMove", placeFlagMove.ToString()); if (placeFlagHasCharacter) { ele.SetAttribute("characterId", characterId.ToString()); } if (placeFlagHasMatrix) { ele.SetAttribute("matrix", matrix.ToString()); } if (placeFlagHasColorTransform) { ele.AppendChild(colorTransform.ToXml(doc)); } if (placeFlagHasRatio) { ele.SetAttribute("ratio", ratio.ToString()); } if (placeFlagHasName) { ele.SetAttribute("name", name.ToString()); } if (placeFlagHasClipDepth) { ele.SetAttribute("clipDepth", clipDepth.ToString()); } //if(placeFlagHasClipActions)ele.AppendChild(clipActions.toXml(doc)); return(ele); }
//public clipActions; public override XmlElement ToXml(XmlDocument doc) { var ele = CreateXmlElement(doc, "PlaceObject3"); ele.SetAttribute("placeFlagHasClipActions", placeFlagHasClipActions.ToString()); ele.SetAttribute("placeFlagHasClipDepth", placeFlagHasClipDepth.ToString()); ele.SetAttribute("placeFlagHasName", placeFlagHasName.ToString()); ele.SetAttribute("placeFlagHasRatio", placeFlagHasRatio.ToString()); ele.SetAttribute("placeFlagHasColorTransform", placeFlagHasColorTransform.ToString()); ele.SetAttribute("placeFlagHasMatrix", placeFlagHasMatrix.ToString()); ele.SetAttribute("placeFlagHasCharacter", placeFlagHasCharacter.ToString()); ele.SetAttribute("placeFlagMove", placeFlagMove.ToString()); ele.SetAttribute("reserved", reserved.ToString()); ele.SetAttribute("placeFlagOpaqueBackground", placeFlagOpaqueBackground.ToString()); ele.SetAttribute("placeFlagHasVisible", placeFlagHasVisible.ToString()); ele.SetAttribute("placeFlagHasImage", placeFlagHasImage.ToString()); ele.SetAttribute("placeFlagHasClassName", placeFlagHasClassName.ToString()); ele.SetAttribute("placeFlagHasCacheAsBitmap", placeFlagHasCacheAsBitmap.ToString()); ele.SetAttribute("placeFlagHasBlendMode", placeFlagHasBlendMode.ToString()); ele.SetAttribute("placeFlagHasFilterList", placeFlagHasFilterList.ToString()); ele.SetAttribute("depth", depth.ToString()); if (placeFlagHasClassName) { ele.SetAttribute("className", className.ToString()); } if (placeFlagHasCharacter) { ele.SetAttribute("characterId", characterId.ToString()); } if (placeFlagHasMatrix) { ele.SetAttribute("matrix", matrix.ToString()); } if (placeFlagHasColorTransform) { ele.SetAttribute("colorTransform", colorTransform.ToString()); } if (placeFlagHasRatio) { ele.SetAttribute("ratio", ratio.ToString()); } if (placeFlagHasName) { ele.SetAttribute("name", name.ToString()); } if (placeFlagHasClipDepth) { ele.SetAttribute("clipDepth", clipDepth.ToString()); } if (placeFlagHasFilterList) { ele.AppendChild(surfaceFilterList.ToXml(doc)); } if (placeFlagHasBlendMode) { ele.SetAttribute("blendMode", blendMode.ToString()); } if (placeFlagHasCacheAsBitmap) { ele.SetAttribute("bitmapCache", bitmapCache.ToString()); } if (placeFlagHasVisible) { ele.SetAttribute("visible", visible.ToString()); } /*if(placeFlagHasVisible){ * ele.AppendChild(clipActions.toXml(doc)); * }*/ return(ele); }