ReadFromXmlElementNode() публичный Метод

public ReadFromXmlElementNode ( XmlElement xmlnode ) : void
xmlnode System.Xml.XmlElement
Результат void
Пример #1
0
        // Copy all names from one language to another.
        private void CopyAllNames(string langIdFrom, string langIdTo)
        {
            XmlNodeList      allNames          = root.SelectNodes(string.Format("/symbols/symbol/name[@lang='{0}']", langIdFrom));
            HashSet <string> handledSymbolsIds = new HashSet <string>();

            foreach (XmlNode node in allNames)
            {
                SymbolText symText = new SymbolText();
                symText.ReadFromXmlElementNode((XmlElement)node);
                symText.Lang = langIdTo;
                string symbolId = ((XmlElement)node.ParentNode).GetAttribute("id");
                if (!handledSymbolsIds.Contains(symbolId))
                {
                    AddOneSymbolName(symbolId, symText);
                    handledSymbolsIds.Add(symbolId);
                }
            }
        }
Пример #2
0
        // Copy all texts from one language to another.
        private void CopyAllTexts(string langIdFrom, string langIdTo)
        {
            XmlNodeList          allTexts           = root.SelectNodes(string.Format("/symbols/symbol/text[@lang='{0}']", langIdFrom));
            HashSet <SymbolText> handledSymbolTexts = new HashSet <SymbolText>();

            foreach (XmlNode node in allTexts)
            {
                SymbolText symText = new SymbolText();
                symText.ReadFromXmlElementNode((XmlElement)node);
                symText.Lang = langIdTo;
                XmlElement parentNode = (XmlElement)node.ParentNode;
                string     symbolId   = parentNode.GetAttribute("id");
                if (!handledSymbolTexts.Contains(symText))
                {
                    AddOneDescriptionText(symbolId, symText);
                    handledSymbolTexts.Add(symText);
                }
            }
        }
Пример #3
0
        // Copy all texts from one language to another.
        private void CopyAllTexts(string langIdFrom, string langIdTo)
        {
            XmlNodeList allTexts = root.SelectNodes(string.Format("/symbols/symbol/text[@lang='{0}']", langIdFrom));

            foreach (XmlNode node in allTexts) {
                SymbolText symText = new SymbolText();
                symText.ReadFromXmlElementNode((XmlElement) node);
                symText.Lang = langIdTo;
                AddOneDescriptionText(((XmlElement)node.ParentNode).GetAttribute("id"), symText);
            }
        }