diff options
author | Dick Porter <dick@acm.org> | 2005-08-27 02:21:30 +0400 |
---|---|---|
committer | Dick Porter <dick@acm.org> | 2005-08-27 02:21:30 +0400 |
commit | 3ff73d8d7d4c7b752bef2951ad167cc770ea772b (patch) | |
tree | f21d595806d7e7959c2998dbdc592633672e0177 /mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs | |
parent | 4c004f75ed8cc5aed4f5b02eb9430c51aff0f86e (diff) |
2005-07-27 Dick Porter <dick@ximian.com>
* HtmlInputCheckBoxTest.cs: Tests for HtmlInputCheckBox
2005-07-26 Dick Porter <dick@ximian.com>
* HtmlSelectTest.cs: Tests for HtmlSelect
2005-07-21 Dick Porter <dick@ximian.com>
* HtmlImageTest.cs: The order of attribute rendering has changed,
and now matches MS
2005-07-19 Dick Porter <dick@ximian.com>
* HtmlImageTest.cs: Added tests for negative values in int
properties
2005-07-14 Dick Porter <dick@ximian.com>
* HtmlFormTest.cs: New set of tests
2005-07-07 Dick Porter <dick@ximian.com>
* HtmlImageTest.cs: Unit tests for HtmlImage
2005-08-04 Dick Porter <dick@ximian.com>
* DataGridColumnTest.cs: Tests for DataGridColumn
2005-07-29 Dick Porter <dick@ximian.com>
* RadioButtonTest.cs: Added tests for RadioButton
2005-07-14 Dick Porter <dick@ximian.com>
* CheckBoxTest.cs: Added enum checks
2005-07-13 Dick Porter <dick@ximian.com>
* CheckBoxTest.cs: Added tests for CheckBox - currently all
passing on mono and ms runtimes.
2005-07-14 Dick Porter <dick@ximian.com>
* HttpPostedFile.cs: New basic implementation; needs someone to
figure out what a HttpRequestStream does
2005-08-18 Dick Porter <dick@ximian.com>
* HtmlTable.cs, HtmlInputButton.cs, HtmlInputFile.cs, HtmlHead.cs,
HtmlInputImage.cs, HtmlForm.cs, HtmlInputText.cs,
HtmlInputCheckBox.cs, HtmlAnchor.cs, HtmlInputRadioButton.cs,
HtmlButton.cs, HtmlInputHidden.cs, HtmlTextArea.cs,
HtmlTableRow.cs, HtmlSelect.cs, HtmlControl.cs, HtmlTitle.cs,
HtmlContainerControl.cs: 2.0 API fixes and stubs and attribute fixes
2005-08-09 Dick Porter <dick@ximian.com>
* HtmlSelect.cs: Clear databindings when adding a new one; cope
with assorted combinations of empty text and value fields; write
<option> tags manually to match ms HTML output. All fix nunit
tests.
2005-08-05 Dick Porter <dick@ximian.com>
* HtmlSelect.cs: Fix databinding when one or other of Name and
Value aren't supplied (thanks to Peter for the patch); Make
<option> indenting match ms output.
2005-07-29 Dick Porter <dick@ximian.com>
* HtmlForm.cs: Simplify the rendering code by using QueryStringRaw
instead of building the query string by hand
2005-07-27 Dick Porter <dick@ximian.com>
* HtmlInputCheckBox.cs: New implementation
2005-07-26 Dick Porter <dick@ximian.com>
* HtmlSelect.cs: New implementation
2005-07-24 Dick Porter <dick@ximian.com>
* HtmlForm.cs: Add the trailing query string to the form action;
fixes bug shown in Test/standalone/htmlform/qs_postback.aspx
2005-07-22 Dick Porter <dick@ximian.com>
* HtmlInputFile.cs: Add assembly attributes
2005-07-21 Dick Porter <dick@ximian.com>
* HtmlImage.cs: The src attribute needs to be a relative URL;
close the HTML element when rendering attributes, to match the MS
impl.
* HtmlForm.cs: Added assembly attributes; don't render ID twice;
don't render enctype and target if they are empty strings;
implement a Render overload to keep corcompare quiet.
2005-07-19 Dick Porter <dick@ximian.com>
* HtmlImage.cs: Added attributes; use Int32.Parse instead of
Convert.ToInt32
2005-07-14 Dick Porter <dick@ximian.com>
* HtmlInputFile.cs: New implementation
2005-07-14 Dick Porter <dick@ximian.com>
* HtmlForm.cs: New Implementation
2005-07-07 Dick Porter <dick@ximian.com>
* HtmlImage.cs: New implementation
2005-08-18 Dick Porter <dick@ximian.com>
* ControlCachePolicy.cs, PersistChildrenAttribute.cs,
UserControl.cs, DesignerDataBoundLiteralControl.cs,
PageStatePersister.cs, DataBoundLiteralControl.cs, Control.cs,
BasePartialCachingControl.cs, LiteralControl.cs: 2.0 API fixes and
stubs and attribute fixes
2005-08-11 Dick Porter <dick@ximian.com>
* CssStyleCollection.cs: Tweak the css string format to pass a
unit test
* AttributeCollection.cs: Don't NRE if someone sets the "style"
attribute to null.
2005-08-05 Dick Porter <dick@ximian.com>
* HtmlTextWriter.cs: Make <option> tags render inline, to match
the ms output
2005-07-07 Dick Porter <dick@ximian.com>
* StateBag.cs: Added internal SetDirty (void) method to fix the
build
2005-08-18 Dick Porter <dick@ximian.com>
* PageAdapter.cs, ControlAdapter.cs: 2.0 stubs
2005-08-18 Dick Porter <dick@ximian.com>
* Consts.cs: Added System.Web and Microsoft.VisualStudio.Web
constants for 2.0
2005-08-18 Dick Porter <dick@ximian.com>
* Button.cs, DetailsView.cs, Xml.cs, Table.cs, Menu.cs,
DataControlButton.cs, Label.cs, ObjectDataSource.cs, CheckBox.cs,
RadioButton.cs, ListControl.cs, Image.cs, SiteMapPath.cs,
BaseDataList.cs, DataList.cs, BulletedList.cs,
DataBoundControl.cs, Login.cs, GridView.cs,
CompositeDataBoundControl.cs, Wizard.cs, BaseValidator.cs,
TextBox.cs, CheckBoxList.cs, RadioButtonList.cs, FormView.cs,
AdRotator.cs, Repeater.cs, MenuItemTemplateContainer.cs,
DropDownList.cs, HyperLink.cs, ImageMap.cs, MultiView.cs,
CompositeControl.cs, HierarchicalDataBoundControl.cs, Calendar.cs,
ListBox.cs, TableCell.cs, WebControl.cs, Literal.cs,
BaseDataBoundControl.cs, ValidationSummary.cs, ImageButton.cs,
LinkButton.cs, TreeView.cs: 2.0 API fixes and stubs, and attribute
fixes
2005-08-11 Dick Porter <dick@ximian.com>
* CheckBox.cs: Let ViewState manage removals; apply styles and
"style" attributes in a surrounding <span>. Fixes unit tests.
2005-08-05 Dick Porter <dick@ximian.com>
* CheckBox.cs: Shut corcompare up a bit more. Still need to
figure out how to not use AddAttributesToRender to get it
completely silent.
* ButtonColumn.cs: Implement Initialize() and InitializeCell()
* DataGridColumn.cs: Added the duplicate viewstate manipulation
methods
2005-08-04 Dick Porter <dick@ximian.com>
* DataGridColumn.cs: New implementation
* DataGrid.cs:
* DataGridColumnCollection.cs: Set the DataGridColumn's owner
2005-07-29 Dick Porter <dick@ximian.com>
* RadioButton.cs: Hide nonstandard API; remove GroupName from the
ViewState when it is null.
* CheckBox.cs: Hide nonstandard API
2005-07-22 Dick Porter <dick@ximian.com>
* BoundColumn.cs:
* ButtonColumn.cs: Initial stubs
2005-07-22 Dick Porter <dick@ximian.com>
* RadioButton.cs:
* CheckBox.cs: Add assembly attributes
2005-07-13 Dick Porter <dick@ximian.com>
* CheckBox.cs: Reverted Ben's enum-to-int ViewState change, remove
null Text properties from the ViewState, test for TextAlign being
out of range. All to make tests pass on both mono and ms
runtimes.
2005-07-12 Dick Porter <dick@ximian.com>
* RadioButton.cs: New implementation
* CheckBox.cs: Rearrange the attributes rendering to allow
RadioButton to derive from this
2005-07-11 Dick Porter <dick@ximian.com>
* CheckBox.cs: New implementation
* RadioButton.cs: Initial stubbed version that just compiles
2005-07-08 Dick Porter <dick@ximian.com>
* TextAlign.cs:
* BorderStyle.cs: Added
svn path=/trunk/mcs/; revision=48915
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs')
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs | 191 |
1 files changed, 191 insertions, 0 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs new file mode 100644 index 00000000000..22ef5359f33 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs @@ -0,0 +1,191 @@ +// +// System.Web.UI.HtmlControls.HtmlImage.cs +// +// Author: +// Dick Porter <dick@ximian.com> +// +// Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System.ComponentModel; +using System.Globalization; + +namespace System.Web.UI.HtmlControls +{ + [ControlBuilder (typeof (HtmlControlBuilder))] + public class HtmlImage : HtmlControl + { + public HtmlImage () : base ("img") + { + } + + [DefaultValue ("")] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public string Align + { + get { + string align = Attributes["align"]; + + if (align == null) { + return (String.Empty); + } + + return (align); + } + set { + /* Validate: left, center, right, top, + * middle, bottom? + */ + if (value == null) { + Attributes.Remove ("align"); + } else { + Attributes["align"] = value; + } + } + } + + [DefaultValue ("")] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public string Alt + { + get { + string alt = Attributes["alt"]; + + if (alt == null) { + return (String.Empty); + } + + return (alt); + } + set { + if (value == null) { + Attributes.Remove ("alt"); + } else { + Attributes["alt"] = value; + } + } + } + + [DefaultValue (0)] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public int Border + { + get { + string border = Attributes["border"]; + + if (border == null) { + return (-1); + } else { + return (Int32.Parse (border, CultureInfo.InvariantCulture)); + } + } + set { + if (value == -1) { + Attributes.Remove ("border"); + } else { + Attributes["border"] = value.ToString (); + } + } + } + + [DefaultValue (100)] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public int Height + { + get { + string height = Attributes["height"]; + + if (height == null) { + return (-1); + } else { + return (Int32.Parse (height, CultureInfo.InvariantCulture)); + } + } + set { + if (value == -1) { + Attributes.Remove ("height"); + } else { + Attributes["height"] = value.ToString (); + } + } + } + + [DefaultValue ("")] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public string Src + { + get { + string src = Attributes["src"]; + + if (src == null) { + return (String.Empty); + } + + return (src); + } + set { + if (value == null) { + Attributes.Remove ("src"); + } else { + Attributes["src"] = value; + } + } + } + + [DefaultValue (100)] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public int Width + { + get { + string width = Attributes["width"]; + + if (width == null) { + return (-1); + } + else { + return (Int32.Parse (width, CultureInfo.InvariantCulture)); + } + } + set { + if (value == -1) { + Attributes.Remove ("width"); + } else { + Attributes["width"] = value.ToString (); + } + } + } + + protected override void RenderAttributes (HtmlTextWriter w) + { + PreProcessRelativeReference (w, "src"); + base.RenderAttributes (w); + + /* MS closes the HTML element at the end of + * the attributes too, according to the nunit + * tests + */ + w.Write (" /"); + } + } +} + +
\ No newline at end of file |