Пример #1
0
        public CT_Cell AddNewC()
        {
            if (null == cField)
            {
                cField = new List <CT_Cell>();
            }
            CT_Cell cell = new CT_Cell();

            this.cField.Add(cell);
            return(cell);
        }
Пример #2
0
 //public CT_Cell()
 //{
 //    this.extLstField = new CT_ExtensionList();
 //    //this.isField = new CT_Rst();
 //    //this.fField = new CT_CellFormula();
 //    this.sField = (uint)(0);
 //    this.tField = ST_CellType.n;
 //    this.cmField = ((uint)(0));
 //    this.vmField = ((uint)(0));
 //    this.phField = false;
 //}
 public void Set(CT_Cell cell)
 {
     fField      = cell.fField;
     vField      = cell.vField;
     isField     = cell.isField;
     extLstField = cell.extLstField;
     rField      = cell.rField;
     sField      = cell.sField;
     tField      = cell.tField;
     cmField     = cell.cmField;
     vmField     = cell.vmField;
     phField     = cell.phField;
 }
Пример #3
0
        public static CT_Cell Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Cell ctObj = new CT_Cell();

            ctObj.r = XmlHelper.ReadString(node.Attribute("r"));
            ctObj.s = XmlHelper.ReadUInt(node.Attribute("s"));
            if (node.Attribute("t") != null)
            {
                ctObj.t = (ST_CellType)Enum.Parse(typeof(ST_CellType), node.Attribute("t").Value);
            }
            ctObj.cm = XmlHelper.ReadUInt(node.Attribute("cm"));
            ctObj.vm = XmlHelper.ReadUInt(node.Attribute("vm"));
            ctObj.ph = XmlHelper.ReadBool(node.Attribute("ph"));
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "f")
                {
                    ctObj.f = CT_CellFormula.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "v")
                {
                    ctObj.v = childNode.Value;
                }
                else if (childNode.Name.LocalName == "is")
                {
                    ctObj.@is = CT_Rst.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Пример #4
0
        public static CT_Row Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Row ctObj = new CT_Row();

            ctObj.r            = XmlHelper.ReadUInt(node.Attribute("r"));
            ctObj.spans        = XmlHelper.ReadString(node.Attribute("spans"));
            ctObj.s            = XmlHelper.ReadUInt(node.Attribute("s"));
            ctObj.customFormat = XmlHelper.ReadBool(node.Attribute("customFormat"));
            if (node.Attribute("ht") != null)
            {
                ctObj.ht = XmlHelper.ReadDouble(node.Attribute("ht"));
            }
            ctObj.hidden       = XmlHelper.ReadBool(node.Attribute("hidden"));
            ctObj.outlineLevel = XmlHelper.ReadByte(node.Attribute("outlineLevel"));
            ctObj.customHeight = XmlHelper.ReadBool(node.Attribute("customHeight"));
            ctObj.collapsed    = XmlHelper.ReadBool(node.Attribute("collapsed"));
            ctObj.thickTop     = XmlHelper.ReadBool(node.Attribute("thickTop"));
            ctObj.thickBot     = XmlHelper.ReadBool(node.Attribute("thickBot"));
            ctObj.ph           = XmlHelper.ReadBool(node.Attribute("ph"));
            ctObj.c            = new List <CT_Cell>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "c")
                {
                    ctObj.c.Add(CT_Cell.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }