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
- ProcessProtocolHandler.cs
- VectorAnimation.cs
- OperationCanceledException.cs
- BindingNavigator.cs
- ToolStripMenuItemCodeDomSerializer.cs
- WindowsAuthenticationModule.cs
- ResourcesChangeInfo.cs
- BrowserCapabilitiesFactory.cs
- EmissiveMaterial.cs
- ToolstripProfessionalRenderer.cs
- OleDbRowUpdatingEvent.cs
- FacetEnabledSchemaElement.cs
- ModulesEntry.cs
- InfoCardClaimCollection.cs
- TemplatedMailWebEventProvider.cs
- DBDataPermissionAttribute.cs
- KnownTypes.cs
- ConnectionOrientedTransportChannelListener.cs
- WorkflowCompensationBehavior.cs
- HttpDebugHandler.cs
- RequestSecurityTokenResponse.cs
- NullableBoolConverter.cs
- ListViewHitTestInfo.cs
- CqlBlock.cs
- SmtpClient.cs
- XamlWriter.cs
- XmlConvert.cs
- AvTraceFormat.cs
- DebuggerAttributes.cs
- WpfSharedXamlSchemaContext.cs
- BinaryReader.cs
- DateRangeEvent.cs
- MouseDevice.cs
- SystemIPAddressInformation.cs
- ValidatorAttribute.cs
- SoapSchemaImporter.cs
- ConstraintManager.cs
- AssertFilter.cs
- SQLBytesStorage.cs
- PingReply.cs
- GridViewUpdatedEventArgs.cs
- PageAsyncTask.cs
- DropShadowBitmapEffect.cs
- SecureUICommand.cs
- StreamSecurityUpgradeProvider.cs
- SqlDuplicator.cs
- CellParaClient.cs
- ContainerFilterService.cs
- TraceXPathNavigator.cs
- PropertyChangeTracker.cs
- SetterTriggerConditionValueConverter.cs
- DesignerDataView.cs
- PathFigureCollectionConverter.cs
- DictionaryItemsCollection.cs
- TransactedBatchContext.cs
- TreeViewDesigner.cs
- CheckedPointers.cs
- EventMappingSettingsCollection.cs
- XmlValueConverter.cs
- _OSSOCK.cs
- XmlSigningNodeWriter.cs
- DataServiceQueryOfT.cs
- ExpressionVisitorHelpers.cs
- ObjectContextServiceProvider.cs
- WindowsSecurityTokenAuthenticator.cs
- ProfileGroupSettingsCollection.cs
- SymmetricKey.cs
- CrossContextChannel.cs
- OdbcPermission.cs
- RawStylusSystemGestureInputReport.cs
- CommonGetThemePartSize.cs
- TemplateParser.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SiteMapDataSourceDesigner.cs
- ReadWriteObjectLock.cs
- XmlNotation.cs
- _RequestCacheProtocol.cs
- Constraint.cs
- TypeNameConverter.cs
- DataGridViewColumnConverter.cs
- ToolStripManager.cs
- UInt32Converter.cs
- NamedObject.cs
- ChannelManager.cs
- Msec.cs
- CookieHandler.cs
- ScrollChangedEventArgs.cs
- XmlProcessingInstruction.cs
- RemotingConfiguration.cs
- SchemaContext.cs
- WebBaseEventKeyComparer.cs
- WriterOutput.cs
- DebugViewWriter.cs
- WeakHashtable.cs
- DataBindingCollectionEditor.cs
- ImportCatalogPart.cs
- ProxyGenerationError.cs
- ToolStripDropDown.cs
- HttpConfigurationSystem.cs
- DerivedKeySecurityTokenStub.cs