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
- CopyOfAction.cs
- IisTraceWebEventProvider.cs
- WebHostUnsafeNativeMethods.cs
- ValuePattern.cs
- OracleConnectionFactory.cs
- TypeExtension.cs
- StylusPointPropertyInfo.cs
- NotifyInputEventArgs.cs
- ResourceReferenceExpressionConverter.cs
- AdornerDecorator.cs
- CacheDependency.cs
- LocalServiceSecuritySettingsElement.cs
- SymmetricAlgorithm.cs
- RoutedEventConverter.cs
- Boolean.cs
- _ShellExpression.cs
- BoundingRectTracker.cs
- RegexTree.cs
- _NestedSingleAsyncResult.cs
- AuthenticationSection.cs
- ActivityMetadata.cs
- SqlConnection.cs
- DbProviderManifest.cs
- ConstraintEnumerator.cs
- HtmlSelect.cs
- GridViewColumnCollectionChangedEventArgs.cs
- DependsOnAttribute.cs
- Binding.cs
- ThrowOnMultipleAssignment.cs
- SymLanguageVendor.cs
- TextShapeableCharacters.cs
- CommonEndpointBehaviorElement.cs
- OpenTypeLayoutCache.cs
- XmlDownloadManager.cs
- ConditionalAttribute.cs
- HMACSHA512.cs
- DataPagerFieldItem.cs
- ResourcePool.cs
- TreeNodeCollection.cs
- FileLogRecord.cs
- addressfiltermode.cs
- SessionParameter.cs
- DataGridToolTip.cs
- UnsafeNativeMethods.cs
- VisualStateManager.cs
- InstanceLockTracking.cs
- VarRemapper.cs
- TabletDeviceInfo.cs
- HttpCapabilitiesBase.cs
- EntityDataSourceStatementEditor.cs
- ResourceBinder.cs
- DefaultCommandConverter.cs
- DataGridRowsPresenter.cs
- ReadOnlyTernaryTree.cs
- VirtualizedItemProviderWrapper.cs
- IncrementalReadDecoders.cs
- FormsAuthenticationCredentials.cs
- RegisteredHiddenField.cs
- GridSplitterAutomationPeer.cs
- FixedDocumentPaginator.cs
- WrappedDispatcherException.cs
- AsyncPostBackTrigger.cs
- formatter.cs
- FormViewRow.cs
- WinEventQueueItem.cs
- ListViewGroupConverter.cs
- TextServicesHost.cs
- ListDictionary.cs
- CustomAttributeBuilder.cs
- SizeAnimationClockResource.cs
- EnumConverter.cs
- ConsoleKeyInfo.cs
- URLIdentityPermission.cs
- List.cs
- ToolStripContainer.cs
- BulletedList.cs
- PreservationFileWriter.cs
- FlowDecisionDesigner.xaml.cs
- columnmapfactory.cs
- FormattedText.cs
- TrackingMemoryStreamFactory.cs
- BoundField.cs
- HMACSHA256.cs
- ExtensibleClassFactory.cs
- Html32TextWriter.cs
- EventItfInfo.cs
- FormsAuthenticationUserCollection.cs
- FormViewPageEventArgs.cs
- PackageDigitalSignature.cs
- SqlBulkCopy.cs
- OleDbConnectionFactory.cs
- URLIdentityPermission.cs
- XmlSchemaElement.cs
- OutputCacheSettingsSection.cs
- AddressHeader.cs
- UnsafeMethods.cs
- DecoratedNameAttribute.cs
- ConnectionPoolManager.cs
- DiscoveryMessageSequence.cs
- ResourceDefaultValueAttribute.cs