/*
 * Created by SharpDevelop.
 * User: turugina
 * Date: 2009/06/16
 * Time: 0:06
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Xml;
using System.Xml.XPath;

namespace TwitterBlock
{
	/// <summary>
	/// Description of UserInfoHelper.
	/// </summary>
	public class UserInfoHelper
	{
		public static UserInfo Parse(XPathNavigator nav)
		{
			UserInfo ui = new UserInfo();
			foreach ( XPathNavigator e in nav.SelectChildren(XPathNodeType.Element))
			{
				switch (e.Name)
				{
					case "name":
						ui.Name = e.Value;
						break;
						
					case "screen_name":
						ui.ScreenName = e.Value;
						break;
						
					case "id":
						ui.Id = e.Value;
						break;
						
				}
			}
			return ui;
		}
	}
}
