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
- ApplicationId.cs
- ProviderConnectionPointCollection.cs
- CacheChildrenQuery.cs
- MimeFormatter.cs
- unsafenativemethodstextservices.cs
- SolidColorBrush.cs
- ExceptionRoutedEventArgs.cs
- XsltArgumentList.cs
- Transform.cs
- _LocalDataStore.cs
- XmlDocumentSchema.cs
- KeyNotFoundException.cs
- IxmlLineInfo.cs
- PackageRelationshipCollection.cs
- EllipseGeometry.cs
- UnicodeEncoding.cs
- _SingleItemRequestCache.cs
- RequestCacheEntry.cs
- MaterialGroup.cs
- WebPartCancelEventArgs.cs
- ActivitySurrogate.cs
- StubHelpers.cs
- IndexerNameAttribute.cs
- DesignerCatalogPartChrome.cs
- TextElementEnumerator.cs
- XmlQualifiedNameTest.cs
- _ScatterGatherBuffers.cs
- OracleCommandSet.cs
- AssemblyCollection.cs
- SqlDataSourceView.cs
- ReadOnlyDictionary.cs
- ConfigXmlSignificantWhitespace.cs
- ComplexObject.cs
- ApplicationDirectory.cs
- ExtendedProperty.cs
- clipboard.cs
- _DynamicWinsockMethods.cs
- UrlMappingCollection.cs
- figurelengthconverter.cs
- ModulesEntry.cs
- LineBreak.cs
- HistoryEventArgs.cs
- CompositeScriptReferenceEventArgs.cs
- SimpleTextLine.cs
- ListViewDeleteEventArgs.cs
- Quaternion.cs
- ToolStripGrip.cs
- VoiceSynthesis.cs
- CodeTypeConstructor.cs
- DiagnosticTraceSchemas.cs
- loginstatus.cs
- RelatedImageListAttribute.cs
- XmlLinkedNode.cs
- BinHexEncoding.cs
- FilterRepeater.cs
- complextypematerializer.cs
- SettingsSavedEventArgs.cs
- SoapTypeAttribute.cs
- X509Certificate.cs
- CompoundFileDeflateTransform.cs
- DependencyPropertyHelper.cs
- RectKeyFrameCollection.cs
- WebPartMovingEventArgs.cs
- ApplicationBuildProvider.cs
- SafeRegistryHandle.cs
- SiteMap.cs
- GroupBoxAutomationPeer.cs
- Operator.cs
- ComNativeDescriptor.cs
- RangeValuePattern.cs
- ResourcePermissionBaseEntry.cs
- PatternMatcher.cs
- FileDataSourceCache.cs
- CompositeDesignerAccessibleObject.cs
- XsltConvert.cs
- WeakHashtable.cs
- TypeValidationEventArgs.cs
- ComponentSerializationService.cs
- ContentFileHelper.cs
- IgnoreFileBuildProvider.cs
- XmlTypeMapping.cs
- ToolTipAutomationPeer.cs
- WinFormsSpinner.cs
- ConfigurationCollectionAttribute.cs
- UpdateEventArgs.cs
- ServiceCredentialsSecurityTokenManager.cs
- ThemeableAttribute.cs
- TransformProviderWrapper.cs
- TextElementCollection.cs
- SupportedAddressingMode.cs
- UriScheme.cs
- SoapTypeAttribute.cs
- ImageConverter.cs
- FixedBufferAttribute.cs
- TcpStreams.cs
- XmlSignatureProperties.cs
- ListViewPagedDataSource.cs
- RoleGroupCollectionEditor.cs
- SafeViewOfFileHandle.cs
- RawKeyboardInputReport.cs