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
- MetafileHeaderWmf.cs
- PrivacyNoticeBindingElement.cs
- MarkerProperties.cs
- XsltOutput.cs
- TypefaceMetricsCache.cs
- HandleRef.cs
- Tile.cs
- ChtmlTextWriter.cs
- ContentPathSegment.cs
- TextTreeUndo.cs
- ServiceReference.cs
- ClockGroup.cs
- Vector3DValueSerializer.cs
- LingerOption.cs
- InternalMappingException.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- PersistChildrenAttribute.cs
- SafeTokenHandle.cs
- WorkflowClientDeliverMessageWrapper.cs
- UIElement.cs
- SerializationStore.cs
- ListControlConvertEventArgs.cs
- CodeSnippetTypeMember.cs
- DispatchChannelSink.cs
- FixedDocumentPaginator.cs
- DirtyTextRange.cs
- OptimizedTemplateContentHelper.cs
- BitmapPalettes.cs
- DayRenderEvent.cs
- GeneralTransformGroup.cs
- Color.cs
- EventTrigger.cs
- WebZone.cs
- CodeTypeConstructor.cs
- contentDescriptor.cs
- CalendarTable.cs
- LineServicesRun.cs
- NavigationEventArgs.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- MdImport.cs
- InvalidateEvent.cs
- DockPatternIdentifiers.cs
- SqlClientMetaDataCollectionNames.cs
- SQLInt64.cs
- MissingSatelliteAssemblyException.cs
- NTAccount.cs
- EntityClassGenerator.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- WebProxyScriptElement.cs
- SqlConnectionHelper.cs
- CodeMethodInvokeExpression.cs
- PropertyStore.cs
- DependencyProperty.cs
- FormViewUpdatedEventArgs.cs
- CodeLabeledStatement.cs
- PageAdapter.cs
- Attributes.cs
- SchemaObjectWriter.cs
- AnimationTimeline.cs
- XpsDigitalSignature.cs
- InvalidOperationException.cs
- Math.cs
- SiteMapDataSourceView.cs
- ToolStripPanel.cs
- SurrogateSelector.cs
- Part.cs
- DataTemplateSelector.cs
- SqlNotificationEventArgs.cs
- AspNetSynchronizationContext.cs
- CipherData.cs
- SafeBuffer.cs
- XmlElement.cs
- ToolStripLocationCancelEventArgs.cs
- _ConnectStream.cs
- OdbcConnection.cs
- WebPartEditorCancelVerb.cs
- DrawingGroup.cs
- AppDomainAttributes.cs
- TypeUsageBuilder.cs
- TimeoutTimer.cs
- DataControlFieldTypeEditor.cs
- CollectionContainer.cs
- CodeArrayIndexerExpression.cs
- WebBrowser.cs
- DataBindingList.cs
- Publisher.cs
- RectAnimationUsingKeyFrames.cs
- ToolStripOverflowButton.cs
- Panel.cs
- AnonymousIdentificationModule.cs
- DataGridViewRowConverter.cs
- ValidationRule.cs
- StrokeRenderer.cs
- XmlSerializer.cs
- TextTreeObjectNode.cs
- RedBlackList.cs
- DbException.cs
- CallTemplateAction.cs
- GlobalEventManager.cs
- FunctionImportMapping.cs