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
- PropertyDescriptorGridEntry.cs
- SiteMapPath.cs
- Token.cs
- cookiecollection.cs
- OutputCacheProfile.cs
- regiisutil.cs
- ModelUIElement3D.cs
- SerialStream.cs
- Vector3D.cs
- DesignerTextBoxAdapter.cs
- RawMouseInputReport.cs
- IncrementalReadDecoders.cs
- AtomParser.cs
- TriggerBase.cs
- UInt32Storage.cs
- SqlEnums.cs
- PropertyToken.cs
- ErrorHandler.cs
- XmlCDATASection.cs
- DrawingImage.cs
- XPathLexer.cs
- RequestTimeoutManager.cs
- RestHandlerFactory.cs
- BoundPropertyEntry.cs
- TreeViewEvent.cs
- EntityKey.cs
- CompiledIdentityConstraint.cs
- IgnoreDataMemberAttribute.cs
- NativeMethods.cs
- ListMarkerLine.cs
- XmlDataSource.cs
- DropSource.cs
- HandleCollector.cs
- FlowLayoutSettings.cs
- CompilationRelaxations.cs
- TextRunProperties.cs
- DataGridItemCollection.cs
- _ConnectionGroup.cs
- TabItemAutomationPeer.cs
- ScriptReferenceBase.cs
- IdentityHolder.cs
- ContentElementAutomationPeer.cs
- HtmlInputSubmit.cs
- PrinterSettings.cs
- PersonalizationStateQuery.cs
- ExtentCqlBlock.cs
- rsa.cs
- SafeArchiveContext.cs
- InvokeMethodActivityDesigner.cs
- DataColumnPropertyDescriptor.cs
- TemplatePropertyEntry.cs
- DependencyPropertyChangedEventArgs.cs
- XmlChildEnumerator.cs
- TriggerAction.cs
- ServiceNameElementCollection.cs
- BinaryParser.cs
- ViewPort3D.cs
- ComboBoxAutomationPeer.cs
- TypeDescriptionProviderAttribute.cs
- WebPartHeaderCloseVerb.cs
- _FtpDataStream.cs
- XPathParser.cs
- SystemMulticastIPAddressInformation.cs
- NameValueSectionHandler.cs
- XmlValidatingReaderImpl.cs
- DataObjectCopyingEventArgs.cs
- ObjectViewListener.cs
- SoapFaultCodes.cs
- HtmlMeta.cs
- QEncodedStream.cs
- DataGridAddNewRow.cs
- GlyphingCache.cs
- DataGridViewCellStateChangedEventArgs.cs
- DataBindingCollection.cs
- NameService.cs
- ScrollChrome.cs
- TextTreePropertyUndoUnit.cs
- Baml2006Reader.cs
- IndexedString.cs
- TreeNodeMouseHoverEvent.cs
- ConfigurationSectionGroup.cs
- COM2PropertyDescriptor.cs
- SubMenuStyle.cs
- TypeSemantics.cs
- TextEditorMouse.cs
- ApplicationSecurityInfo.cs
- EnumConverter.cs
- Debug.cs
- QueryCacheManager.cs
- SerializableAttribute.cs
- SqlWebEventProvider.cs
- InertiaTranslationBehavior.cs
- RadioButtonAutomationPeer.cs
- RequestContext.cs
- Polyline.cs
- PersonalizableAttribute.cs
- XmlFormatReaderGenerator.cs
- NullReferenceException.cs
- HttpFileCollection.cs
- GeneratedCodeAttribute.cs