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
- HttpBrowserCapabilitiesWrapper.cs
- WindowsBrush.cs
- IndividualDeviceConfig.cs
- ObjectQuery.cs
- EventManager.cs
- HexParser.cs
- PreservationFileReader.cs
- CodeConditionStatement.cs
- TableLayoutPanel.cs
- AudioException.cs
- StartUpEventArgs.cs
- PixelFormatConverter.cs
- DelegatingTypeDescriptionProvider.cs
- HMACSHA256.cs
- StatusBarPanelClickEvent.cs
- ObjectNotFoundException.cs
- SqlTypeConverter.cs
- BamlTreeMap.cs
- ImageListUtils.cs
- BitmapCacheBrush.cs
- HttpPostedFile.cs
- DefaultDialogButtons.cs
- SQLInt16.cs
- FileClassifier.cs
- DataQuery.cs
- ReferencedCategoriesDocument.cs
- MonthChangedEventArgs.cs
- IPAddress.cs
- BitmapImage.cs
- ToolStripManager.cs
- XamlStyleSerializer.cs
- UnsafeNativeMethodsPenimc.cs
- IOThreadTimer.cs
- CurrentChangingEventManager.cs
- EditorPart.cs
- RIPEMD160Managed.cs
- X509ChainElement.cs
- DbMetaDataColumnNames.cs
- MsmqSecureHashAlgorithm.cs
- MultiAsyncResult.cs
- ComponentConverter.cs
- ChangePassword.cs
- SqlBooleanizer.cs
- HandlerBase.cs
- TaskScheduler.cs
- SpeechRecognitionEngine.cs
- ErrorStyle.cs
- BamlVersionHeader.cs
- SQLInt64.cs
- RtType.cs
- PartDesigner.cs
- IdentitySection.cs
- TextParagraph.cs
- PassportAuthenticationModule.cs
- SafeNativeMethods.cs
- CutCopyPasteHelper.cs
- DebugInfoExpression.cs
- SoapObjectWriter.cs
- GridViewCancelEditEventArgs.cs
- IndicShape.cs
- TableCellCollection.cs
- RemoteWebConfigurationHostStream.cs
- SqlColumnizer.cs
- UserControlParser.cs
- RunWorkerCompletedEventArgs.cs
- RbTree.cs
- CustomAttribute.cs
- EntryWrittenEventArgs.cs
- TextParaClient.cs
- DescendentsWalkerBase.cs
- HexParser.cs
- IssuedTokenParametersEndpointAddressElement.cs
- WebSysDisplayNameAttribute.cs
- GeometryGroup.cs
- DataFormats.cs
- NetworkCredential.cs
- TableParagraph.cs
- IRCollection.cs
- FixUpCollection.cs
- LocalClientSecuritySettings.cs
- RootDesignerSerializerAttribute.cs
- KeyGestureValueSerializer.cs
- SectionUpdates.cs
- FeatureSupport.cs
- AndCondition.cs
- ApplicationId.cs
- XPathCompileException.cs
- ReflectPropertyDescriptor.cs
- ProtocolImporter.cs
- PbrsForward.cs
- FontSourceCollection.cs
- Touch.cs
- PropertyValueUIItem.cs
- FixedSOMPage.cs
- DispatchWrapper.cs
- ClientConfigurationSystem.cs
- SQLConvert.cs
- TraceInternal.cs
- ContainerSelectorBehavior.cs
- DoubleLinkList.cs