Exemplo n.º 1
0
		public void CheckboxListIndex()
		{
			int[] primenumbers = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
			Category[] categories = new Category[] { new Category(1, "Music"), new Category(2, "Humor"), new Category(3, "Politics")  };
		
			PropertyBag["primenumbers"] = primenumbers;
			PropertyBag["categories"] = categories;
			
			// Pre selection (optional)
			int[] selectedPrimes = new int[] { 11, 19, 29 };
			
			Blog blog = new Blog();
			blog.Categories = new Category[] { new Category(2, "Humor") };
			
			PropertyBag["selectedPrimes"] = selectedPrimes;
			PropertyBag["blog"] = blog;
		}
		public void SelectIndex()
		{
			int[] primenumbers = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };
			Category[] categories = new Category[] { new Category(1, "Music"), new Category(2, "Humor"), new Category(3, "Politics")  };
			IList authors = new Author[] { new Author(1, "hammett"), new Author(2, "john doe"), new Author(3, "someone else"), };
			
			PropertyBag["primenumbers"] = primenumbers;
			PropertyBag["categories"] = categories;
			PropertyBag["authors"] = authors;

			// Pre selection (which is optional)
			
			Blog blog = new Blog();
			blog.Author = new Author(1, "hammett");

			PropertyBag["oneprime"] = 3;
			PropertyBag["multipleprimes"] = new int[] { 3, 5, 7 };
			PropertyBag["blog"] = blog;
		}