當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlElement.GetXmlElement方法代碼示例

本文整理匯總了C#中System.Xml.XmlElement.GetXmlElement方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlElement.GetXmlElement方法的具體用法?C# XmlElement.GetXmlElement怎麽用?C# XmlElement.GetXmlElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XmlElement的用法示例。


在下文中一共展示了XmlElement.GetXmlElement方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: L4D2Map

        public L4D2Map(XmlElement data)
        {
            string imgurl = data.GetInnerText("img");
            ID = imgurl.Substring(0, imgurl.LastIndexOf('/') -4);
            Name = data.GetInnerText("name");
            Played = data.GetInnerText("hasPlayed").Equals("1");

            if (Played) {
                BestTime = float.Parse(data.GetInnerText("besttimemilliseconds")) / 1000;

                ItemsUsed = new L4D2Items(data);

                InfectedKilled = new L4D2Infected(data);

                List<SteamID> teammateList = new List<SteamID>();
                foreach (XmlElement teammate in data.GetXmlElement("teammates")) {
                    teammateList.Add(SteamID.Create(long.Parse(teammate.InnerText), false));
                }
                Teammates = teammateList.ToArray();

                Medal = MedalFrom(data.GetInnerText("medal"));
            }
        }
開發者ID:nefarius,項目名稱:steam-condenser-csharp,代碼行數:23,代碼來源:Left4Dead.cs

示例2: L4D2ScavengeStats

        public L4D2ScavengeStats(XmlElement data)
        {
            AverageCansPerRound = float.Parse(data.GetInnerText("avgcansperround"));
            PerfectRounds       = int.Parse(data.GetInnerText("perfect16canrounds"));
            RoundsLost          = int.Parse(data.GetInnerText("roundslost"));
            RoundsPlayed        = int.Parse(data.GetInnerText("roundsplayed"));
            RoundsWon           = int.Parse(data.GetInnerText("roundswon"));
            TotalCans           = int.Parse(data.GetInnerText("totalcans"));

            List<L4D2ScavengeMapStats> mapList = new List<L4D2ScavengeMapStats>();
            foreach (XmlElement map in data.GetXmlElement("mapstats")) {
                mapList.Add(new L4D2ScavengeMapStats(map));
            }
            MapStats = mapList.ToArray();
        }
開發者ID:nefarius,項目名稱:steam-condenser-csharp,代碼行數:15,代碼來源:Left4Dead.cs

示例3: DefenseGridTower

        public DefenseGridTower(XmlElement data)
        {
            Class = data.Name;
            Level = int.Parse(data.GetAttribute("level"));

            Built  =   int.Parse(data.GetValueText("built"));
            if (data.GetXmlElement("damage") != null) {
                HasDamage = true;
                Damage = float.Parse(data.GetValueText("damage"));
            }
        }
開發者ID:nefarius,項目名稱:steam-condenser-csharp,代碼行數:11,代碼來源:DefenseGrid.cs


注:本文中的System.Xml.XmlElement.GetXmlElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。