Beispiel #1
0
 internal void ReadXml(XElement node)
 {
     foreach (XElement element in node.Elements())
     {
         if (element.Name.LocalName == "numRef")
         {
             string childElementValue = element.GetChildElementValue("f");
             if (!string.IsNullOrWhiteSpace(childElementValue))
             {
                 this.ReferenceFormula = childElementValue;
                 if (ParsingContext.ReferenceStyle == ExcelReferenceStyle.R1C1)
                 {
                     this.ReferenceFormula = ParsingContext.ConvertA1FormulaToR1C1Formula(this.ReferenceFormula, 0, 0);
                 }
             }
             foreach (XElement element2 in element.Elements())
             {
                 if (element2.Name.LocalName == "numCache")
                 {
                     this.numberReferenceFormat = element2.GetChildElementValue("formatCode");
                 }
             }
         }
         else if (element.Name.LocalName == "numLit")
         {
             NumericDataLiterals literals = new NumericDataLiterals();
             literals.ReadXml(element);
             this.NumericLiterals = literals;
         }
     }
 }
Beispiel #2
0
 internal void ReadXml(XElement element)
 {
     foreach (XElement element2 in element.Elements())
     {
         if (element2.Name.LocalName == "numRef")
         {
             this.NumberReferencesFormula = element2.GetChildElementValue("f");
             if (ParsingContext.ReferenceStyle == ExcelReferenceStyle.R1C1)
             {
                 this.NumberReferencesFormula = ParsingContext.ConvertA1FormulaToR1C1Formula(this.NumberReferencesFormula, 0, 0);
             }
             foreach (XElement element3 in element2.Elements())
             {
                 if (element3.Name.LocalName == "numCache")
                 {
                     this.numberReferenceFormat = element3.GetChildElementValue("formatCode");
                 }
             }
         }
         else if (element2.Name.LocalName == "numLit")
         {
             if (element2.HasElements)
             {
                 NumericDataLiterals literals = new NumericDataLiterals();
                 literals.ReadXml(element2);
                 this.NumericLiterals = literals;
             }
         }
         else if (element2.Name.LocalName == "strRef")
         {
             this.StringReferencedFormula = element2.GetChildElementValue("f");
             if (ParsingContext.ReferenceStyle == ExcelReferenceStyle.R1C1)
             {
                 this.StringReferencedFormula = ParsingContext.ConvertA1FormulaToR1C1Formula(this.StringReferencedFormula, 0, 0);
             }
         }
         else if (element2.Name.LocalName == "strLit")
         {
             if (element2.HasElements)
             {
                 StringLiteralData data = new StringLiteralData();
                 data.ReadXml(element2);
                 this.StringLiterals = data;
             }
         }
         else if (element2.Name.LocalName == "multiLvlStrRef")
         {
             this.MultiLevelStringReferenceFormula = element2.GetChildElementValue("f");
             if (ParsingContext.ReferenceStyle == ExcelReferenceStyle.R1C1)
             {
                 this.MultiLevelStringReferenceFormula = ParsingContext.ConvertA1FormulaToR1C1Formula(this.MultiLevelStringReferenceFormula, 0, 0);
             }
         }
     }
 }