Exemplo n.º 1
0
		 // All this methods are delegates for running tests in host assembly. 
		 
		public static void _DefaultRender (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			Menu menu = new MenuTable ();
			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (menu);
			p.Form.Controls.Add (lce);
		}
Exemplo n.º 2
0
		public void Menu_DataBindings () {
			Menu m = new MenuTable ();
			SetDataBindings (m);
			m.DataSource = CreateXmlDataSource ();
			m.DataBind ();
			CheckMenuItems (m);
		}
Exemplo n.º 3
0
		static Menu CreateMenu () {
			Menu m = new MenuTable ();
			MenuItem rootItem = new MenuItem ("RootItem-Text", "RootItem-Value");
			m.Items.Add (rootItem);
			rootItem.ChildItems.Add (new MenuItem ("Node1-Text", "Node1-Value"));
			rootItem.ChildItems.Add (new MenuItem ("Node2-Text", "Node2-Value"));
			m.StaticItemTemplate = new CompiledTemplateBuilder (_StaticItemTemplate);
			m.DynamicItemTemplate = new CompiledTemplateBuilder (_DynamicItemTemplate);
			return m;
		}
Exemplo n.º 4
0
		public void MenuItemCollection5 ()
		{
			Menu m = new MenuTable ();
			((IStateManager) m.Items).TrackViewState ();
			fillMenu (m);

			object state = ((IStateManager) m.Items).SaveViewState ();

			Menu copy = new MenuTable ();
			((IStateManager) copy.Items).TrackViewState ();
			((IStateManager) copy.Items).LoadViewState (state);

			Assert.AreEqual (1, copy.Items.Count);
			Assert.AreEqual (2, copy.Items [0].ChildItems.Count);
			Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count);
		}
Exemplo n.º 5
0
		public void MenuItemCollection4 ()
		{
			Menu m = new MenuTable ();
			fillMenu (m);
			m.Items.Add (new MenuItem ("root 2"));
			m.Items [0].ChildItems.RemoveAt (1);

			((IStateManager) m.Items).TrackViewState ();
			m.Items [0].Text = "root";
			m.Items [0].ChildItems [0].Text = "node";
			m.Items [0].ChildItems [0].ChildItems [0].Text = "subnode";
			object state = ((IStateManager) m.Items).SaveViewState ();

			Menu copy = new MenuTable ();
			fillMenu (copy);
			copy.Items.Add (new MenuItem ("root 2"));
			copy.Items [0].ChildItems.RemoveAt (1);
			((IStateManager) copy.Items).TrackViewState ();
			((IStateManager) copy.Items).LoadViewState (state);

			Assert.AreEqual (2, copy.Items.Count);
			Assert.AreEqual (1, copy.Items [0].ChildItems.Count);
			Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count);

			Assert.AreEqual ("root", copy.Items [0].Text);
			Assert.AreEqual ("node", copy.Items [0].ChildItems [0].Text);
			Assert.AreEqual ("subnode", copy.Items [0].ChildItems [0].ChildItems [0].Text);
		}
Exemplo n.º 6
0
		public static void PostBackFireEvents_Init (Page p)
		{
			Menu_SetTableMode (p);
			Menu m = new MenuTable ();
			m.MenuItemDataBound += new MenuEventHandler (MenuItemDataBound_Event);
			m.DataSource = LoadXml ();
			p.Controls.Add (m);
			m.DataBind ();
		}