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
- FlowchartSizeFeature.cs
- RuntimeArgumentHandle.cs
- ParamArrayAttribute.cs
- CommandEventArgs.cs
- BitmapEffectrendercontext.cs
- PointLight.cs
- GacUtil.cs
- OLEDB_Enum.cs
- OleServicesContext.cs
- OleDbDataAdapter.cs
- PrinterSettings.cs
- WebSysDefaultValueAttribute.cs
- TextParagraphProperties.cs
- ResourceType.cs
- PointF.cs
- XmlByteStreamReader.cs
- AccessDataSourceView.cs
- HTMLTagNameToTypeMapper.cs
- TdsParserHelperClasses.cs
- SimplePropertyEntry.cs
- PlatformCulture.cs
- TextOptions.cs
- TextShapeableCharacters.cs
- DBConcurrencyException.cs
- TripleDESCryptoServiceProvider.cs
- CheckBoxField.cs
- Matrix3D.cs
- DiagnosticsConfiguration.cs
- Setter.cs
- ErasingStroke.cs
- DeclarativeCatalogPart.cs
- objectquery_tresulttype.cs
- MetadataException.cs
- SafeHandle.cs
- DataGridTablesFactory.cs
- FastEncoderWindow.cs
- BindingContext.cs
- CacheAxisQuery.cs
- Opcode.cs
- WorkflowOperationBehavior.cs
- StackBuilderSink.cs
- COM2PropertyDescriptor.cs
- AppDomainCompilerProxy.cs
- OleDbReferenceCollection.cs
- MailSettingsSection.cs
- EncryptedData.cs
- CheckBoxField.cs
- AttributeUsageAttribute.cs
- ImpersonateTokenRef.cs
- DataServiceKeyAttribute.cs
- EnumValidator.cs
- DPAPIProtectedConfigurationProvider.cs
- HashMembershipCondition.cs
- WriteableBitmap.cs
- ToolStripScrollButton.cs
- ImageMap.cs
- ClientCultureInfo.cs
- DatagridviewDisplayedBandsData.cs
- WorkflowTransactionService.cs
- ReadWriteObjectLock.cs
- UserThread.cs
- EventLogPermissionAttribute.cs
- SQLConvert.cs
- ReliableOutputConnection.cs
- ExtensibleClassFactory.cs
- HttpListenerPrefixCollection.cs
- CalendarDay.cs
- AxImporter.cs
- UnmanagedMarshal.cs
- DataGridViewTopLeftHeaderCell.cs
- PolicyStatement.cs
- ViewSimplifier.cs
- EncoderBestFitFallback.cs
- EntityType.cs
- PeerName.cs
- DataSourceXmlClassAttribute.cs
- RewritingPass.cs
- ProviderConnectionPointCollection.cs
- SafeReversePInvokeHandle.cs
- TagPrefixInfo.cs
- SupportsEventValidationAttribute.cs
- __Filters.cs
- ProfileGroupSettings.cs
- SystemColorTracker.cs
- StringSorter.cs
- Label.cs
- EntityDataSourceMemberPath.cs
- StringConverter.cs
- Geometry3D.cs
- SqlExpressionNullability.cs
- ListViewEditEventArgs.cs
- SafeMILHandle.cs
- Rfc4050KeyFormatter.cs
- NavigationPropertyEmitter.cs
- QuaternionAnimation.cs
- QueryContinueDragEvent.cs
- IsolatedStorageException.cs
- AnnotationHelper.cs
- ComIntegrationManifestGenerator.cs
- EntitySetRetriever.cs