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
- CompiledQuery.cs
- PropertyBuilder.cs
- CodeMemberProperty.cs
- RepeaterItemCollection.cs
- LocalizableAttribute.cs
- ZipIORawDataFileBlock.cs
- SQLUtility.cs
- DeploymentSection.cs
- TreePrinter.cs
- AdapterDictionary.cs
- ReceiveReply.cs
- DateTimeFormatInfoScanner.cs
- ColumnWidthChangingEvent.cs
- AttachInfo.cs
- DeploymentSection.cs
- TagPrefixInfo.cs
- TrackingParticipant.cs
- TextDecorationLocationValidation.cs
- WebPartCollection.cs
- FontCollection.cs
- FormConverter.cs
- odbcmetadatafactory.cs
- DeflateEmulationStream.cs
- PolyLineSegment.cs
- HtmlTableCell.cs
- XmlChoiceIdentifierAttribute.cs
- InvalidPropValue.cs
- DrawingAttributesDefaultValueFactory.cs
- WebPartTransformerCollection.cs
- ArgumentNullException.cs
- ServiceNameElement.cs
- ImplicitInputBrush.cs
- HGlobalSafeHandle.cs
- Parallel.cs
- TimeStampChecker.cs
- ProcessModelSection.cs
- HttpListenerElement.cs
- MenuItemStyleCollection.cs
- FileDialog.cs
- LayoutUtils.cs
- UIElementCollection.cs
- XmlProcessingInstruction.cs
- Itemizer.cs
- ToolStripSplitButton.cs
- SoapCodeExporter.cs
- MembershipSection.cs
- DisableDpiAwarenessAttribute.cs
- SyndicationFeed.cs
- SByteConverter.cs
- ListViewItem.cs
- CriticalExceptions.cs
- QuaternionConverter.cs
- FtpWebResponse.cs
- WebEventCodes.cs
- LocalBuilder.cs
- DialogResultConverter.cs
- StateMachineWorkflow.cs
- ComplexTypeEmitter.cs
- CultureTableRecord.cs
- HelpEvent.cs
- ScriptDescriptor.cs
- OleDbEnumerator.cs
- Geometry3D.cs
- DynamicDiscoSearcher.cs
- OdbcStatementHandle.cs
- LostFocusEventManager.cs
- DrawingContextDrawingContextWalker.cs
- XmlDataCollection.cs
- ListSourceHelper.cs
- FilteredXmlReader.cs
- ErrorTolerantObjectWriter.cs
- Part.cs
- SQLGuidStorage.cs
- SvcMapFileSerializer.cs
- QueryRelOp.cs
- ColumnResult.cs
- PrintPreviewDialog.cs
- DataGridAutomationPeer.cs
- ObjectDataSourceView.cs
- GridViewUpdateEventArgs.cs
- ManifestSignedXml.cs
- TraceListener.cs
- PagerStyle.cs
- GotoExpression.cs
- PropertyMapper.cs
- Partitioner.cs
- SkinBuilder.cs
- CaseInsensitiveOrdinalStringComparer.cs
- WindowHideOrCloseTracker.cs
- ObjectViewQueryResultData.cs
- OdbcUtils.cs
- ProviderBase.cs
- RequestStatusBarUpdateEventArgs.cs
- WebPageTraceListener.cs
- Block.cs
- AuthenticationManager.cs
- ProfilePropertySettings.cs
- GradientStop.cs
- SQLBytesStorage.cs
- RequestBringIntoViewEventArgs.cs