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
- ObsoleteAttribute.cs
- ShaderEffect.cs
- BufferedReadStream.cs
- Keywords.cs
- SqlDataSourceCommandParser.cs
- categoryentry.cs
- TreeViewEvent.cs
- ControlCollection.cs
- PasswordPropertyTextAttribute.cs
- XslUrlEditor.cs
- DiscoveryProxy.cs
- RegionData.cs
- ClientBuildManagerCallback.cs
- NavigationFailedEventArgs.cs
- DataMemberFieldConverter.cs
- FrugalMap.cs
- SafeBitVector32.cs
- XmlDataLoader.cs
- RSACryptoServiceProvider.cs
- DateTimeParse.cs
- XmlSchemaSimpleTypeList.cs
- HttpModuleActionCollection.cs
- StackBuilderSink.cs
- SecurityDocument.cs
- SystemDiagnosticsSection.cs
- PageStatePersister.cs
- CheckBoxPopupAdapter.cs
- IdentityNotMappedException.cs
- ScrollEventArgs.cs
- ProtocolElement.cs
- nulltextnavigator.cs
- backend.cs
- SharedDp.cs
- SafeBuffer.cs
- SaveFileDialog.cs
- CapabilitiesSection.cs
- Token.cs
- AssemblyCacheEntry.cs
- MSAAEventDispatcher.cs
- TdsParserStateObject.cs
- PersonalizationState.cs
- WorkflowServiceHostFactory.cs
- TextEditorTables.cs
- OleDbCommand.cs
- IMembershipProvider.cs
- WebHostedComPlusServiceHost.cs
- MexServiceChannelBuilder.cs
- RoleGroupCollection.cs
- SimpleRecyclingCache.cs
- path.cs
- ConstraintEnumerator.cs
- ChangeTracker.cs
- LinqTreeNodeEvaluator.cs
- ManualResetEvent.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- AlphabetConverter.cs
- ButtonStandardAdapter.cs
- DocumentXPathNavigator.cs
- TextBox.cs
- Column.cs
- ContextMenuStripGroup.cs
- HighContrastHelper.cs
- PixelShader.cs
- MasterPage.cs
- BasicDesignerLoader.cs
- WindowsScrollBarBits.cs
- ComUdtElementCollection.cs
- SimplePropertyEntry.cs
- NavigationWindow.cs
- _Win32.cs
- RectangleF.cs
- ColumnWidthChangingEvent.cs
- SqlBuilder.cs
- BitmapFrameDecode.cs
- AdornerHitTestResult.cs
- BadImageFormatException.cs
- MailWebEventProvider.cs
- TypeExtensionConverter.cs
- AlphaSortedEnumConverter.cs
- Empty.cs
- XPathNavigatorReader.cs
- ToolStripLocationCancelEventArgs.cs
- RestClientProxyHandler.cs
- CompositeControl.cs
- OleDbPermission.cs
- CheckBox.cs
- WizardStepBase.cs
- PropertyGridView.cs
- TranslateTransform.cs
- SecurityHelper.cs
- BreakSafeBase.cs
- CommonDialog.cs
- FastEncoderStatics.cs
- EditorZone.cs
- LineServicesCallbacks.cs
- DrawingCollection.cs
- ListView.cs
- ParserOptions.cs
- SchemaDeclBase.cs
- TagPrefixInfo.cs