Пример #1
0
        public static CalcChainDocument Parse(XmlDocument xmlDoc, XmlNamespaceManager NameSpaceManager)
        {
            var calcChainDoc = new CalcChainDocument();
            foreach (XmlElement node in xmlDoc.SelectNodes("//d:c", NameSpaceManager))
            {
                CT_CalcCell cc = new CT_CalcCell();
                if (node.GetAttributeNode("i") != null)
                {
                    cc.i = Int32.Parse(node.GetAttribute("i"));
                    cc.iSpecified = true;
                }
                cc.r = node.GetAttribute("r");
                if (node.GetAttributeNode("t") != null)
                {
                    string value = node.GetAttribute("t");
                    if (value == "1" || value.ToLower() == "true")
                    {
                        cc.t = true;
                    }
                    else
                    {
                        cc.t = false;
                    }
                }
                if (node.GetAttributeNode("s") != null)
                {
                    string value = node.GetAttribute("s");
                    if (value == "1" || value.ToLower() == "true")
                    {
                        cc.s = true;
                    }
                    else
                    {
                        cc.s = false;
                    }
                }
                if (node.GetAttributeNode("l") != null)
                {
                    string value = node.GetAttribute("l");
                    if (value == "1" || value.ToLower() == "true")
                    {
                        cc.l = true;
                    }
                    else
                    {
                        cc.l = false;
                    }
                }

                calcChainDoc.calcChain.AddC(cc);
            }
            return calcChainDoc;
        }
Пример #2
0
 public static CalcChainDocument Parse(XmlDocument xmlDoc, XmlNamespaceManager NameSpaceManager)
 {
     CalcChainDocument calcChainDoc = new CalcChainDocument();
     foreach (XmlElement node in xmlDoc.SelectNodes("//d:c", NameSpaceManager))
     {
         CT_CalcCell cc = new CT_CalcCell();
         if (node.GetAttributeNode("i")!= null)
         {
             cc.i = XmlHelper.ReadInt(node.GetAttributeNode("i"));
             cc.iSpecified = true;
         }
         cc.r = node.GetAttribute("r");
         cc.t = XmlHelper.ReadBool(node.GetAttributeNode("t"));
         cc.s = XmlHelper.ReadBool(node.GetAttributeNode("s"));
         cc.l = XmlHelper.ReadBool(node.GetAttributeNode("l"));
         calcChainDoc.calcChain.AddC(cc);
     }
     return calcChainDoc;
 }
Пример #3
0
        public static CalcChainDocument Parse(XmlDocument xmlDoc, XmlNamespaceManager NameSpaceManager)
        {
            CalcChainDocument calcChainDoc = new CalcChainDocument();

            foreach (XmlElement node in xmlDoc.SelectNodes("//d:c", NameSpaceManager))
            {
                CT_CalcCell cc = new CT_CalcCell();
                if (node.GetAttributeNode("i") != null)
                {
                    cc.i          = XmlHelper.ReadInt(node.GetAttributeNode("i"));
                    cc.iSpecified = true;
                }
                cc.r = node.GetAttribute("r");
                cc.t = XmlHelper.ReadBool(node.GetAttributeNode("t"));
                cc.s = XmlHelper.ReadBool(node.GetAttributeNode("s"));
                cc.l = XmlHelper.ReadBool(node.GetAttributeNode("l"));
                calcChainDoc.calcChain.AddC(cc);
            }
            return(calcChainDoc);
        }
Пример #4
0
 public void WriteTo(Stream out1)
 {
     CalcChainDocument doc = new CalcChainDocument();
     doc.SetCalcChain(chain);
     doc.Save(out1);
 }