当前位置: 首页>>代码示例>>C#>>正文


C# XmlNodeList类代码示例

本文整理汇总了C#中XmlNodeList的典型用法代码示例。如果您正苦于以下问题:C# XmlNodeList类的具体用法?C# XmlNodeList怎么用?C# XmlNodeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XmlNodeList类属于命名空间,在下文中一共展示了XmlNodeList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TimeLinePage

    public TimeLinePage(XmlNodeList milestones, MenuElement menuElement)
    {
        _totalItemNum	= milestones.Count;
        _totalHeight	= (_totalItemNum - 1) * 25;
        _menuElement	= menuElement;

        texture	= _menuElement.GetTextureById("timelinebg");
        Debug.Log("w="+texture.width+", h="+texture.height);
        for (int i=0; i<_totalItemNum; i++){
            TimeLineItem item = new TimeLineItem(_menuElement);
            item.setLabel(_menuElement.GetTextureById(milestones[i].Attributes["time"].Value));

            addItem(item);

            Sprite itemImg	= new Sprite(_menuElement.GetTextureById(milestones[i].Attributes["pic"].Value));
            _itemImgAry.Add(itemImg);
            addChild(itemImg);

            Sprite itemTxt	= new Sprite(_menuElement.GetTextureById(milestones[i].Attributes["text"].Value));
            _itemTxtAry.Add(itemTxt);
            addChild(itemTxt);
            itemTxt.alpha	= 0.0f;
            itemTxt.y		= 640f;
            itemTxt.x		= (_texture.width-itemTxt.width)/2-20;
        }
        this.addEventListner(GuiEvent.CHANGE, new EventDispatcher.CallBack(selectChangeHandler));
        //this.addEventListner(GuiEvent.ENTER_FRAME,new EventDispatcher.CallBack(enterFrameHandler));
        selectItemByIndex(_totalItemNum-1);
    }
开发者ID:meekr,项目名称:Haima,代码行数:29,代码来源:TimeLinePage.cs

示例2: getUsersData

 public List<UserLeaderboard> getUsersData(XmlNodeList _nodelist)
 {
     List<UserLeaderboard> listUser = new List<UserLeaderboard>();
     //		foreach (XmlNode node in _nodelist)
     //		{
     //			foreach (XmlNode _childNode in node.ChildNodes)
     //			{
     ////				UserLeaderboard _usr = new UserLeaderboard();
     //				UserLeaderboard _usr = (UserLeaderboard)ScriptableObject.CreateInstance("UserLeaderboard");
     //
     //				_usr.name 		= 			_childNode.SelectSingleNode("name").InnerText;
     //				_usr.userID 	= int.Parse(_childNode.Attributes.GetNamedItem("id").Value);
     //				_usr.userName	= 			_childNode.SelectSingleNode("name").InnerText;
     //				_usr.userBestScore 	= int.Parse(_childNode.SelectSingleNode("score").InnerText);
     //				_usr.timestamp 	= 			_childNode.SelectSingleNode("timestamp").InnerText;
     //				if (node.Attributes.GetNamedItem("type").Value == GameModes.gameTypeList.Arcade.ToString())
     //				{
     //					_usr.typeReg = GameModes.gameTypeList.Arcade;
     //				}
     //				if (node.Attributes.GetNamedItem("type").Value == GameModes.gameTypeList.Story.ToString())
     //				{
     //					_usr.typeReg = GameModes.gameTypeList.Story;
     //				}
     //
     //				listUser.Add(_usr);
     //			}
     //		}
     return listUser;
 }
开发者ID:Tavrox,项目名称:Lavapools,代码行数:29,代码来源:XMLLeaderboards.cs

示例3: convertFromXmlNodeList

 public List<string> convertFromXmlNodeList(XmlNodeList xml)
 {
     List<string> list = new List<string> ();
     for (int i=0; i<xml.Count; i++) {
         list.Add( xml[i].InnerText);
     }
     return list;
 }
开发者ID:oervald,项目名称:MentorDanmarkApp2,代码行数:8,代码来源:XMLReader.cs

示例4: getValue

 private static string getValue(XmlNodeList profileContent,  string key)
 {
     foreach (XmlNode profileItems in profileContent)
        			{
                 if(profileItems.Name == key){
                     return profileItems.InnerText;
                 }
             }
         return "";
 }
开发者ID:CristianCosta,项目名称:Kinect,代码行数:10,代码来源:SocialNetworkConfig.cs

