Exemplo n.º 1
0
		/// <summary>
		/// Adds a tab into the collection of tabs.  Due to the dependencies between the 
		/// tab headings and content panes the tabs must be defined up-front
		/// </summary>
		/// <param name="idOrLocation">
		/// For static tabs this is the ID of the tab content pane (must be unique on the page).
		/// For dynamic tabs this is the URL where the content is loaded from.
		/// </param>
		/// <param name="title">Title of the tab (to appear in the tab headings)</param>
		/// <param name="selected">Flags whether this tab should be the selected tab on page load</param>
		/// <returns>Returns Tabs object to maintain chainability</returns>
		public Panes Add(string idOrLocation, string title, bool selected) {
			Pane newTab = new Pane(this.Tabs.Writer, this, idOrLocation, title, selected);

			if (this._Panes.ContainsKey(newTab.IDOrLocation))
				throw new ArgumentException(string.Format("A tab with ID or Location \"{0}\" has already been added.", newTab.IDOrLocation));

			newTab.Index = this._Panes.Count();
			this._Panes.Add(newTab.IDOrLocation, newTab);

			return this;
		}
Exemplo n.º 2
0
		/// <summary>
		/// Adds a tab into the collection of tabs.  Due to the dependencies between the 
		/// tab headings and content panes the tabs must be defined up-front
		/// </summary>
		/// <param name="idOrLocation">
		/// For static tabs this is the ID of the tab content pane (must be unique on the page).
		/// For dynamic tabs this is the URL where the content is loaded from.
		/// </param>
		/// <param name="title">Title of the tab (to appear in the tab headings)</param>
		/// <param name="active">Flags whether this tab should be the active tab on page load</param>
		/// <returns>Returns Tabs object to maintain chainability</returns>
		public Panes Add(string idOrLocation, string title, bool active) {
			Pane newTab = new Pane(this.Tabs.Writer, this, idOrLocation, title, active);

			if (this._Panes.ContainsKey(newTab.IDOrLocation))
				throw new ArgumentException(string.Format("A tab with ID or Location \"{0}\" has already been added.", newTab.IDOrLocation));

			newTab.Index = this._Panes.Count();
			this._Panes.Add(newTab.IDOrLocation, newTab);

			// hold a quick reference to the Pane in case further configuration is required
			_CurrentPane = newTab;

			return this;
		}