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
- TextBoxAutomationPeer.cs
- WebServicesSection.cs
- IssuanceLicense.cs
- InternalCache.cs
- PresentationTraceSources.cs
- PerfService.cs
- SqlFacetAttribute.cs
- RawMouseInputReport.cs
- CodeTypeReferenceExpression.cs
- FilteredDataSetHelper.cs
- StyleBamlRecordReader.cs
- ProvideValueServiceProvider.cs
- DataSet.cs
- CatalogPartCollection.cs
- _ProxyChain.cs
- IfAction.cs
- CollectionEditVerbManager.cs
- CompilationRelaxations.cs
- GridItemPattern.cs
- Context.cs
- HandlerWithFactory.cs
- DataIdProcessor.cs
- EventTrigger.cs
- Ref.cs
- DeviceContext2.cs
- CachedBitmap.cs
- CommandExpr.cs
- AuthStoreRoleProvider.cs
- TextRange.cs
- Scripts.cs
- FamilyMapCollection.cs
- RowCache.cs
- ColorDialog.cs
- ObjectPropertyMapping.cs
- Point4DConverter.cs
- PinnedBufferMemoryStream.cs
- DbDataAdapter.cs
- counter.cs
- BaseUriHelper.cs
- HitTestDrawingContextWalker.cs
- InkCanvasInnerCanvas.cs
- Sql8ConformanceChecker.cs
- DataGridViewRowsAddedEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- ParameterCollection.cs
- ClonableStack.cs
- DocumentGridContextMenu.cs
- ObjectTag.cs
- DeploymentSection.cs
- MSAAWinEventWrap.cs
- HttpInputStream.cs
- SecUtil.cs
- ObjectListDesigner.cs
- HttpBrowserCapabilitiesWrapper.cs
- WindowsStartMenu.cs
- GetKeyedHashRequest.cs
- FileUpload.cs
- WindowsListViewItemCheckBox.cs
- DesignerForm.cs
- AnimationClockResource.cs
- path.cs
- ColumnWidthChangedEvent.cs
- SqlTriggerAttribute.cs
- IPGlobalProperties.cs
- ApplicationSecurityManager.cs
- DataGridPreparingCellForEditEventArgs.cs
- SqlFunctionAttribute.cs
- ClientConfigPaths.cs
- TextRunProperties.cs
- WindowsSlider.cs
- SchemaName.cs
- PrintController.cs
- RetrieveVirtualItemEventArgs.cs
- StylusOverProperty.cs
- codemethodreferenceexpression.cs
- ErrorWrapper.cs
- RootBrowserWindowProxy.cs
- ClientUriBehavior.cs
- RandomNumberGenerator.cs
- SharedDp.cs
- NetworkInformationException.cs
- HMACSHA1.cs
- ToolTipAutomationPeer.cs
- CodePageUtils.cs
- DetailsViewModeEventArgs.cs
- DocumentReferenceCollection.cs
- ResourcePermissionBase.cs
- MergeFailedEvent.cs
- SiteMapPath.cs
- DrawingVisual.cs
- CodeRegionDirective.cs
- Zone.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- BeginStoryboard.cs
- XPathNavigatorKeyComparer.cs
- IntSecurity.cs
- StaticExtensionConverter.cs
- DataService.cs
- MailHeaderInfo.cs
- LinearKeyFrames.cs