Exemple #1
0
        /// <summary>
        /// Get the code Plane from a XmlElement
        /// </summary>
        static public CodePlane LoadFromXml(XmlElement Element, string lang)
        {
            if (Element.Name != "Plane" || string.IsNullOrWhiteSpace(Element.GetAttribute("nameID")))
            {
                throw InvalidXmlPlaneException.DefautMessage;
            }

            string name    = Element.GetAttribute("nameID");
            string newName = GetTextOf(Element, "Name", lang);

            if (newName != null)
            {
                name = newName;
            }

            CodePlane result = new CodePlane(name);

            result.Description = GetTextOf(Element, "Description", lang);

            foreach (XmlElement Range in Element.GetElements("Block"))
            {
                result.Add(CodeBlock.LoadFromXml(Range, lang));
            }

            return(result);
        }
        /// <summary>
        /// Get the Basic Multilingual Plane from a XmlElement
        /// </summary>
        static public void LoadFromXml(XmlElement Element, string lang)
        {
            if (Element.Name != "Plane" || Element.GetAttribute("nameID") != NameID)
            {
                throw InvalidXmlUnicodeException.DefautMessage;
            }

            XmlSMP  = Element;
            XmlLang = lang;
            Blocks  = CodePlane.LoadFromXml(XmlSMP, XmlLang);
        }
Exemple #3
0
        /// <summary>
        /// Get the Basic Multilingual Plane from a XmlElement
        /// </summary>
        static public void LoadFromXml(XmlElement Element, string lang)
        {
            if (Element.Name == "Plane" && Element.GetAttribute("nameID") == NameID)
            {
                XmlTIP  = Element;
                XmlLang = lang;
                Blocks  = CodePlane.LoadFromXml(XmlTIP, XmlLang);
                return;
            }

            throw InvalidXmlUnicodeException.DefautMessage;
        }
        /// <summary>
        /// Get the Basic Multilingual Plane from a XmlElement
        /// </summary>
        static public void LoadFromXml(XmlElement Element, string lang)
        {
            if (Element.Name != "Charsets")
            {
                throw InvalidXmlUnicodeException.DefautMessage;
            }

            XmlCharset = Element;
            XmlLang    = lang;
            Charsets   = new CodePlane(NameID);

            foreach (XmlElement item in XmlCharset.GetElements("Charset", "nameID"))
            {
                Charsets.Add(CharsetFromXml(item, XmlLang));
            }
        }