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
- DelegatingTypeDescriptionProvider.cs
- CompoundFileIOPermission.cs
- Soap11ServerProtocol.cs
- PointHitTestResult.cs
- KeyInfo.cs
- MarshalByRefObject.cs
- ChtmlImageAdapter.cs
- FormatConvertedBitmap.cs
- XmlQueryStaticData.cs
- SystemIcons.cs
- TabPageDesigner.cs
- ConnectionPointCookie.cs
- ListItemConverter.cs
- OneWayBindingElementImporter.cs
- WebPartZoneBase.cs
- DrawingBrush.cs
- RichTextBox.cs
- StylusPointPropertyInfo.cs
- MetadataCache.cs
- ComponentTray.cs
- SerializationSectionGroup.cs
- DataTemplateKey.cs
- MsmqHostedTransportConfiguration.cs
- DateTimeConstantAttribute.cs
- OutOfMemoryException.cs
- login.cs
- BrushConverter.cs
- WebColorConverter.cs
- MarkupObject.cs
- EntityDataSourceUtil.cs
- AsnEncodedData.cs
- ZeroOpNode.cs
- DataGridViewRowCollection.cs
- XmlSerializerFactory.cs
- PackagePartCollection.cs
- TokenizerHelper.cs
- RemotingAttributes.cs
- RepeatButtonAutomationPeer.cs
- CodeCommentStatement.cs
- MappingModelBuildProvider.cs
- IIS7WorkerRequest.cs
- UnsignedPublishLicense.cs
- PresentationTraceSources.cs
- HttpAsyncResult.cs
- CompareValidator.cs
- ProjectionCamera.cs
- XPathExpr.cs
- CodeExpressionRuleDeclaration.cs
- ParseChildrenAsPropertiesAttribute.cs
- FusionWrap.cs
- TextEffect.cs
- CodeAttributeDeclarationCollection.cs
- AccessKeyManager.cs
- FormatConvertedBitmap.cs
- HwndHost.cs
- DeclarationUpdate.cs
- ScrollableControlDesigner.cs
- TextDecorations.cs
- PropertyGeneratedEventArgs.cs
- WorkflowTraceTransfer.cs
- AspNetHostingPermission.cs
- SessionState.cs
- RoleServiceManager.cs
- StorageComplexTypeMapping.cs
- MethodCallConverter.cs
- DataBoundLiteralControl.cs
- WebPartMenu.cs
- HtmlTableRow.cs
- TextSchema.cs
- DatePickerTextBox.cs
- DrawingDrawingContext.cs
- RSAOAEPKeyExchangeFormatter.cs
- ProjectionRewriter.cs
- KerberosSecurityTokenAuthenticator.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ListViewDataItem.cs
- TextParaLineResult.cs
- UnaryOperationBinder.cs
- _Events.cs
- StrokeDescriptor.cs
- UniqueEventHelper.cs
- HelpProvider.cs
- TransactionScope.cs
- DocumentOrderComparer.cs
- FormViewUpdateEventArgs.cs
- NavigationProgressEventArgs.cs
- InvalidDataException.cs
- CodeValidator.cs
- ObjectIDGenerator.cs
- Encoder.cs
- OracleCommand.cs
- CompoundFileStorageReference.cs
- SqlDependencyListener.cs
- ChannelEndpointElement.cs
- AsyncCompletedEventArgs.cs
- Panel.cs
- SqlConnectionFactory.cs
- XamlSerializerUtil.cs
- ProcessHost.cs
- FileChangeNotifier.cs