| |||||||||||||||||
| Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
| Web\WebBuilders\ItemTemplates\AddItemTemplate.cs | - | 100,0 % | 100,0 % | 100,0 % |
|
||||||||||||
| 1 | #region Copyright | |
| 2 | /* | |
| 3 | ShowX. Maps business objects into presentation layer. | |
| 4 | Copyright (C) 2005 Jesus Diaz. | |
| 5 | ||
| 6 | This library is free software; you can redistribute it and/or | |
| 7 | modify it under the terms of the GNU Lesser General Public | |
| 8 | License as published by the Free Software Foundation; either | |
| 9 | version 2.1 of the License, or (at your option) any later version. | |
| 10 | ||
| 11 | This library is distributed in the hope that it will be useful, | |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | Lesser General Public License for more details. | |
| 15 | ||
| 16 | You should have received a copy of the GNU Lesser General Public | |
| 17 | License along with this library; if not, write to the Free Software | |
| 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
| 19 | ||
| 20 | For project details see: http://showx.sourceforge.net | |
| 21 | */ | |
| 22 | #endregion | |
| 23 | ||
| 24 | using System; | |
| 25 | using System.Web.UI.WebControls; | |
| 26 | using ShowX.Web.WebControls; | |
| 27 | ||
| 28 | namespace ShowX.Web.WebBuilders.ItemTemplates | |
| 29 | { | |
| 30 | /// <summary> | |
| 31 | /// Represent the template used to add an item to AddElement control. | |
| 32 | /// </summary> | |
| 33 | public class AddItemTemplate : ElemTemplate { | |
| 34 | ||
| 35 | /// <summary> | |
| 36 | /// Constructor. | |
| 37 | /// </summary> | |
| 38 | /// <param name="type">Type associated to owner control.</param> | |
| 39 | /// <param name="owner"><see cref="AdminElement"/> owner of this template.</param> | |
| 40 | 25 | public AddItemTemplate(Type type, AdminElement owner) : base (type,owner) {} |
| 41 | ||
| 42 | /// <summary> | |
| 43 | /// Build buttons associated to this AddElement. | |
| 44 | /// </summary> | |
| 45 | /// <param name="tableRow">Table Row where to locate buttons.</param> | |
| 46 | 25 | public override void BuildButtons(TableRow tableRow) |
| 47 | { | |
| 48 | 25 | TableCell tableCell = new TableCell(); |
| 49 | 25 | tableRow.Cells.Add(tableCell); |
| 50 | 25 | tableCell = new TableCell(); |
| 51 | 25 | tableRow.Cells.Add(tableCell); |
| 52 | ||
| 53 | 25 | Button button = new Button(); |
| 54 | 25 | button.Text = "Adicionar"; |
| 55 | 25 | button.ControlStyle.MergeWith(owner.ChildControlStyle); |
| 56 | 25 | button.CommandName = "Add"; |
| 57 | 25 | tableCell.Controls.Add(button); |
| 58 | ||
| 59 | 25 | button = new Button(); |
| 60 | 25 | button.Text = "Cancelar"; |
| 61 | 25 | button.ControlStyle.MergeWith(owner.ChildControlStyle); |
| 62 | 25 | button.CommandName = "Cancel"; |
| 63 | 25 | tableCell.Controls.Add(button); |
| 64 | } | |
| 65 | } | |
| 66 | } | |
| 67 |
|
||||||||