/**
         * Initialize a new Speadsheet VML Drawing
         */
        private void newDrawing()
        {
            CT_ShapeLayout layout = new CT_ShapeLayout();
            layout.ext = (ST_Ext.edit);
            CT_IdMap idmap = layout.AddNewIdmap();
            idmap.ext = (ST_Ext.edit);
            idmap.data = ("1");
            _items.Add(layout);

            CT_Shapetype shapetype = new CT_Shapetype();
            shapetype.id= "_x0000_t" + _shapeTypeId;
            shapetype.coordsize="21600,21600";
            shapetype.spt=202;
            shapetype.path2 = ("m,l,21600r21600,l21600,xe");
            shapetype.AddNewStroke().joinstyle = (ST_StrokeJoinStyle.miter);
            CT_Path path = shapetype.AddNewPath();
            path.gradientshapeok = ST_TrueFalse.t;
            path.connecttype=(ST_ConnectType.rect);
            _items.Add(shapetype);
        }
Exemple #2
0
 //internal static XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(new XmlQualifiedName[] {
 //    new XmlQualifiedName("o", "urn:schemas-microsoft-com:office:office"),
 //    new XmlQualifiedName("x", "urn:schemas-microsoft-com:office:excel"),
 //    new XmlQualifiedName("v", "urn:schemas-microsoft-com:vml")
 //});
 //public override string ToString()
 //{
 //    using (StringWriter stringWriter = new StringWriter())
 //    {
 //        XmlWriterSettings settings = new XmlWriterSettings();
 //        settings.Encoding = Encoding.UTF8;
 //        settings.OmitXmlDeclaration = true;
 //        using (XmlWriter writer = XmlWriter.Create(stringWriter, settings))
 //        {
 //            serializer.Serialize(writer, this, namespaces);
 //        }
 //        return stringWriter.ToString();
 //    }
 //}
 public static CT_ShapeLayout Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_ShapeLayout ctObj = new CT_ShapeLayout();
     if (node.Attributes["v:ext"] != null)
         ctObj.ext = (ST_Ext)Enum.Parse(typeof(ST_Ext), node.Attributes["v:ext"].Value);
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "idmap")
             ctObj.idmap = CT_IdMap.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "regrouptable")
             ctObj.regrouptable = CT_RegroupTable.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "rules")
             ctObj.rules = CT_Rules.Parse(childNode, namespaceManager);
     }
     return ctObj;
 }