示例5: ParseTileLayers

 private void ParseTileLayers(XmlNodeList tilelayersXmlNodeList)
 {
     foreach (XmlNode tileset in tilelayersXmlNodeList)
     {
         _tileLayers.Add(TileLayer.ParseTileLayer(tileset, this));
     }
     //_tileLayersLoaded = true;
     Debug.Log(this);
     Debug.Log("Parsed TileLayers.");
 }
开发者ID:kjellski,项目名称:UnityFluidRTS,代码行数:10,代码来源:TileMap.cs

示例6: InjectXmlNodeList

 public void InjectXmlNodeList(XmlNodeList nodeList)
 {
     XmlDocument doc = new XmlDocument();
     xmlNode =  doc.CreateElement("root");
     foreach(XmlNode _node in nodeList)
     {
         xmlNode.AppendChild(_node);
     }
     RegisterEventHandlers();
 }
开发者ID:Daloupe,项目名称:Syzygy_Git,代码行数:10,代码来源:DataMakerXmlProxy.cs

示例7: searchNode

 static XmlNode searchNode(int number, XmlNodeList nodes)
 {
     foreach (XmlNode n in nodes)
     {
         if(int.Parse(n.Attributes.GetNamedItem("id").Value) == number)
         {
             return n;
         }
     }
     return null;
 }
开发者ID:akasa38d,项目名称:DungeonRPG,代码行数:11,代码来源:EnemyParameter.cs

示例8: ParseTiles

    public static Tile[,] ParseTiles(XmlNodeList tilesXmlNodeList, TileMap map, int width, int height)
    {
        var tiles = new Tile[width, height];

        for (int y = 0; y < height; y++)
        {
            for (int x = 0; x < width; x++)
            {
                tiles[x, y] = Tile.ParseTile(tilesXmlNodeList.Item(x * width + y), map, x, y);
            }
        }

        return tiles;
    }
开发者ID:kjellski,项目名称:UnityFluidRTS,代码行数:14,代码来源:TileLayer.cs

示例9: MainMenu

    // Use this for initialization
    public MainMenu(XmlNodeList nodes)
    {
        _bg	= new Sprite(Resources.Load("mainMenu/component/mainMenuBg", typeof(Texture2D)) as Texture2D);
        _bg.width	= _menuWidth;
        _bg.height	= _menuHeight;
        addChild(_bg);

        for (int i=0; i<nodes.Count; i++){
            GuiMenuItem item = new GuiMenuItem();
            item.selectedTexture	= Resources.Load("mainMenu/icon/" + nodes[i].Attributes["icon"].Value+"-b", typeof(Texture2D)) as Texture2D;
            item.defaultTexture		= Resources.Load("mainMenu/icon/" + nodes[i].Attributes["icon"].Value, typeof(Texture2D)) as Texture2D;
            if (nodes[i].Attributes["iOSNativeCode"] != null){
                item.iOSNativeCode = nodes[i].Attributes["iOSNativeCode"].Value;
                typeof(UIBinding).InvokeMember("ActivateUI"+item.iOSNativeCode, BindingFlags.Default | BindingFlags.InvokeMethod, null, null, new object[]{ });
                typeof(UIBinding).InvokeMember("DeactivateUI"+item.iOSNativeCode, BindingFlags.Default | BindingFlags.InvokeMethod, null, null, new object[]{ });
            }
            addItem(item);
        }
    }
开发者ID:meekr,项目名称:Haima,代码行数:20,代码来源:MainMenu.cs

示例10: XMLManager

 //DESC : 초기화
 public XMLManager()
 {
     characterTable = LoadXml("Character", "NewDataSet", "Sheet1");
     enemyTable = LoadXml("Enemy", "NewDataSet", "Sheet1");
     stageTable = LoadXml("Stage", "NewDataSet", "Sheet1");
     summonTable= LoadXml("SummonText", "NewDataSet", "Sheet1");
 }
开发者ID:SsangYoon,项目名称:Unity---RITUAL-GAME,代码行数:8,代码来源:XMLManager.cs

