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
- UInt16Converter.cs
- ViewEventArgs.cs
- FixedSOMImage.cs
- ResourceWriter.cs
- SchemaLookupTable.cs
- EncoderFallback.cs
- StateMachine.cs
- RequestDescription.cs
- MembershipPasswordException.cs
- WebPartZoneBase.cs
- HtmlForm.cs
- UIElement.cs
- ConnectionsZoneAutoFormat.cs
- FormatException.cs
- KeyTimeConverter.cs
- VirtualPathUtility.cs
- ContentPosition.cs
- XmlBinaryReader.cs
- Viewport3DAutomationPeer.cs
- MarkupObject.cs
- FindProgressChangedEventArgs.cs
- CircleEase.cs
- ApplicationSettingsBase.cs
- XmlElementCollection.cs
- AssemblyHash.cs
- UiaCoreTypesApi.cs
- ElementMarkupObject.cs
- LocatorPart.cs
- ChangeTracker.cs
- ButtonBaseDesigner.cs
- CodeDelegateCreateExpression.cs
- PageAsyncTaskManager.cs
- SizeAnimation.cs
- HttpApplicationStateBase.cs
- CodeAttributeDeclarationCollection.cs
- EventHandlerList.cs
- Transform.cs
- WS2007HttpBindingCollectionElement.cs
- RawStylusSystemGestureInputReport.cs
- StringArrayEditor.cs
- OracleBFile.cs
- Menu.cs
- WebPartDisplayModeCollection.cs
- TextTreeObjectNode.cs
- XmlSerializerAssemblyAttribute.cs
- NamespaceList.cs
- PeerSecurityManager.cs
- FixedStringLookup.cs
- RefExpr.cs
- TypeForwardedToAttribute.cs
- ObjectListDataBindEventArgs.cs
- RbTree.cs
- TriggerBase.cs
- PerformanceCountersElement.cs
- PolyBezierSegment.cs
- XmlDictionary.cs
- QuaternionConverter.cs
- baseshape.cs
- HttpRawResponse.cs
- CodeObjectCreateExpression.cs
- EncodingTable.cs
- ComponentChangingEvent.cs
- CodeNamespaceCollection.cs
- WaitHandle.cs
- CacheMode.cs
- RelationshipConstraintValidator.cs
- DataTableReader.cs
- KnownTypesProvider.cs
- ToolStripContentPanelRenderEventArgs.cs
- BasePattern.cs
- CommandBinding.cs
- StorageTypeMapping.cs
- GlyphsSerializer.cs
- ProjectionPruner.cs
- OperationCanceledException.cs
- DropShadowEffect.cs
- TableRowGroup.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- XmlEncoding.cs
- HttpCookie.cs
- linebase.cs
- OpenFileDialog.cs
- BuildProviderCollection.cs
- SharedPersonalizationStateInfo.cs
- TextBoxBase.cs
- LineBreak.cs
- ScriptServiceAttribute.cs
- TypeInfo.cs
- WorkflowExecutor.cs
- ReliableMessagingVersion.cs
- SqlMethodAttribute.cs
- ModulesEntry.cs
- CalendarButton.cs
- SafeCoTaskMem.cs
- InstalledFontCollection.cs
- PrePostDescendentsWalker.cs
- RotateTransform3D.cs
- MemberHolder.cs
- PauseStoryboard.cs
- PlainXmlWriter.cs