Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / StringPropertyBuilder.cs / 1 / StringPropertyBuilder.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections; ////// Builds inner string properties. /// internal sealed class StringPropertyBuilder : ControlBuilder { private string _text; ////// Creates a new instance of StringPropertyBuilder. /// internal StringPropertyBuilder() { } internal StringPropertyBuilder(string text) { _text = text; } ////// Returns the inner text of the property. /// public string Text { get { return (_text == null) ? String.Empty : _text; } } ////// Gets the inner text of the property. /// public override void AppendLiteralString(string s) { if (ParentBuilder != null && ParentBuilder.HtmlDecodeLiterals()) s = HttpUtility.HtmlDecode(s); _text = s; } ////// Throws an exception - string properties cannot contain other objects. /// public override void AppendSubBuilder(ControlBuilder subBuilder) { throw new HttpException(SR.GetString(SR.StringPropertyBuilder_CannotHaveChildObjects, TagName, (ParentBuilder != null ? ParentBuilder.TagName : String.Empty))); } public override object BuildObject() { return Text; } public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string ID, IDictionary attribs) { base.Init(parser, parentBuilder, type /*type*/, tagName, ID, attribs); SetControlType(typeof(string)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections; ////// Builds inner string properties. /// internal sealed class StringPropertyBuilder : ControlBuilder { private string _text; ////// Creates a new instance of StringPropertyBuilder. /// internal StringPropertyBuilder() { } internal StringPropertyBuilder(string text) { _text = text; } ////// Returns the inner text of the property. /// public string Text { get { return (_text == null) ? String.Empty : _text; } } ////// Gets the inner text of the property. /// public override void AppendLiteralString(string s) { if (ParentBuilder != null && ParentBuilder.HtmlDecodeLiterals()) s = HttpUtility.HtmlDecode(s); _text = s; } ////// Throws an exception - string properties cannot contain other objects. /// public override void AppendSubBuilder(ControlBuilder subBuilder) { throw new HttpException(SR.GetString(SR.StringPropertyBuilder_CannotHaveChildObjects, TagName, (ParentBuilder != null ? ParentBuilder.TagName : String.Empty))); } public override object BuildObject() { return Text; } public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string ID, IDictionary attribs) { base.Init(parser, parentBuilder, type /*type*/, tagName, ID, attribs); SetControlType(typeof(string)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WinEventTracker.cs
- VectorValueSerializer.cs
- ContainerVisual.cs
- KeyedQueue.cs
- UniqueEventHelper.cs
- ZipIOLocalFileBlock.cs
- X509CertificateInitiatorServiceCredential.cs
- HtmlHead.cs
- LiteralLink.cs
- VectorAnimation.cs
- PtsContext.cs
- HashMembershipCondition.cs
- XmlDeclaration.cs
- ListMarkerLine.cs
- WebPartPersonalization.cs
- EncoderExceptionFallback.cs
- HtmlAnchor.cs
- MasterPageBuildProvider.cs
- Wildcard.cs
- ApplicationFileCodeDomTreeGenerator.cs
- RemoteWebConfigurationHostServer.cs
- OrderedDictionary.cs
- ConstrainedGroup.cs
- DrawListViewItemEventArgs.cs
- AssertFilter.cs
- SoapSchemaExporter.cs
- TextEffectCollection.cs
- HttpListenerException.cs
- SystemNetHelpers.cs
- PropertiesTab.cs
- Button.cs
- WinEventQueueItem.cs
- CategoriesDocument.cs
- PropertyHelper.cs
- ProcessModelInfo.cs
- MimePart.cs
- TextBoxLine.cs
- Material.cs
- SqlBuffer.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- CfgRule.cs
- DataRowChangeEvent.cs
- KeyedHashAlgorithm.cs
- Translator.cs
- AppDomainProtocolHandler.cs
- InlineCategoriesDocument.cs
- SspiNegotiationTokenProviderState.cs
- StyleTypedPropertyAttribute.cs
- LongTypeConverter.cs
- WebPartDisplayModeCancelEventArgs.cs
- ADMembershipUser.cs
- HttpException.cs
- SessionEndingEventArgs.cs
- BufferModesCollection.cs
- EmptyElement.cs
- PriorityQueue.cs
- DefaultValueConverter.cs
- RequestTimeoutManager.cs
- JavaScriptString.cs
- Main.cs
- FormsAuthenticationConfiguration.cs
- AddInServer.cs
- DataServiceProcessingPipeline.cs
- XPathSingletonIterator.cs
- Point3D.cs
- HandlerWithFactory.cs
- MD5CryptoServiceProvider.cs
- SerializerWriterEventHandlers.cs
- CalendarDay.cs
- Exceptions.cs
- WorkflowServiceAttributesTypeConverter.cs
- WindowsAuthenticationModule.cs
- HtmlInputImage.cs
- UnmanagedMarshal.cs
- linebase.cs
- DbConnectionInternal.cs
- DataGridHelper.cs
- DesignerCategoryAttribute.cs
- BrowserCapabilitiesCodeGenerator.cs
- SafeViewOfFileHandle.cs
- ListenerElementsCollection.cs
- EntityProxyFactory.cs
- SpellerError.cs
- HandleTable.cs
- EndEvent.cs
- ManagementScope.cs
- ReaderOutput.cs
- PointCollectionValueSerializer.cs
- Process.cs
- FilterQuery.cs
- UrlPath.cs
- TableRow.cs
- AsymmetricSignatureFormatter.cs
- WithStatement.cs
- FileLogRecordHeader.cs
- LayoutUtils.cs
- Action.cs
- DrawingGroup.cs
- ProcessHostConfigUtils.cs
- SqlConnectionPoolGroupProviderInfo.cs