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
- MonthChangedEventArgs.cs
- recordstate.cs
- Point3DIndependentAnimationStorage.cs
- SecurityTokenResolver.cs
- InvokeGenerator.cs
- AspCompat.cs
- ContainerControl.cs
- HttpPostServerProtocol.cs
- ItemsPanelTemplate.cs
- EventSinkActivity.cs
- Array.cs
- PTProvider.cs
- Sentence.cs
- Subtree.cs
- LongValidator.cs
- TrustLevelCollection.cs
- EditorZoneDesigner.cs
- CqlLexerHelpers.cs
- MappingItemCollection.cs
- ProxyGenerator.cs
- Scene3D.cs
- XmlAttributeCollection.cs
- _Rfc2616CacheValidators.cs
- CharAnimationUsingKeyFrames.cs
- XamlTypeMapperSchemaContext.cs
- BulletDecorator.cs
- AudienceUriMode.cs
- StringKeyFrameCollection.cs
- Figure.cs
- BaseComponentEditor.cs
- DataControlPagerLinkButton.cs
- _DomainName.cs
- StylusPoint.cs
- NonClientArea.cs
- HttpServerVarsCollection.cs
- SettingsSection.cs
- QuadraticBezierSegment.cs
- RuleInfoComparer.cs
- ObjRef.cs
- ObjectAssociationEndMapping.cs
- StylusOverProperty.cs
- DebugView.cs
- OdbcError.cs
- WindowsProgressbar.cs
- TextSelectionProcessor.cs
- xmlformatgeneratorstatics.cs
- ITextView.cs
- SubstitutionList.cs
- RepeatInfo.cs
- DataGridViewRowCancelEventArgs.cs
- recordstatescratchpad.cs
- MarkupCompiler.cs
- DependencyObject.cs
- BuilderElements.cs
- WebControlAdapter.cs
- DataReceivedEventArgs.cs
- SafeNativeMethods.cs
- CodeDomConfigurationHandler.cs
- mediaeventshelper.cs
- MissingMemberException.cs
- SiteMapPath.cs
- ManagementPath.cs
- XamlStyleSerializer.cs
- InkCanvas.cs
- InkCanvasFeedbackAdorner.cs
- UnmanagedMemoryStream.cs
- CustomWebEventKey.cs
- WebPartUtil.cs
- MetadataArtifactLoaderResource.cs
- PageVisual.cs
- Int64Storage.cs
- WebProxyScriptElement.cs
- ServiceSecurityContext.cs
- TreeIterator.cs
- LabelLiteral.cs
- XmlElementAttribute.cs
- ContractMapping.cs
- ParameterReplacerVisitor.cs
- HtmlTernaryTree.cs
- ScrollBarAutomationPeer.cs
- PassportAuthenticationModule.cs
- WindowsToolbarAsMenu.cs
- DropAnimation.xaml.cs
- EntityDataSourceConfigureObjectContext.cs
- AnonymousIdentificationSection.cs
- AsymmetricCryptoHandle.cs
- SmiContext.cs
- FixedPageAutomationPeer.cs
- sitestring.cs
- DataGridViewCellFormattingEventArgs.cs
- DataGridViewBand.cs
- ExclusiveHandle.cs
- TextStore.cs
- DEREncoding.cs
- DtrList.cs
- ImageMapEventArgs.cs
- RSATokenProvider.cs
- RepeatButton.cs
- DecodeHelper.cs
- BitmapMetadataBlob.cs