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
- XhtmlBasicValidatorAdapter.cs
- FileDialogCustomPlace.cs
- XmlNotation.cs
- GridViewColumnHeader.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- MiniCustomAttributeInfo.cs
- DataGridTextBoxColumn.cs
- SubpageParagraph.cs
- ViewCellRelation.cs
- Bind.cs
- IProvider.cs
- ListQueryResults.cs
- LinqDataSourceHelper.cs
- ConfigurationPermission.cs
- ComplexLine.cs
- querybuilder.cs
- ServiceNotStartedException.cs
- GifBitmapEncoder.cs
- MessageVersionConverter.cs
- ExpressionLexer.cs
- InvalidAsynchronousStateException.cs
- DataTableTypeConverter.cs
- DashStyles.cs
- ApplicationSecurityInfo.cs
- HttpContextBase.cs
- TileBrush.cs
- CompiledRegexRunnerFactory.cs
- XmlSchemaComplexContent.cs
- EntitySqlQueryState.cs
- InfoCardSymmetricCrypto.cs
- StrokeCollection.cs
- ConnectorSelectionGlyph.cs
- XPathEmptyIterator.cs
- ScriptServiceAttribute.cs
- ProxyManager.cs
- ConfigXmlAttribute.cs
- PageBreakRecord.cs
- smtppermission.cs
- DataGridAutomationPeer.cs
- SyntaxCheck.cs
- SlipBehavior.cs
- DbInsertCommandTree.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- RenderData.cs
- DbUpdateCommandTree.cs
- TextLineBreak.cs
- DataGridTablesFactory.cs
- EventListenerClientSide.cs
- HyperLinkField.cs
- ConstNode.cs
- Activity.cs
- HttpRuntimeSection.cs
- ProofTokenCryptoHandle.cs
- DataGridViewLinkCell.cs
- FilterQuery.cs
- IncomingWebResponseContext.cs
- ButtonBase.cs
- SafeRightsManagementHandle.cs
- ToolConsole.cs
- ProtocolsConfigurationEntry.cs
- SectionUpdates.cs
- DataKeyArray.cs
- DataRelation.cs
- InteropExecutor.cs
- ProtectedConfigurationSection.cs
- KeyValuePairs.cs
- BitmapEffectGeneralTransform.cs
- SerializationEventsCache.cs
- HtmlImage.cs
- DataSourceListEditor.cs
- GAC.cs
- HoistedLocals.cs
- ObjectListCommandCollection.cs
- RIPEMD160Managed.cs
- ItemMap.cs
- DataException.cs
- documentsequencetextpointer.cs
- ComplexPropertyEntry.cs
- TimeSpanValidatorAttribute.cs
- BooleanFunctions.cs
- TextTreeFixupNode.cs
- ListItemParagraph.cs
- UnsettableComboBox.cs
- ListItemCollection.cs
- ViewStateModeByIdAttribute.cs
- WebBrowserNavigatingEventHandler.cs
- CommandLineParser.cs
- CommittableTransaction.cs
- TypeDescriptionProviderAttribute.cs
- InstanceCreationEditor.cs
- StronglyTypedResourceBuilder.cs
- ReverseQueryOperator.cs
- NumberAction.cs
- ScaleTransform.cs
- SubordinateTransaction.cs
- COM2ColorConverter.cs
- CommonDialog.cs
- BezierSegment.cs
- DbMetaDataCollectionNames.cs
- AttributeTable.cs