Catrobat.IDE.Core.Xml.XmlObjects.Formulas.XmlFormulaTree.LoadFromXml C# (CSharp) Method

LoadFromXml() private method

private LoadFromXml ( System.Xml.Linq.XElement xRoot ) : void
xRoot System.Xml.Linq.XElement
return void
        internal override void LoadFromXml(XElement xRoot)
        {
            if(xRoot.Element(XmlConstants.LeftChild) != null)
                LeftChild = new XmlFormulaTree(xRoot.Element(XmlConstants.LeftChild));
            if (xRoot.Element(XmlConstants.RightChild) != null)
                RightChild = new XmlFormulaTree(xRoot.Element(XmlConstants.RightChild));

            if (xRoot.Element(XmlConstants.Type) != null)
            VariableType = xRoot.Element(XmlConstants.Type).Value;
            if (xRoot.Element(XmlConstants.Value) != null)
            VariableValue = xRoot.Element(XmlConstants.Value).Value;
        }