Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / StringPropertyBuilder.cs / 1305376 / 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
- EncryptedKeyIdentifierClause.cs
- ImageBrush.cs
- StandardCommands.cs
- DataTable.cs
- SqlUtil.cs
- CorePropertiesFilter.cs
- ReverseInheritProperty.cs
- FactoryGenerator.cs
- LinkDescriptor.cs
- XmlDocumentFragment.cs
- XsdBuildProvider.cs
- Visual3DCollection.cs
- ViewKeyConstraint.cs
- StructuredTypeEmitter.cs
- PageContent.cs
- EnvelopeVersion.cs
- PropertyCollection.cs
- JsonQNameDataContract.cs
- KeyConstraint.cs
- SqlDependency.cs
- SecurityTokenProvider.cs
- ObjectListCommandEventArgs.cs
- SqlDataSourceCache.cs
- TabControl.cs
- CardSpacePolicyElement.cs
- AssemblyInfo.cs
- GridItemPattern.cs
- SafeMarshalContext.cs
- ContentWrapperAttribute.cs
- ValueConversionAttribute.cs
- ResourcesBuildProvider.cs
- TraceContext.cs
- ViewCellSlot.cs
- UInt64Converter.cs
- AddingNewEventArgs.cs
- GridViewUpdateEventArgs.cs
- ProfileSettingsCollection.cs
- Button.cs
- ToolBarPanel.cs
- ObjectConverter.cs
- ConfigXmlCDataSection.cs
- EventDescriptor.cs
- TreeNodeBinding.cs
- AddressingProperty.cs
- TagPrefixAttribute.cs
- ProtocolsInstallComponent.cs
- PublisherIdentityPermission.cs
- BamlWriter.cs
- SafeProcessHandle.cs
- MailAddress.cs
- WebPartsPersonalization.cs
- RunClient.cs
- Binding.cs
- ColorConvertedBitmap.cs
- CollectionDataContractAttribute.cs
- NetworkInformationPermission.cs
- ScriptManagerProxy.cs
- UIPermission.cs
- FigureParagraph.cs
- TableLayoutStyleCollection.cs
- TimeStampChecker.cs
- XPathItem.cs
- TdsParser.cs
- PolyQuadraticBezierSegment.cs
- FormViewDeleteEventArgs.cs
- RegexTree.cs
- DatatypeImplementation.cs
- WhitespaceRuleLookup.cs
- CrossAppDomainChannel.cs
- TemplateApplicationHelper.cs
- PublishLicense.cs
- RangeEnumerable.cs
- TemplatePartAttribute.cs
- TypeUtils.cs
- RowType.cs
- ProgressBarBrushConverter.cs
- TabItemWrapperAutomationPeer.cs
- XmlAutoDetectWriter.cs
- TriState.cs
- Track.cs
- _HelperAsyncResults.cs
- DecimalFormatter.cs
- ListItemConverter.cs
- BackEase.cs
- SpecialTypeDataContract.cs
- Group.cs
- Storyboard.cs
- IisTraceWebEventProvider.cs
- CodeGroup.cs
- ScriptMethodAttribute.cs
- XpsPackagingPolicy.cs
- TcpHostedTransportConfiguration.cs
- WindowsSecurityTokenAuthenticator.cs
- CodeFieldReferenceExpression.cs
- BinaryObjectInfo.cs
- XmlQueryRuntime.cs
- Visual.cs
- DeviceContexts.cs
- CommonGetThemePartSize.cs
- InstanceKeyCollisionException.cs