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
- UpdatePanelControlTrigger.cs
- CellTreeNodeVisitors.cs
- CookieParameter.cs
- DataViewListener.cs
- TreeViewImageGenerator.cs
- ListManagerBindingsCollection.cs
- ACL.cs
- ListBoxItemAutomationPeer.cs
- BaseHashHelper.cs
- Path.cs
- WeakReferenceList.cs
- WebBrowserNavigatedEventHandler.cs
- VirtualizedContainerService.cs
- Pen.cs
- SafeNativeMemoryHandle.cs
- MenuItemBindingCollection.cs
- SafeNativeMethodsCLR.cs
- TdsEnums.cs
- FrameworkPropertyMetadata.cs
- CodeCommentStatement.cs
- handlecollector.cs
- IdentityNotMappedException.cs
- NullableBoolConverter.cs
- StringStorage.cs
- SoapSchemaExporter.cs
- SoapHttpTransportImporter.cs
- ContentHostHelper.cs
- ButtonField.cs
- WindowsImpersonationContext.cs
- DocComment.cs
- PolyLineSegmentFigureLogic.cs
- JsonQueryStringConverter.cs
- CursorConverter.cs
- ObjectDataSourceFilteringEventArgs.cs
- MessageHeaders.cs
- AccessDataSourceView.cs
- SecurityException.cs
- HttpCookieCollection.cs
- _NegotiateClient.cs
- Condition.cs
- NTAccount.cs
- ProcessModelInfo.cs
- ControlBindingsConverter.cs
- StrokeNodeEnumerator.cs
- WebPartConnectionCollection.cs
- Encoder.cs
- TreeViewImageIndexConverter.cs
- DataFormats.cs
- MetadataPropertyvalue.cs
- PointAnimationUsingPath.cs
- WebPartActionVerb.cs
- Stacktrace.cs
- TcpAppDomainProtocolHandler.cs
- SynchronizedMessageSource.cs
- XamlStyleSerializer.cs
- LoginView.cs
- InternalConfigRoot.cs
- AsyncWaitHandle.cs
- SqlRetyper.cs
- ClipboardProcessor.cs
- ExpandCollapsePattern.cs
- XPathItem.cs
- HttpListenerContext.cs
- DataErrorValidationRule.cs
- TextServicesCompartment.cs
- wgx_commands.cs
- CodeSnippetCompileUnit.cs
- ItemList.cs
- SafeFileMappingHandle.cs
- ExpressionBinding.cs
- wgx_exports.cs
- AncestorChangedEventArgs.cs
- DocobjHost.cs
- CodeChecksumPragma.cs
- TextTreeTextNode.cs
- TypeGeneratedEventArgs.cs
- MatrixConverter.cs
- CompilerErrorCollection.cs
- SelectorAutomationPeer.cs
- ChooseAction.cs
- XmlNodeChangedEventArgs.cs
- SafeNativeMethodsCLR.cs
- SqlTrackingWorkflowInstance.cs
- BypassElement.cs
- ToolStripPanelRow.cs
- ControlAdapter.cs
- ConfigXmlText.cs
- EntityTypeEmitter.cs
- Serializer.cs
- BStrWrapper.cs
- DigestTraceRecordHelper.cs
- HandoffBehavior.cs
- MemoryStream.cs
- RtfControls.cs
- SqlClientWrapperSmiStreamChars.cs
- WindowsRegion.cs
- RunInstallerAttribute.cs
- SapiRecoInterop.cs
- EditorPart.cs
- SafeNativeMethods.cs