Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EditingCoordinator.cs
- DrawingContext.cs
- _ChunkParse.cs
- OptimalTextSource.cs
- MenuItemBindingCollection.cs
- CultureSpecificStringDictionary.cs
- MultipartIdentifier.cs
- ButtonFlatAdapter.cs
- TreeViewAutomationPeer.cs
- WindowShowOrOpenTracker.cs
- SchemaCollectionPreprocessor.cs
- MethodBody.cs
- ChtmlTextWriter.cs
- DPTypeDescriptorContext.cs
- RemoteWebConfigurationHost.cs
- HwndProxyElementProvider.cs
- ZeroOpNode.cs
- SecureEnvironment.cs
- BindingValueChangedEventArgs.cs
- WebHeaderCollection.cs
- BindableAttribute.cs
- DynamicRenderer.cs
- MissingSatelliteAssemblyException.cs
- RoleManagerModule.cs
- WebPartMenuStyle.cs
- MultiSelectRootGridEntry.cs
- OperatingSystem.cs
- EmptyEnumerator.cs
- SafeThreadHandle.cs
- XmlSerializerSection.cs
- SymLanguageVendor.cs
- XmlDataSourceNodeDescriptor.cs
- GridViewCommandEventArgs.cs
- StringFreezingAttribute.cs
- CodeArrayIndexerExpression.cs
- SemanticResolver.cs
- DtdParser.cs
- TypeElement.cs
- LoginCancelEventArgs.cs
- ProfileSection.cs
- ExtenderHelpers.cs
- DataControlCommands.cs
- FileFormatException.cs
- CustomSignedXml.cs
- AsyncOperation.cs
- UIntPtr.cs
- ClientUtils.cs
- MetadataItemEmitter.cs
- DiscriminatorMap.cs
- LogEntrySerialization.cs
- EditingCommands.cs
- UrlMappingsSection.cs
- AutomationPropertyInfo.cs
- SamlAction.cs
- CommandConverter.cs
- MsmqChannelFactoryBase.cs
- BuildProvider.cs
- ErrorFormatter.cs
- IntPtr.cs
- EncodingDataItem.cs
- SortableBindingList.cs
- RetrieveVirtualItemEventArgs.cs
- ThreadPool.cs
- HMACSHA512.cs
- HttpCookie.cs
- FixedDSBuilder.cs
- EmbeddedMailObject.cs
- MessageEncodingBindingElementImporter.cs
- PackageProperties.cs
- ElementNotEnabledException.cs
- RunWorkerCompletedEventArgs.cs
- PersistenceProviderBehavior.cs
- SelfIssuedAuthRSACryptoProvider.cs
- TemplateNameScope.cs
- Dump.cs
- ListSortDescription.cs
- Container.cs
- SmiContextFactory.cs
- BulletedList.cs
- GridViewColumnHeader.cs
- IncomingWebResponseContext.cs
- VoiceObjectToken.cs
- ColorContext.cs
- FigureParagraph.cs
- baseaxisquery.cs
- MailSettingsSection.cs
- ChannelManager.cs
- ProtocolsConfigurationEntry.cs
- DrawingContextDrawingContextWalker.cs
- ActivationArguments.cs
- CommonRemoteMemoryBlock.cs
- UrlMapping.cs
- ImageDrawing.cs
- DefaultValueTypeConverter.cs
- ByteArrayHelperWithString.cs
- UpdateCommand.cs
- SortedList.cs
- SmiConnection.cs
- ContextBase.cs
- Automation.cs