Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Adapters / WmlImageAdapter.cs / 1305376 / WmlImageAdapter.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Security.Permissions;
#if COMPILING_FOR_SHIPPED_SOURCE
namespace System.Web.UI.MobileControls.ShippedAdapterSource
#else
namespace System.Web.UI.MobileControls.Adapters
#endif
{
/*
* WmlImageAdapter class.
*/
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public class WmlImageAdapter : WmlControlAdapter
{
///
protected new Image Control
{
get
{
return (Image)base.Control;
}
}
///
public override void Render(WmlMobileTextWriter writer)
{
String source = Control.ImageUrl;
String target = Control.NavigateUrl;
String text = Control.AlternateText;
bool breakAfterContents = Control.BreakAfter;
String softkeyLabel = Control.SoftkeyLabel;
bool implicitSoftkeyLabel = false;
if (softkeyLabel.Length == 0)
{
implicitSoftkeyLabel = true;
softkeyLabel = text;
}
writer.EnterLayout(Style);
if (!String.IsNullOrEmpty(target))
{
RenderBeginLink(writer, target, softkeyLabel, implicitSoftkeyLabel, true);
breakAfterContents = false;
}
if (String.IsNullOrEmpty(source))
{
// Just write the alternate as text
writer.RenderText(text, breakAfterContents);
}
else
{
String localSource;
if (source.StartsWith(Constants.SymbolProtocol, StringComparison.Ordinal))
{
// src is required according to WML
localSource = source.Substring(Constants.SymbolProtocol.Length);
source = String.Empty;
}
else
{
localSource = null;
// AUI 3652
source = Control.ResolveUrl(source);
writer.AddResource(source);
}
writer.RenderImage(source, localSource, text, breakAfterContents);
}
if (!String.IsNullOrEmpty(target))
{
RenderEndLink(writer, target, Control.BreakAfter);
}
writer.ExitLayout(Style);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Security.Permissions;
#if COMPILING_FOR_SHIPPED_SOURCE
namespace System.Web.UI.MobileControls.ShippedAdapterSource
#else
namespace System.Web.UI.MobileControls.Adapters
#endif
{
/*
* WmlImageAdapter class.
*/
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public class WmlImageAdapter : WmlControlAdapter
{
///
protected new Image Control
{
get
{
return (Image)base.Control;
}
}
///
public override void Render(WmlMobileTextWriter writer)
{
String source = Control.ImageUrl;
String target = Control.NavigateUrl;
String text = Control.AlternateText;
bool breakAfterContents = Control.BreakAfter;
String softkeyLabel = Control.SoftkeyLabel;
bool implicitSoftkeyLabel = false;
if (softkeyLabel.Length == 0)
{
implicitSoftkeyLabel = true;
softkeyLabel = text;
}
writer.EnterLayout(Style);
if (!String.IsNullOrEmpty(target))
{
RenderBeginLink(writer, target, softkeyLabel, implicitSoftkeyLabel, true);
breakAfterContents = false;
}
if (String.IsNullOrEmpty(source))
{
// Just write the alternate as text
writer.RenderText(text, breakAfterContents);
}
else
{
String localSource;
if (source.StartsWith(Constants.SymbolProtocol, StringComparison.Ordinal))
{
// src is required according to WML
localSource = source.Substring(Constants.SymbolProtocol.Length);
source = String.Empty;
}
else
{
localSource = null;
// AUI 3652
source = Control.ResolveUrl(source);
writer.AddResource(source);
}
writer.RenderImage(source, localSource, text, breakAfterContents);
}
if (!String.IsNullOrEmpty(target))
{
RenderEndLink(writer, target, Control.BreakAfter);
}
writer.ExitLayout(Style);
}
}
}
// 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
- MemoryPressure.cs
- XPathNavigator.cs
- CodeGenerator.cs
- CollectionContainer.cs
- EntityConnection.cs
- HMACRIPEMD160.cs
- SmiTypedGetterSetter.cs
- RtfToken.cs
- IndexerNameAttribute.cs
- SoapObjectReader.cs
- ImageCreator.cs
- FrameworkContentElement.cs
- HttpChannelBindingToken.cs
- XmlExpressionDumper.cs
- HuffModule.cs
- XmlnsDictionary.cs
- Accessible.cs
- EventMappingSettings.cs
- BinaryObjectInfo.cs
- XmlSecureResolver.cs
- LinqDataSource.cs
- Section.cs
- LocalBuilder.cs
- HyperLinkStyle.cs
- CheckedListBox.cs
- LinkedList.cs
- ListView.cs
- Screen.cs
- GetCertificateRequest.cs
- OracleColumn.cs
- shaperfactory.cs
- CodePropertyReferenceExpression.cs
- XPathNodePointer.cs
- TextViewBase.cs
- HwndTarget.cs
- PrePostDescendentsWalker.cs
- SyndicationContent.cs
- LookupNode.cs
- HtmlSelect.cs
- Rotation3DKeyFrameCollection.cs
- MaskedTextBoxTextEditorDropDown.cs
- EditingMode.cs
- SqlHelper.cs
- AccessViolationException.cs
- WebPartVerbCollection.cs
- BrowserTree.cs
- VSWCFServiceContractGenerator.cs
- DataGridViewImageCell.cs
- Vector3DCollectionValueSerializer.cs
- AuthenticationService.cs
- NeutralResourcesLanguageAttribute.cs
- dtdvalidator.cs
- CodeSnippetCompileUnit.cs
- BitmapEffectGroup.cs
- CommonXSendMessage.cs
- GenerateHelper.cs
- UserControl.cs
- DefaultPropertyAttribute.cs
- SoapInteropTypes.cs
- ListView.cs
- ApplicationInfo.cs
- StateMachineWorkflowDesigner.cs
- AlternationConverter.cs
- EntityStoreSchemaGenerator.cs
- NTAccount.cs
- MailMessage.cs
- Mouse.cs
- DataGridAutoFormat.cs
- HttpRuntime.cs
- PageContent.cs
- LostFocusEventManager.cs
- ScrollItemPatternIdentifiers.cs
- odbcmetadatacolumnnames.cs
- TypeSystemProvider.cs
- TextMarkerSource.cs
- PartManifestEntry.cs
- HttpRequestTraceRecord.cs
- AutomationAttributeInfo.cs
- SafeThreadHandle.cs
- SafeArrayTypeMismatchException.cs
- XmlSchemaSimpleContent.cs
- DbConnectionPoolGroupProviderInfo.cs
- ModulesEntry.cs
- WindowsButton.cs
- StrongNameMembershipCondition.cs
- latinshape.cs
- WebServiceErrorEvent.cs
- EdmEntityTypeAttribute.cs
- DrawingBrush.cs
- ListCollectionView.cs
- OleStrCAMarshaler.cs
- PrintDialog.cs
- DBProviderConfigurationHandler.cs
- pingexception.cs
- IgnoreDeviceFilterElement.cs
- SortedList.cs
- DataGridViewRowStateChangedEventArgs.cs
- SymmetricCryptoHandle.cs
- ComplexPropertyEntry.cs
- TextFormattingConverter.cs