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
- HttpCacheVaryByContentEncodings.cs
- CodeMemberEvent.cs
- WinFormsSecurity.cs
- FtpCachePolicyElement.cs
- DataGridViewRowEventArgs.cs
- BindingSource.cs
- ISAPIWorkerRequest.cs
- ExtenderHelpers.cs
- StylusOverProperty.cs
- UidPropertyAttribute.cs
- ExpressionVisitor.cs
- TextEndOfParagraph.cs
- ScriptIgnoreAttribute.cs
- SrgsText.cs
- SchemaImporterExtensionsSection.cs
- ResourceExpressionBuilder.cs
- XPathEmptyIterator.cs
- LabelExpression.cs
- PersonalizationStateInfo.cs
- HttpHandlerActionCollection.cs
- HttpRequestTraceRecord.cs
- LocatorGroup.cs
- EncoderFallback.cs
- IntSecurity.cs
- SqlBuffer.cs
- PropertyToken.cs
- ManagementInstaller.cs
- OutputCacheModule.cs
- XPathParser.cs
- SafeFileMapViewHandle.cs
- RowUpdatingEventArgs.cs
- Int32Animation.cs
- SessionPageStateSection.cs
- DeclarativeCatalogPartDesigner.cs
- VariableAction.cs
- ConfigPathUtility.cs
- validationstate.cs
- CacheModeConverter.cs
- ConnectionsZone.cs
- TriggerAction.cs
- CodeCatchClause.cs
- QuaternionIndependentAnimationStorage.cs
- TableSectionStyle.cs
- OleDbFactory.cs
- CodeExporter.cs
- XMLSchema.cs
- LabelDesigner.cs
- SchemaNotation.cs
- GC.cs
- RetrieveVirtualItemEventArgs.cs
- WindowsSlider.cs
- HtmlTextArea.cs
- TimersDescriptionAttribute.cs
- SocketPermission.cs
- DrawingVisual.cs
- RelationalExpressions.cs
- TimerElapsedEvenArgs.cs
- SqlRowUpdatedEvent.cs
- PropertyChangingEventArgs.cs
- SaveFileDialog.cs
- DiscoveryReference.cs
- TemplateField.cs
- xsdvalidator.cs
- SharedPerformanceCounter.cs
- DbFunctionCommandTree.cs
- XhtmlBasicTextViewAdapter.cs
- ActivityBindForm.cs
- FileDialogCustomPlacesCollection.cs
- ServicesUtilities.cs
- IssuedTokenParametersElement.cs
- SoapReflectionImporter.cs
- RegularExpressionValidator.cs
- CountAggregationOperator.cs
- ProfilePropertySettingsCollection.cs
- SmtpReplyReader.cs
- RestClientProxyHandler.cs
- Renderer.cs
- Timer.cs
- StorageComplexTypeMapping.cs
- MultiPropertyDescriptorGridEntry.cs
- HandlerBase.cs
- HtmlTableRowCollection.cs
- RadioButtonBaseAdapter.cs
- SqlResolver.cs
- SqlRewriteScalarSubqueries.cs
- BmpBitmapDecoder.cs
- AssemblySettingAttributes.cs
- CopyAttributesAction.cs
- SHA384.cs
- SubtreeProcessor.cs
- ServiceAuthorizationBehavior.cs
- KeyTimeConverter.cs
- ContentElement.cs
- ObjectDisposedException.cs
- StopStoryboard.cs
- CompModSwitches.cs
- StringAnimationUsingKeyFrames.cs
- SoapElementAttribute.cs
- CompareValidator.cs
- TreeNodeCollection.cs