Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / HtmlControls / HtmlImage.cs / 1305376 / HtmlImage.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* HtmlImage.cs
*
* Copyright (c) 2000 Microsoft Corporation
*/
namespace System.Web.UI.HtmlControls {
using System;
using System.Globalization;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
///
/// The
/// class defines the methods, properties, and events
/// for the HtmlImage server control.
/// This class provides programmatic access on the server to
/// the HTML <img> element.
///
///
[
ControlBuilderAttribute(typeof(HtmlEmptyTagControlBuilder))
]
public class HtmlImage : HtmlControl {
/*
* Creates an intrinsic Html IMG control.
*/
///
/// Initializes a new instance of the class.
///
public HtmlImage() : base("img") {
}
/*
* Alt property
*/
///
///
/// Gets or sets the alternative caption that the
/// browser displays if image is either unavailable or has not been downloaded yet.
///
///
[
WebCategory("Appearance"),
Localizable(true),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Alt {
get {
string s = Attributes["alt"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["alt"] = MapStringAttributeToString(value);
}
}
/*
* Align property
*/
///
/// Gets or sets the alignment of the image with
/// surrounding text.
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Align {
get {
string s = Attributes["align"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["align"] = MapStringAttributeToString(value);
}
}
/*
* Border property, size of border in pixels.
*/
///
///
/// Gets or sets the width of image border, in pixels.
///
///
[
WebCategory("Appearance"),
DefaultValue(0),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Border {
get {
string s = Attributes["border"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["border"] = MapIntegerAttributeToString(value);
}
}
/*
* Height property
*/
///
///
/// Gets or sets
/// the height of the image. By default, this is expressed in
/// pixels,
/// but can be a expressed as a percentage.
///
///
[
WebCategory("Layout"),
DefaultValue(100),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Height {
get {
string s = Attributes["height"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["height"] = MapIntegerAttributeToString(value);
}
}
/*
* Src property.
*/
///
///
/// Gets or sets the name of and path to the
/// image file to be displayed. This can be an absolute or
/// relative path.
///
///
[
WebCategory("Behavior"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
UrlProperty()
]
public string Src {
get {
string s = Attributes["src"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["src"] = MapStringAttributeToString(value);
}
}
/*
* Width property
*/
///
///
/// Gets or sets the width of the image. By default, this is
/// expressed in pixels,
/// but can be a expressed as a percentage.
///
///
[
WebCategory("Layout"),
DefaultValue(100),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Width {
get {
string s = Attributes["width"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["width"] = MapIntegerAttributeToString(value);
}
}
/*
* Override to render unique name attribute.
* The name attribute is owned by the framework.
*/
///
///
///
protected override void RenderAttributes(HtmlTextWriter writer) {
PreProcessRelativeReferenceAttribute(writer, "src");
base.RenderAttributes(writer);
writer.Write(" /");
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* HtmlImage.cs
*
* Copyright (c) 2000 Microsoft Corporation
*/
namespace System.Web.UI.HtmlControls {
using System;
using System.Globalization;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
///
/// The
/// class defines the methods, properties, and events
/// for the HtmlImage server control.
/// This class provides programmatic access on the server to
/// the HTML <img> element.
///
///
[
ControlBuilderAttribute(typeof(HtmlEmptyTagControlBuilder))
]
public class HtmlImage : HtmlControl {
/*
* Creates an intrinsic Html IMG control.
*/
///
/// Initializes a new instance of the class.
///
public HtmlImage() : base("img") {
}
/*
* Alt property
*/
///
///
/// Gets or sets the alternative caption that the
/// browser displays if image is either unavailable or has not been downloaded yet.
///
///
[
WebCategory("Appearance"),
Localizable(true),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Alt {
get {
string s = Attributes["alt"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["alt"] = MapStringAttributeToString(value);
}
}
/*
* Align property
*/
///
/// Gets or sets the alignment of the image with
/// surrounding text.
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Align {
get {
string s = Attributes["align"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["align"] = MapStringAttributeToString(value);
}
}
/*
* Border property, size of border in pixels.
*/
///
///
/// Gets or sets the width of image border, in pixels.
///
///
[
WebCategory("Appearance"),
DefaultValue(0),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Border {
get {
string s = Attributes["border"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["border"] = MapIntegerAttributeToString(value);
}
}
/*
* Height property
*/
///
///
/// Gets or sets
/// the height of the image. By default, this is expressed in
/// pixels,
/// but can be a expressed as a percentage.
///
///
[
WebCategory("Layout"),
DefaultValue(100),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Height {
get {
string s = Attributes["height"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["height"] = MapIntegerAttributeToString(value);
}
}
/*
* Src property.
*/
///
///
/// Gets or sets the name of and path to the
/// image file to be displayed. This can be an absolute or
/// relative path.
///
///
[
WebCategory("Behavior"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
UrlProperty()
]
public string Src {
get {
string s = Attributes["src"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["src"] = MapStringAttributeToString(value);
}
}
/*
* Width property
*/
///
///
/// Gets or sets the width of the image. By default, this is
/// expressed in pixels,
/// but can be a expressed as a percentage.
///
///
[
WebCategory("Layout"),
DefaultValue(100),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Width {
get {
string s = Attributes["width"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["width"] = MapIntegerAttributeToString(value);
}
}
/*
* Override to render unique name attribute.
* The name attribute is owned by the framework.
*/
///
///
///
protected override void RenderAttributes(HtmlTextWriter writer) {
PreProcessRelativeReferenceAttribute(writer, "src");
base.RenderAttributes(writer);
writer.Write(" /");
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SystemThemeKey.cs
- WebBrowserProgressChangedEventHandler.cs
- GrammarBuilderPhrase.cs
- AssemblyInfo.cs
- WebPartEditVerb.cs
- RenderData.cs
- ChtmlSelectionListAdapter.cs
- FormsAuthenticationEventArgs.cs
- TypeBuilderInstantiation.cs
- CustomSignedXml.cs
- RSAPKCS1SignatureDeformatter.cs
- SyntaxCheck.cs
- StreamResourceInfo.cs
- IProducerConsumerCollection.cs
- TemplateBamlRecordReader.cs
- MenuItem.cs
- SwitchAttribute.cs
- Synchronization.cs
- ObjectListDataBindEventArgs.cs
- ToolStripDropDownMenu.cs
- StatusBarDrawItemEvent.cs
- OleDragDropHandler.cs
- GuidelineSet.cs
- InputDevice.cs
- _FtpControlStream.cs
- DataBoundControlHelper.cs
- ComboBoxRenderer.cs
- CryptoProvider.cs
- LocationUpdates.cs
- SynchronizationValidator.cs
- MetaTableHelper.cs
- CacheMode.cs
- MissingSatelliteAssemblyException.cs
- VisualTarget.cs
- WsatConfiguration.cs
- AppDomainProtocolHandler.cs
- Function.cs
- OleDbReferenceCollection.cs
- ConfigurationValue.cs
- ResponseBodyWriter.cs
- DataListItemEventArgs.cs
- TreeViewBindingsEditorForm.cs
- DbException.cs
- CounterCreationData.cs
- VisualBasicValue.cs
- DbConnectionStringBuilder.cs
- DataGridViewCellMouseEventArgs.cs
- CallbackHandler.cs
- ServiceDescriptionImporter.cs
- TableItemProviderWrapper.cs
- CultureData.cs
- SQLInt32.cs
- ColorContext.cs
- ListViewHitTestInfo.cs
- BaseParser.cs
- SqlUserDefinedTypeAttribute.cs
- EntitySqlQueryCacheKey.cs
- Command.cs
- httpapplicationstate.cs
- PackUriHelper.cs
- IdentityNotMappedException.cs
- UTF7Encoding.cs
- BitmapPalettes.cs
- BindingNavigator.cs
- PolicyAssertionCollection.cs
- TdsRecordBufferSetter.cs
- XmlWellformedWriterHelpers.cs
- Parameter.cs
- FileRecordSequenceHelper.cs
- UidManager.cs
- XmlReturnReader.cs
- SystemThemeKey.cs
- SqlConnectionHelper.cs
- LogRestartAreaEnumerator.cs
- ChooseAction.cs
- CompoundFileStreamReference.cs
- HierarchicalDataBoundControl.cs
- RewritingPass.cs
- ScriptManager.cs
- ObjectIDGenerator.cs
- LostFocusEventManager.cs
- XmlSchemaObjectCollection.cs
- Utilities.cs
- XPathArrayIterator.cs
- FormsAuthenticationUserCollection.cs
- LinearKeyFrames.cs
- WorkerRequest.cs
- ControlCodeDomSerializer.cs
- XmlSchemaComplexContentExtension.cs
- RelationshipConverter.cs
- CodeAttributeDeclarationCollection.cs
- DesignerActionItem.cs
- HttpResponseHeader.cs
- SurrogateSelector.cs
- CheckBoxBaseAdapter.cs
- TypeSemantics.cs
- ConfigXmlElement.cs
- ContentOperations.cs
- documentation.cs
- CompositeDataBoundControl.cs