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
- GridViewRowEventArgs.cs
- ObjectItemCollection.cs
- PrintPreviewDialog.cs
- SafeCryptoHandles.cs
- ProtocolElementCollection.cs
- InkCollectionBehavior.cs
- JsonUriDataContract.cs
- LoginName.cs
- ModuleBuilder.cs
- BitStack.cs
- SiteOfOriginPart.cs
- OdbcHandle.cs
- ArgumentException.cs
- BamlVersionHeader.cs
- configsystem.cs
- Rect3DConverter.cs
- ConfigDefinitionUpdates.cs
- LinkLabel.cs
- CodeGroup.cs
- ServerIdentity.cs
- ExpressionBuilderCollection.cs
- ListParaClient.cs
- InkCollectionBehavior.cs
- CaseInsensitiveHashCodeProvider.cs
- Int32AnimationBase.cs
- TriggerCollection.cs
- StylusTip.cs
- KeyboardDevice.cs
- WindowsBrush.cs
- TdsParserHelperClasses.cs
- PeerToPeerException.cs
- SemaphoreFullException.cs
- ZeroOpNode.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- NotImplementedException.cs
- CatalogZoneBase.cs
- AssemblyCache.cs
- XmlAttributeCollection.cs
- PropertyItem.cs
- DesignUtil.cs
- DataGridPagingPage.cs
- NGCSerializationManager.cs
- SQLMoney.cs
- ThrowHelper.cs
- TreeNodeStyleCollectionEditor.cs
- ListDictionary.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- SocketManager.cs
- LabelAutomationPeer.cs
- ListBoxDesigner.cs
- TextServicesManager.cs
- Crc32.cs
- WindowsIdentity.cs
- ContainerVisual.cs
- TimeManager.cs
- ToolBarButtonDesigner.cs
- PerformanceCounterPermission.cs
- ViewBox.cs
- SqlInternalConnection.cs
- GroupBox.cs
- SupportedAddressingMode.cs
- ResourcesGenerator.cs
- UITypeEditors.cs
- ZipPackage.cs
- XmlConverter.cs
- EditorAttributeInfo.cs
- UnsafeNativeMethods.cs
- ReverseComparer.cs
- ScrollPattern.cs
- DefaultBinder.cs
- ExpressionConverter.cs
- GetPageNumberCompletedEventArgs.cs
- DocumentPaginator.cs
- RectValueSerializer.cs
- DefaultAssemblyResolver.cs
- ToolBarTray.cs
- DataRelation.cs
- IndicCharClassifier.cs
- DataGridViewEditingControlShowingEventArgs.cs
- DataRelationCollection.cs
- PropertyFilter.cs
- ViewPort3D.cs
- ContentElement.cs
- PageTheme.cs
- FilePrompt.cs
- SqlConnection.cs
- Rss20ItemFormatter.cs
- TrackingStringDictionary.cs
- XmlNamedNodeMap.cs
- OutputCacheSection.cs
- XmlCharType.cs
- DataGridViewCellLinkedList.cs
- RubberbandSelector.cs
- Stackframe.cs
- TypeInitializationException.cs
- CodeComment.cs
- IisTraceWebEventProvider.cs
- XNodeNavigator.cs
- IDispatchConstantAttribute.cs
- GradientSpreadMethodValidation.cs