CloneMenu() публичный Метод

public CloneMenu ( ) : MainMenu
Результат MainMenu
Пример #1
0
        public virtual MainMenu CloneMenu()
        {
            MainMenu new_menu = new MainMenu();

            new_menu.CloneMenu(this);
            return(new_menu);
        }
Пример #2
0
        public virtual MainMenu CloneMenu()
        {
            MainMenu menu = new MainMenu();

            menu.CloneMenu(this);
            return(menu);
        }
Пример #3
0
		public void CloneMenuTest ()
		{
			MainMenu mymainmenu1 = new MainMenu ();
			MenuItem menuitem1 = new MenuItem ();
			MenuItem menuitem2 = new MenuItem ();
			menuitem1.Text = "item1";
			menuitem2.Text = "item2";
			mymainmenu1.MenuItems.Add (menuitem1);
			mymainmenu1.MenuItems.Add (menuitem2);
			MainMenu mymainmenu2 = mymainmenu1.CloneMenu ();
			Assert.AreEqual ("item1", mymainmenu2.MenuItems[0].Text, "#9");
		}
Пример #4
0
        public void MainMenu_CloneMenu_Invoke_Success(MenuItem[] items)
        {
            var source = new MainMenu(items)
            {
                RightToLeft = RightToLeft.No
            };
            MainMenu menu = source.CloneMenu();

            Assert.NotSame(source, menu);
            Assert.Equal(items.Select(m => m.Name), menu.MenuItems.Cast <MenuItem>().Select(m => m.Name));
            Assert.Equal(source.IsParent, menu.IsParent);
            Assert.Equal(RightToLeft.Inherit, menu.RightToLeft);
            Assert.Null(menu.GetForm());
            Assert.Empty(menu.Name);
            Assert.Null(menu.Site);
            Assert.Null(menu.Container);
            Assert.Null(menu.Tag);
        }
Пример #5
0
		public virtual MainMenu CloneMenu ()
		{
			MainMenu new_menu = new MainMenu ();
			new_menu.CloneMenu (this);
			return new_menu;
		}
 public virtual MainMenu CloneMenu()
 {
     MainMenu menu = new MainMenu();
     menu.CloneMenu(this);
     return menu;
 }