SelectObject() public méthode

Selects a single object from the current node.
public SelectObject ( string xpath ) : object
xpath string selection expression
Résultat object
		public void TestIDictionaryProperties()
		{
			Customer customer = new Customer("Rodrigo", "Oliveira", new Address("Penny Lane", 64));
			customer.Properties["email"] = "*****@*****.**";

			XPathObjectNavigator navigator = new XPathObjectNavigator(customer);
			AssertEquals(customer.Properties["email"], navigator.SelectObject("Properties/email"));
		}
		public void TestSelectByField()
		{
			Customer customer1 = new Customer("Rodrigo", "Oliveira", new Address("al. Calder�o Branco", 45));
			customer1.Email = "*****@*****.**";

			XPathObjectNavigator navigator = new XPathObjectNavigator(customer1);
			AssertSame(customer1.Email, navigator.SelectObject("Email"));

			AssertSame(customer1, navigator.SelectObject("/Customer[Email='*****@*****.**']"));
		}
		public void TestIListProperties()
		{
			Product p1 = new Product("egg");
			Product p2 = new Product("Monty Python Flying Circus Box");
			p2.Categories.Add("Silly Stuff");

			Customer c1 = new Customer("Rodrigo", "Oliveira", new Address("Al. Ribeir�o Preto", 487));
			Customer c2 = new Customer("Marcia", "Longo", new Address("Al. Ribeir�o Preto", 487));

			Order o1 = new Order(c1);
			o1.Add(new OrderItem(p1, 10));
			o1.Add(new OrderItem(p2, 1));

			Order o2 = new Order(c2);
			o2.Add(new OrderItem(p1, 15));
			o2.Add(new OrderItem(p2, 1));

			Order[] orders = new Order[] { o1, o2 };
			XPathObjectNavigator navigator = new XPathObjectNavigator(orders, "Orders");			
			AssertEquals(2, navigator.Select("//Order").Count);
			AssertEquals(2, navigator.Select("Order").Count);
			AssertEquals(o1, navigator.SelectObject("Order[1]"));
			AssertEquals(o2, navigator.SelectObject("Order[2]"));

			AssertEquals(o1, navigator.SelectObject("//Order[Customer/FirstName='Rodrigo']"));
			AssertEquals(o2, navigator.SelectObject("//Order[Customer/LastName='Longo']"));

			XPathNodeIterator i = navigator.Select("//Product[Name='egg']");
			AssertEquals(2, i.Count);
			AssertEquals(true, i.MoveNext());
			AssertEquals(p1, ((XPathObjectNavigator)i.Current).Node);

			AssertEquals(o2.Items[0], navigator.SelectObject("//OrderItem[Quantity>10]"));
			AssertEquals(p2, navigator.SelectObject("//Product[Categories/String='Silly Stuff']"));
		}