示例11: XMLParser

    public XMLParser(String filePath)
    {
        dt = new DataTable();
        dt.TableName = "tyontekijat";

        dt.Columns.Add("etunimi", typeof(String));
        dt.Columns.Add("sukunimi", typeof(String));
        dt.Columns.Add("numero", typeof(String));
        dt.Columns.Add("tyosuhde", typeof(String));
        dt.Columns.Add("palkka", typeof(int));
        dt.Columns.Add("vakituiset", typeof(int));
        dt.Columns.Add("palkat yht", typeof(int));

        for (int i = 0; i < dt.Columns.Count; i++)
        {
            dt.Columns[i].ReadOnly = false;
        }

        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(filePath);

        etunimiLista = xmlDoc.GetElementsByTagName("etunimi");
        sukunimiLista = xmlDoc.GetElementsByTagName("sukunimi");
        numeroLista = xmlDoc.GetElementsByTagName("numero");
        tyosuhdeLista = xmlDoc.GetElementsByTagName("tyosuhde");
        palkkaLista = xmlDoc.GetElementsByTagName("palkka");
    }
开发者ID:Raedot,项目名称:IIO13200-OHJELMOINTIKOE,代码行数:27,代码来源:XMLParser.cs

示例12: Awake

 //XmlDocument doc;
 void Awake()
 {
     doc.LoadXml(questions.text);
     XmlNode baseNode = doc.DocumentElement;// load the doc, dbPath is a string
     int nNodes = baseNode.ChildNodes.Count;
     // Use this for initialization
     number = Random.Range(1, 10);
     xnList = doc.SelectNodes("/Questions/Question[@id='" + number + "']");
     while (!hit)
     {
         if (xnList.Count == 0)
         {
             number = Random.Range(1, 10);
             xnList = doc.SelectNodes("/Questions/Question[@id='" + number + "']");
         }
         else
         {
             hit = true;
         }
         if (hit)
         {
             foreach (XmlNode node in xnList)
             {
                 vraag = (node.SelectSingleNode("text").InnerText);
                 antwoord1 = (node.SelectSingleNode("option1").InnerText);
                 antwoord2 = (node.SelectSingleNode("option2").InnerText);
                 antwoord3 = (node.SelectSingleNode("option3").InnerText);
                 antwoord4 = (node.SelectSingleNode("option4").InnerText);
                 goed = (node.SelectSingleNode("answer").InnerText);
             }
         }
     }
 }
开发者ID:gold-games,项目名称:eduvader,代码行数:34,代码来源:AIzinnen.cs

示例13: Start

    // Use this for initialization
    void Start()
    {
        var _mapXML = new XmlDocument();
        _mapXML.LoadXml(Name.ToString());

        //MapDrawer.MapController = this;

        _nodes = _mapXML.SelectNodes("//node");
        Debug.Log("Nodes loaded: " + _nodes.Count);
        InitWorldBounds();
    }
开发者ID:DtheC,项目名称:OpenMaps-Drawing,代码行数:12,代码来源:XMLReadTest.cs

示例14: ReadFile

 public static void ReadFile(String path)
 {
     doc = new XmlDocument();
      doc.Load(path);    //加载Xml文件
      rootElem = doc.DocumentElement;   //获取根节点
      wallNodes = rootElem.GetElementsByTagName("archi-wall");
      polylines = rootElem.GetElementsByTagName("aux-polyline");
      windowsNodes = rootElem.GetElementsByTagName("archi-window");
      doorNodes = rootElem.GetElementsByTagName("archi-door");
      archi_info = rootElem.GetElementsByTagName("archi-info");
      sizex = float.Parse(((XmlElement)archi_info[0]).GetAttribute("sizex"))/scalar;
      sizez = float.Parse(((XmlElement)archi_info[0]).GetAttribute("sizez"))/scalar;
 }
开发者ID:MartinXM,项目名称:WordEye,代码行数:13,代码来源:XMLParser.cs

示例15: GetHighScoreInfo

 private void GetHighScoreInfo()
 {
     // Read highscore from xml file
     TextAsset ta = (TextAsset)Resources.Load ("HighScores",typeof(TextAsset));
     m_Doc = new XmlDocument();
     m_Doc.LoadXml(GetTextWithoutBOM(ta));
     m_highScoreInfo = m_Doc.GetElementsByTagName("player");
     /*
     foreach(XmlNode player in m_highScoreInfo){
         Debug.Log(player["name"].InnerXml);
         Debug.Log (player["score"].InnerXml);
     }*/
 }
开发者ID:HaoYuan90,项目名称:RealManAdventure,代码行数:13,代码来源:HighScore.cs


注:本文中的XmlNodeList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。