Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / HyperLinkDesigner.cs / 1 / HyperLinkDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System; using System.Web.UI.WebControls; using Microsoft.Win32; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] [SupportsPreviewControl(true)] public class HyperLinkDesigner : TextControlDesigner { ////// The designer for the ////// web control. /// /// /// public override string GetDesignTimeHtml() { HyperLink h = (HyperLink)Component; string originalText = h.Text; string imageUrl = h.ImageUrl; string originalUrl = h.NavigateUrl; Debug.Assert(originalText != null); Debug.Assert(imageUrl != null); Debug.Assert(originalUrl != null); bool blankText = (originalText.Trim().Length == 0) && (imageUrl.Trim().Length == 0); bool blankUrl = (originalUrl.Trim().Length == 0); bool hasControls = h.HasControls(); Control[] children = null; if (blankText) { if (hasControls) { children = new Control[h.Controls.Count]; h.Controls.CopyTo(children, 0); } h.Text = "[" + h.ID + "]"; } if (blankUrl) { h.NavigateUrl = "url"; } string html; try { html = base.GetDesignTimeHtml(); } finally { if (blankText) { h.Text = originalText; if (hasControls) { foreach (Control c in children) { h.Controls.Add(c); } } } if (blankUrl) { h.NavigateUrl = originalUrl; } } return html; } public override void OnComponentChanged(object sender, ComponentChangedEventArgs ce) { base.OnComponentChanged(sender, new ComponentChangedEventArgs(ce.Component, null, null, null)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved./// Gets the design time HTML of the ////// control. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RemotingServices.cs
- ModuleConfigurationInfo.cs
- ArraySegment.cs
- BrowserCapabilitiesFactory.cs
- DoubleKeyFrameCollection.cs
- StylusPointPropertyId.cs
- ImpersonationContext.cs
- ResourceDescriptionAttribute.cs
- SqlCachedBuffer.cs
- CatalogPart.cs
- WinFormsComponentEditor.cs
- WebResponse.cs
- DataRow.cs
- MdImport.cs
- ModifiableIteratorCollection.cs
- FileDetails.cs
- CallbackTimeoutsBehavior.cs
- SqlCacheDependencySection.cs
- IISUnsafeMethods.cs
- DynamicUpdateCommand.cs
- SiteMapPath.cs
- HwndProxyElementProvider.cs
- BitmapFrame.cs
- VirtualizingPanel.cs
- TraceHandler.cs
- OTFRasterizer.cs
- IpcManager.cs
- QueryTask.cs
- WebPartVerbsEventArgs.cs
- TcpClientChannel.cs
- X509CertificateInitiatorClientCredential.cs
- TreeNodeSelectionProcessor.cs
- Invariant.cs
- ThaiBuddhistCalendar.cs
- StandardCommands.cs
- XmlSchemaGroup.cs
- BaseDataList.cs
- XmlConvert.cs
- PictureBox.cs
- TrackingProfileManager.cs
- HtmlFormWrapper.cs
- Main.cs
- RegexCompilationInfo.cs
- AmbientLight.cs
- PcmConverter.cs
- ReaderContextStackData.cs
- CodeSnippetCompileUnit.cs
- ExpressionBuilderContext.cs
- NativeMethods.cs
- UshortList2.cs
- MimeTypePropertyAttribute.cs
- PhoneCall.cs
- CodeIterationStatement.cs
- ReferenceCountedObject.cs
- DesignerCategoryAttribute.cs
- ChannelFactory.cs
- PathFigureCollectionValueSerializer.cs
- CurrentTimeZone.cs
- ConnectionProviderAttribute.cs
- SqlOuterApplyReducer.cs
- odbcmetadatacollectionnames.cs
- AddInController.cs
- DataGridViewRowPostPaintEventArgs.cs
- ObjectDataSourceSelectingEventArgs.cs
- UriExt.cs
- Bitmap.cs
- RealizationContext.cs
- StopRoutingHandler.cs
- WebPartsSection.cs
- SqlDataSourceStatusEventArgs.cs
- SignerInfo.cs
- ControlPager.cs
- SqlNamer.cs
- DescriptionAttribute.cs
- ProvidersHelper.cs
- TiffBitmapDecoder.cs
- odbcmetadatacolumnnames.cs
- BlobPersonalizationState.cs
- AsnEncodedData.cs
- KeyFrames.cs
- ReferencedAssembly.cs
- tabpagecollectioneditor.cs
- LayoutExceptionEventArgs.cs
- FrameworkPropertyMetadata.cs
- Journaling.cs
- DragDeltaEventArgs.cs
- EndPoint.cs
- DependencyPropertyChangedEventArgs.cs
- ParallelTimeline.cs
- HasCopySemanticsAttribute.cs
- ErrorTableItemStyle.cs
- SuppressMergeCheckAttribute.cs
- MobileCategoryAttribute.cs
- ListItemCollection.cs
- ToolStripRenderEventArgs.cs
- StateChangeEvent.cs
- BitmapCodecInfo.cs
- Range.cs
- SafeFindHandle.cs
- CqlParser.cs