Exemplo n.º 1
0
        public XElement ToXML()
        {
            // Generate the base XML with mandatory tags
            XElement c1TrueDBGrid = new XElement("Blob");
            XElement dataColsXml  = new XElement("DataCols");

            DataCols.ForEach(col => dataColsXml.Add(col.ToXML()));
            c1TrueDBGrid.Add(dataColsXml);
            XElement styles = new XElement("Styles", new XAttribute("type", "C1.Win.C1TrueDBGrid.Design.ContextWrapper"), new XElement("Data", StylesTag()));

            c1TrueDBGrid.Add(styles);
            XElement splitsXml = new XElement("Splits");

            Splits.ForEach(split => splitsXml.Add(split.ToXML()));
            c1TrueDBGrid.Add(splitsXml);

            XElement namedStylesXML = new XElement("NamedStyles");


            foreach (Style style in this.NamedStyles)
            {
                namedStylesXML.Add(style.ToXML());
            }

            c1TrueDBGrid.Add(namedStylesXML);

            foreach (string tag in Constants.GridNodeProperties)
            {
                c1TrueDBGrid.Add(new XElement(tag, Properties[tag]));
            }
            c1TrueDBGrid.Add(Styles["PrintPageHeaderStyle"].ToXML());
            c1TrueDBGrid.Add(Styles["PrintPageFooterStyle"].ToXML());

            return(c1TrueDBGrid);
        }