本文整理汇总了C#中XmlNodeList类的典型用法代码示例。如果您正苦于以下问题:C# XmlNodeList类的具体用法?C# XmlNodeList怎么用?C# XmlNodeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlNodeList类属于命名空间,在下文中一共展示了XmlNodeList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: Start
//private string level{get;set;}
// Use this for initialization
void Start()
{
levelArray = new List<string> ();
levelDoc = new XmlDocument ();
TextAsset xmlfile = Resources.Load ("levels", typeof(TextAsset)) as TextAsset;
levelDoc.LoadXml (xmlfile.text);
levelist = levelDoc.GetElementsByTagName ("level");
foreach( XmlNode leveldata in levelist){
XmlNodeList levelinfo = leveldata.ChildNodes;
foreach(XmlNode data in levelinfo){
if(data.Name == "setup"){
levelArray.Add(data.InnerText);
// if(data.Name=="levelname")
// level=data.InnerText;
}
}
}
}
开发者ID:OzanOcak,项目名称:Game_Csharp,代码行数:21,代码来源:LevelReader.cs
示例11: SubMenu
public SubMenu(XmlNodeList nodes)
{
_nodes = nodes;
_bg = new Sprite(Resources.Load("mainmenu/component/subMenuBg", typeof(Texture2D)) as Texture2D);
_bg.width = _menuWidth;
_bg.height = _menuHeight;
addChild(_bg);
_subMenuBg = new SubMenuBg();
_subMenuBg.y = 6;
addChild(_subMenuBg);
for (int i=0; i<nodes.Count; i++){
GuiMenuItem item = new GuiMenuItem();
item.selectedTexture = Resources.Load("mainmenu/sub/"+nodes[i].Attributes["icon"].Value, typeof(Texture2D)) as Texture2D;
item.defaultTexture = Resources.Load("mainmenu/sub/"+nodes[i].Attributes["icon"].Value, typeof(Texture2D)) as Texture2D;
addItem(item);
}
}
开发者ID:meekr,项目名称:Haima,代码行数:20,代码来源:SubMenu.cs
示例12: OnInspectorGUI
public override void OnInspectorGUI()
{
DrawDefaultInspector();
DataMakerXmlNodeListProxy _target = target as DataMakerXmlNodeListProxy;
if (_target._FsmXmlNodeList!=null)
{
if (!_target._FsmXmlNodeList.Value.Equals(nodeListCache) ){
nodeListCache = _target._FsmXmlNodeList.Value;
content = DataMakerXmlUtils.XmlNodeListToString(nodeListCache);
}
DataMakerEditorGUILayoutUtils.feedbackLabel("Xml Source Valid",DataMakerEditorGUILayoutUtils.labelFeedbacks.OK);
_scroll = DataMakerEditorGUILayoutUtils.StringContentPreview(_scroll,content);
}else{
DataMakerEditorGUILayoutUtils.feedbackLabel("Xml Source Invalid",DataMakerEditorGUILayoutUtils.labelFeedbacks.ERROR);
}
}
开发者ID:Daloupe,项目名称:Syzygy_Git,代码行数:21,代码来源:DataMakerXmlNodeListProxyEditor.cs
示例13: FindElementsByName
/// <summary> find xml nodes whitch have same name </summary>
/// <param name="name">node name</param>
/// <returns>matched xml nodes</returns>
public XmlNodeList FindElementsByName(string name)
{
XmlNodeList result = null;
if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name");
using (SqlConnection con = new SqlConnection(connectionString))
{
string sql = string.Format(@"SELECT * FROM {0} WHERE NodeName = @name", TableName);
SqlParameter para = new SqlParameter("@name", name);
con.Open();
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add(para);
SqlDataReader reader = cmd.ExecuteReader();
if(reader.HasRows)result = new XmlNodeList();
while (reader.Read())
{
result.Add(CreateReadedData(reader));
}
reader.Close();
con.Close();
}
return result;
}
开发者ID:bm776688,项目名称:Beast.Xml,代码行数:25,代码来源:XmlDataContext.cs
示例14: Start
void Start()
{
levelArray = new List<string> ();
levelDoc = new XmlDocument();
TextAsset xmlfile = Resources.Load ("levels", typeof(TextAsset)) as TextAsset;
levelDoc.LoadXml (xmlfile.text);
levelList = levelDoc.GetElementsByTagName("level");
foreach (XmlNode leveldata in levelList)
{
XmlNodeList levelinfo = leveldata.ChildNodes;
Debug.Log (levelList.Count);
foreach (XmlNode data in levelinfo)
{
Debug.Log(data.Name);
if(data.Name == "setup")
{
Debug.Log(data.InnerText);
levelArray.Add(data.InnerText);
}
}
}
this.gameObject.GetComponent<GameManager>().Initialise(levelArray.Count);
}
开发者ID:OzanOcak,项目名称:AmazingCubes,代码行数:24,代码来源:LevelHandler.cs
示例15: XmlNodeListToString
public static string XmlNodeListToString(XmlNodeList nodeList, int indentation)
{
if (nodeList==null)
{
return "-- NULL --";
}
using (var sw = new StringWriter())
{
using (var xw = new XmlTextWriter(sw))
{
xw.Formatting = Formatting.Indented;
xw.Indentation = indentation;
xw.WriteRaw("<result>");
foreach(XmlNode node in nodeList)
{
node.WriteTo(xw);
}
xw.WriteRaw("</result>");
}
return sw.ToString();
}
}
开发者ID:Daloupe,项目名称:Syzygy_Git,代码行数:24,代码来源:DataMakerXmlUtils.cs
示例16: MakeNodesList
static Match [] MakeNodesList (XmlNodeList nodes)
{
if (nodes.Count == 0)
return null;
Match [] list = new Match [nodes.Count];
for (int i = 0; i < list.Length; i ++) {
Match m = new Match (GetNodeSignature (nodes [i]), false);
m.Node = nodes [i];
list [i] = m;
}
return list;
}
开发者ID:emtees,项目名称:old-code,代码行数:15,代码来源:updater.cs
示例17: DeprecateNodes
static void DeprecateNodes (XmlDocument document, XmlNodeList nodes)
{
foreach (XmlNode node in nodes)
DeprecateNode (document, node);
}
开发者ID:emtees,项目名称:old-code,代码行数:5,代码来源:updater.cs
示例18: 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
示例19: 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
示例20: 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
注:本文中的XmlNodeList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论