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
- SQLDecimalStorage.cs
- SafeArrayRankMismatchException.cs
- BitmapEncoder.cs
- JapaneseLunisolarCalendar.cs
- NamespaceInfo.cs
- SEHException.cs
- HtmlControlDesigner.cs
- PersonalizationProviderCollection.cs
- FontInfo.cs
- ValidateNames.cs
- RandomNumberGenerator.cs
- MatrixAnimationBase.cs
- MsmqAppDomainProtocolHandler.cs
- X509Logo.cs
- BindingCompleteEventArgs.cs
- DataGridViewCheckBoxColumn.cs
- TraceContext.cs
- CommandDevice.cs
- Keywords.cs
- XmlIncludeAttribute.cs
- DefaultEventAttribute.cs
- CorruptingExceptionCommon.cs
- FeatureSupport.cs
- AnnotationDocumentPaginator.cs
- COM2ComponentEditor.cs
- SqlInternalConnectionSmi.cs
- FontNamesConverter.cs
- DataGridAddNewRow.cs
- BaseCAMarshaler.cs
- TraceEventCache.cs
- ZoomingMessageFilter.cs
- WebServicesDescriptionAttribute.cs
- NamespaceTable.cs
- UnsafeNetInfoNativeMethods.cs
- SqlUserDefinedTypeAttribute.cs
- UserPreferenceChangingEventArgs.cs
- SoapReflectionImporter.cs
- GeometryGroup.cs
- HandleRef.cs
- DataBoundControl.cs
- StatusBarDesigner.cs
- SqlWorkflowInstanceStore.cs
- HandlerFactoryCache.cs
- ColorConvertedBitmap.cs
- MetadataPropertyAttribute.cs
- SHA256CryptoServiceProvider.cs
- Token.cs
- ChangeConflicts.cs
- TextServicesContext.cs
- ObjectFullSpanRewriter.cs
- UriTemplateQueryValue.cs
- WebPartsSection.cs
- WebMessageEncodingElement.cs
- TemplatePropertyEntry.cs
- Color.cs
- MsmqIntegrationMessagePool.cs
- XDRSchema.cs
- CssClassPropertyAttribute.cs
- SqlClientFactory.cs
- AdapterUtil.cs
- Scanner.cs
- Triplet.cs
- ScrollBar.cs
- DotNetATv1WindowsLogEntrySerializer.cs
- RunWorkerCompletedEventArgs.cs
- StorageMappingFragment.cs
- BaseDataBoundControl.cs
- NameObjectCollectionBase.cs
- ValidationError.cs
- GeneralTransformGroup.cs
- ControlBuilderAttribute.cs
- NamespaceMapping.cs
- RenderCapability.cs
- GetPageCompletedEventArgs.cs
- StandardBindingCollectionElement.cs
- TagPrefixInfo.cs
- TextSelectionProcessor.cs
- ToolStripArrowRenderEventArgs.cs
- TypeNameHelper.cs
- ThreadExceptionEvent.cs
- ValueOfAction.cs
- EncoderExceptionFallback.cs
- Type.cs
- HtmlInputCheckBox.cs
- DesignerTransactionCloseEvent.cs
- ComboBoxItem.cs
- HttpPostServerProtocol.cs
- MetabaseReader.cs
- ArrayWithOffset.cs
- WebSysDisplayNameAttribute.cs
- TextRange.cs
- ISAPIRuntime.cs
- TransformGroup.cs
- QilInvokeEarlyBound.cs
- IteratorFilter.cs
- WebBrowserContainer.cs
- CallbackTimeoutsBehavior.cs
- ping.cs
- DecimalStorage.cs
- XomlSerializationHelpers.cs