Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- CanonicalizationDriver.cs
- SqlFormatter.cs
- BigIntegerStorage.cs
- DynamicEndpointElement.cs
- MessageAction.cs
- BitFlagsGenerator.cs
- UiaCoreTypesApi.cs
- Rijndael.cs
- DataList.cs
- MetadataArtifactLoaderCompositeFile.cs
- Visual3DCollection.cs
- QuadraticBezierSegment.cs
- ReceiveContent.cs
- EventLogHandle.cs
- ParameterToken.cs
- XAMLParseException.cs
- XpsManager.cs
- ProjectionNode.cs
- SpecularMaterial.cs
- APCustomTypeDescriptor.cs
- DataServiceHost.cs
- FormViewDeletedEventArgs.cs
- AssemblyBuilder.cs
- DependencyObjectPropertyDescriptor.cs
- DataReaderContainer.cs
- Button.cs
- CounterSampleCalculator.cs
- VisualProxy.cs
- webclient.cs
- ComponentEditorForm.cs
- DataSourceCache.cs
- BinaryWriter.cs
- XmlSchemaComplexContentRestriction.cs
- XsltLibrary.cs
- DES.cs
- ConnectionPoolManager.cs
- COAUTHIDENTITY.cs
- SecurityTokenSerializer.cs
- TypeSchema.cs
- HttpCapabilitiesSectionHandler.cs
- SelfIssuedSamlTokenFactory.cs
- DefaultBinder.cs
- DetailsViewUpdateEventArgs.cs
- PersonalizationAdministration.cs
- ParserExtension.cs
- xmlsaver.cs
- StylusButton.cs
- DbSourceCommand.cs
- BuildDependencySet.cs
- NamedPipeTransportSecurity.cs
- AttachedAnnotationChangedEventArgs.cs
- PropertyKey.cs
- PolicyManager.cs
- UInt64.cs
- TextParaLineResult.cs
- TokenFactoryCredential.cs
- CacheOutputQuery.cs
- httpstaticobjectscollection.cs
- MergablePropertyAttribute.cs
- CatalogZoneDesigner.cs
- OdbcCommand.cs
- MultiBinding.cs
- ObjectAnimationUsingKeyFrames.cs
- HttpCapabilitiesBase.cs
- MSAANativeProvider.cs
- ReaderWriterLock.cs
- WorkflowServiceHostFactory.cs
- ZipArchive.cs
- SimpleColumnProvider.cs
- SourceFilter.cs
- XmlSchemaSet.cs
- WebPartTransformer.cs
- CopyCodeAction.cs
- StyleBamlTreeBuilder.cs
- LoginCancelEventArgs.cs
- ConfigXmlAttribute.cs
- BitmapEffectInput.cs
- HttpHandlerActionCollection.cs
- HtmlTextArea.cs
- RowToFieldTransformer.cs
- DataGridColumnEventArgs.cs
- Rotation3D.cs
- sqlser.cs
- TypeLibConverter.cs
- DataGridViewSortCompareEventArgs.cs
- AlphabeticalEnumConverter.cs
- CompiledRegexRunner.cs
- DataObject.cs
- XsdDateTime.cs
- Registry.cs
- GradientStop.cs
- ReadOnlyHierarchicalDataSource.cs
- LoginAutoFormat.cs
- BindStream.cs
- ConfigXmlReader.cs
- TreeWalker.cs
- RangeBaseAutomationPeer.cs
- DataChangedEventManager.cs
- Geometry3D.cs
- SmiEventStream.cs