/// <summary> /// Add a page to the page control /// </summary> /// <param name="pageContent">The page's content</param> /// <returns>The create LuaEditPage</returns> public LuaEditPageControlPage AddPage(ILuaEditPageControlPageContent pageContent) { LuaEditPageControlPage page = null; if (FindPageByTitle(pageContent.Title) == null) { page = new LuaEditPageControlPage(pageContent); _pages.Add(page); page.Parent = this; LuaEditPageButton button = new LuaEditPageButton(page); button.Text = pageContent.Title; button.Click += OnPageButtonClicked; pageButtonsPanel.Controls.Add(button); ComputePageButtonsPanel(); if (_currentPage == null) { OnPageButtonClicked(button, new EventArgs()); } } return(page); }
public LuaEditPageControlPage(ILuaEditPageControlPageContent pageContent) : this() { _pageContent = pageContent; }