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
- DrawingGroupDrawingContext.cs
- XmlReaderSettings.cs
- ThrowHelper.cs
- RecoverInstanceLocksCommand.cs
- ScriptingSectionGroup.cs
- TypeUtil.cs
- RootProjectionNode.cs
- ObjectDataSourceDisposingEventArgs.cs
- BufferedGraphicsManager.cs
- XmlDataSource.cs
- OutputCacheProfile.cs
- MenuBase.cs
- ColorInterpolationModeValidation.cs
- SqlInternalConnectionTds.cs
- CachingHintValidation.cs
- NamespaceList.cs
- XsdValidatingReader.cs
- ShortcutKeysEditor.cs
- Empty.cs
- AbandonedMutexException.cs
- KeyboardDevice.cs
- SQLDecimalStorage.cs
- ItemsPresenter.cs
- ProfileManager.cs
- WebConfigurationHost.cs
- BuildProvider.cs
- StorageEndPropertyMapping.cs
- IndexedEnumerable.cs
- CompositeActivityTypeDescriptor.cs
- MarginCollapsingState.cs
- SystemInfo.cs
- ServiceEndpointCollection.cs
- XsltConvert.cs
- DynamicUpdateCommand.cs
- ElementHostPropertyMap.cs
- ConfigUtil.cs
- METAHEADER.cs
- Oid.cs
- PersonalizablePropertyEntry.cs
- ImmutableAssemblyCacheEntry.cs
- DictionaryEntry.cs
- WebSysDescriptionAttribute.cs
- TraceHelpers.cs
- ReadWriteControlDesigner.cs
- QueryResult.cs
- Int32RectConverter.cs
- DataColumnChangeEvent.cs
- PolyLineSegmentFigureLogic.cs
- ItemCollectionEditor.cs
- TimelineClockCollection.cs
- ObjectListCommandsPage.cs
- PlaceHolder.cs
- SiteMapHierarchicalDataSourceView.cs
- ButtonFlatAdapter.cs
- QilReplaceVisitor.cs
- GridViewRowEventArgs.cs
- WindowVisualStateTracker.cs
- SqlProviderManifest.cs
- SystemException.cs
- HttpCookie.cs
- _BasicClient.cs
- DataGridLength.cs
- LockedBorderGlyph.cs
- RelOps.cs
- ButtonBaseAdapter.cs
- AlternateView.cs
- RenameRuleObjectDialog.cs
- TextTreeExtractElementUndoUnit.cs
- EventRouteFactory.cs
- ToolStripSplitStackLayout.cs
- SQLRoleProvider.cs
- HtmlDocument.cs
- _IPv6Address.cs
- TdsEnums.cs
- DataServiceRequestOfT.cs
- MessageSecurityTokenVersion.cs
- CanonicalizationDriver.cs
- StringConcat.cs
- WindowsListView.cs
- Emitter.cs
- ModelItemKeyValuePair.cs
- ListenerAdaptersInstallComponent.cs
- XmlText.cs
- ThrowHelper.cs
- ExecutionEngineException.cs
- WorkflowOperationErrorHandler.cs
- MsmqIntegrationReceiveParameters.cs
- StreamUpgradeProvider.cs
- DispatcherEventArgs.cs
- Base64WriteStateInfo.cs
- PageRequestManager.cs
- DbConvert.cs
- Rotation3DAnimationBase.cs
- KeyPressEvent.cs
- StrokeCollectionDefaultValueFactory.cs
- TimelineGroup.cs
- SqlDependencyUtils.cs
- ApplicationBuildProvider.cs
- BrowserDefinition.cs
- FlowNode.cs