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
- InheritanceContextHelper.cs
- MachineKeyConverter.cs
- QueryParameter.cs
- XPathMultyIterator.cs
- MetaModel.cs
- objectquery_tresulttype.cs
- SqlCommand.cs
- StylusEditingBehavior.cs
- DataGridColumnsPage.cs
- SqlErrorCollection.cs
- SliderAutomationPeer.cs
- TabControlCancelEvent.cs
- TableDesigner.cs
- nulltextcontainer.cs
- RemotingConfiguration.cs
- URLIdentityPermission.cs
- AppLevelCompilationSectionCache.cs
- ProxyWebPartManager.cs
- EncoderParameters.cs
- EntityCommandCompilationException.cs
- SingleAnimationBase.cs
- Converter.cs
- IisTraceWebEventProvider.cs
- TraceData.cs
- WriteTimeStream.cs
- ContractDescription.cs
- DrawingContext.cs
- TimelineCollection.cs
- AVElementHelper.cs
- SqlReferenceCollection.cs
- Path.cs
- EntityContainer.cs
- ConfigXmlText.cs
- ValueChangedEventManager.cs
- IdleTimeoutMonitor.cs
- InfoCardClaimCollection.cs
- SplitterPanel.cs
- CodeVariableReferenceExpression.cs
- DelegateTypeInfo.cs
- DialogWindow.cs
- ListViewPagedDataSource.cs
- StylusCollection.cs
- DuplicateMessageDetector.cs
- dtdvalidator.cs
- MimeFormatter.cs
- LogicalExpr.cs
- ColorTranslator.cs
- SmtpTransport.cs
- DataGridViewComboBoxColumn.cs
- ElapsedEventArgs.cs
- DllNotFoundException.cs
- ContextMenuStripActionList.cs
- LinqToSqlWrapper.cs
- PropertyEmitterBase.cs
- CodeDomLocalizationProvider.cs
- GetPageNumberCompletedEventArgs.cs
- ModifierKeysConverter.cs
- MethodExpr.cs
- SqlNotificationRequest.cs
- SoapDocumentMethodAttribute.cs
- SchemaElementDecl.cs
- Point4DConverter.cs
- ServiceNameElementCollection.cs
- TextDecorationUnitValidation.cs
- SystemColorTracker.cs
- Point3D.cs
- RemoteTokenFactory.cs
- DbFunctionCommandTree.cs
- NestPullup.cs
- ArgumentNullException.cs
- GridViewDeleteEventArgs.cs
- TextContainerChangedEventArgs.cs
- PingReply.cs
- VisualStyleTypesAndProperties.cs
- SoapServerMessage.cs
- ScrollBarAutomationPeer.cs
- URI.cs
- CompressStream.cs
- HtmlInputSubmit.cs
- UserNameSecurityTokenAuthenticator.cs
- EventDescriptorCollection.cs
- XamlClipboardData.cs
- ResolveNameEventArgs.cs
- DataSvcMapFileSerializer.cs
- CharAnimationUsingKeyFrames.cs
- DateRangeEvent.cs
- ADMembershipUser.cs
- TextServicesProperty.cs
- RightsController.cs
- LoadRetryAsyncResult.cs
- DrawingAttributesDefaultValueFactory.cs
- Symbol.cs
- HandlerWithFactory.cs
- ListCommandEventArgs.cs
- SqlParameter.cs
- TypeLibConverter.cs
- BlurBitmapEffect.cs
- MsmqInputMessage.cs
- GenericUI.cs
- ConsoleKeyInfo.cs