本文整理汇总了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);
}
示例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;
}
示例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;
}
示例4: getValue
private static string getValue(XmlNodeList profileContent, string key)
{
foreach (XmlNode profileItems in profileContent)
{
if(profileItems.Name == key){
return profileItems.InnerText;
}
}
return "";
}
示例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.");
}
示例6: InjectXmlNodeList
public void InjectXmlNodeList(XmlNodeList nodeList)
{
XmlDocument doc = new XmlDocument();
xmlNode = doc.CreateElement("root");
foreach(XmlNode _node in nodeList)
{
xmlNode.AppendChild(_node);
}
RegisterEventHandlers();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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");
}
示例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");
}
示例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);
}
}
}
}
示例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();
}
示例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;
}
示例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);
}*/
}