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
- OrthographicCamera.cs
- DecoratedNameAttribute.cs
- Helper.cs
- BitVector32.cs
- CmsInterop.cs
- WebContext.cs
- ContainsRowNumberChecker.cs
- MembershipPasswordException.cs
- PresentationAppDomainManager.cs
- HyperLinkStyle.cs
- SendMailErrorEventArgs.cs
- MessagingActivityHelper.cs
- TreeViewEvent.cs
- StringToken.cs
- ScrollBarRenderer.cs
- SecureConversationServiceCredential.cs
- QueryStringHandler.cs
- MetaModel.cs
- AmbientEnvironment.cs
- Timer.cs
- AsyncResult.cs
- AssemblyName.cs
- TreeIterator.cs
- EventArgs.cs
- BaseValidator.cs
- Int16KeyFrameCollection.cs
- TargetException.cs
- ProcessHostMapPath.cs
- HttpListenerRequest.cs
- OdbcParameter.cs
- PathSegment.cs
- elementinformation.cs
- TargetFrameworkUtil.cs
- DesignerMetadata.cs
- PenLineCapValidation.cs
- PropertyTabChangedEvent.cs
- CustomAttributeSerializer.cs
- AddInController.cs
- SecurityCredentialsManager.cs
- AssemblyCollection.cs
- ToolZone.cs
- MaskedTextBox.cs
- SignatureGenerator.cs
- NamespaceTable.cs
- RegexCaptureCollection.cs
- TextStore.cs
- ComponentSerializationService.cs
- InnerItemCollectionView.cs
- InstanceDataCollectionCollection.cs
- OrderedEnumerableRowCollection.cs
- TypeDependencyAttribute.cs
- ControlType.cs
- CodeTypeReference.cs
- MimeMapping.cs
- DataObjectFieldAttribute.cs
- DataGridTableCollection.cs
- WebBrowserHelper.cs
- ScaleTransform3D.cs
- DataColumnChangeEvent.cs
- Object.cs
- CodeSnippetCompileUnit.cs
- Page.cs
- Attributes.cs
- URL.cs
- NonBatchDirectoryCompiler.cs
- LineProperties.cs
- Utils.cs
- Message.cs
- StorageRoot.cs
- JsonUriDataContract.cs
- ProfileSettings.cs
- CancelEventArgs.cs
- SmtpException.cs
- documentsequencetextcontainer.cs
- PageSettings.cs
- Timer.cs
- TextElement.cs
- PrimitiveCodeDomSerializer.cs
- EdmError.cs
- HeaderedItemsControl.cs
- SafeBuffer.cs
- AssemblyName.cs
- Html32TextWriter.cs
- HelpOperationInvoker.cs
- OutOfMemoryException.cs
- GroupStyle.cs
- TransformCryptoHandle.cs
- EventLogTraceListener.cs
- IdentitySection.cs
- CharEntityEncoderFallback.cs
- SmiRecordBuffer.cs
- ToolStripPanel.cs
- QuotedStringFormatReader.cs
- ValidationSummary.cs
- IdentityManager.cs
- RuleCache.cs
- NameObjectCollectionBase.cs
- WebRequestModuleElementCollection.cs
- TextEffect.cs
- NamedElement.cs