Code:
/ DotNET / DotNET / 8.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
- PartBasedPackageProperties.cs
- ShaderEffect.cs
- PositiveTimeSpanValidatorAttribute.cs
- TextSegment.cs
- Timeline.cs
- CollectionViewGroupInternal.cs
- TextSearch.cs
- SqlStream.cs
- SubMenuStyle.cs
- CLRBindingWorker.cs
- MatrixValueSerializer.cs
- DataControlButton.cs
- SoapRpcMethodAttribute.cs
- DataBoundLiteralControl.cs
- FocusTracker.cs
- QueryExecutionOption.cs
- IDictionary.cs
- XhtmlBasicLabelAdapter.cs
- ShaderEffect.cs
- ListBoxChrome.cs
- GeneralTransformGroup.cs
- TaskForm.cs
- TextParagraph.cs
- ICollection.cs
- BackoffTimeoutHelper.cs
- QueryStringParameter.cs
- PrimitiveXmlSerializers.cs
- WinEventQueueItem.cs
- IsolatedStorageFilePermission.cs
- ListDictionaryInternal.cs
- FullTextLine.cs
- HScrollProperties.cs
- SoapMessage.cs
- wgx_render.cs
- WebPartDisplayModeCancelEventArgs.cs
- PropertyEmitterBase.cs
- Context.cs
- FontUnitConverter.cs
- PropertyTabChangedEvent.cs
- ContentIterators.cs
- ListDictionary.cs
- LabelAutomationPeer.cs
- Array.cs
- CompoundFileDeflateTransform.cs
- NativeMethods.cs
- Nodes.cs
- ResourceCategoryAttribute.cs
- DispatcherFrame.cs
- PathSegment.cs
- ClockController.cs
- UrlMappingsSection.cs
- ListBoxChrome.cs
- TextCharacters.cs
- DataSourceNameHandler.cs
- DPCustomTypeDescriptor.cs
- ImageListUtils.cs
- EntityParameterCollection.cs
- ActionMessageFilterTable.cs
- ReferentialConstraint.cs
- ReflectionUtil.cs
- DataServiceHost.cs
- HttpApplicationFactory.cs
- ResetableIterator.cs
- IndexerNameAttribute.cs
- DataServiceProviderMethods.cs
- figurelengthconverter.cs
- NeutralResourcesLanguageAttribute.cs
- MethodRental.cs
- RootBuilder.cs
- CommentEmitter.cs
- SqlFormatter.cs
- Pens.cs
- XmlCodeExporter.cs
- OrderedDictionary.cs
- CheckBoxRenderer.cs
- HttpApplication.cs
- DocumentXPathNavigator.cs
- SecurityImpersonationBehavior.cs
- mediaclock.cs
- DataViewManager.cs
- CodeDefaultValueExpression.cs
- StructuralCache.cs
- EffectiveValueEntry.cs
- LowerCaseStringConverter.cs
- ConnectionsZoneAutoFormat.cs
- SystemFonts.cs
- PropertyGridCommands.cs
- HttpCapabilitiesBase.cs
- Converter.cs
- OrderedDictionary.cs
- DataGridViewRowCollection.cs
- BindStream.cs
- Label.cs
- PrintDialog.cs
- ModelItemDictionary.cs
- Preprocessor.cs
- DirectoryLocalQuery.cs
- ParameterCollection.cs
- TextDecoration.cs
- ServiceEndpointCollection.cs