Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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
- SecurityException.cs
- ToolStripItem.cs
- CaseStatement.cs
- EntityFrameworkVersions.cs
- DataColumnMappingCollection.cs
- RegexGroupCollection.cs
- TableItemStyle.cs
- DataGridViewRowStateChangedEventArgs.cs
- Pair.cs
- DateTimeSerializationSection.cs
- XmlHierarchicalDataSourceView.cs
- SchemaCollectionCompiler.cs
- CategoryAttribute.cs
- DeviceContexts.cs
- XAMLParseException.cs
- QueryAccessibilityHelpEvent.cs
- SmtpException.cs
- PropertyGridCommands.cs
- TextSpan.cs
- SafeProcessHandle.cs
- IImplicitResourceProvider.cs
- ConfigsHelper.cs
- InstalledFontCollection.cs
- DataControlLinkButton.cs
- Transform3DCollection.cs
- SerializerDescriptor.cs
- EncodingNLS.cs
- TextBox.cs
- Stack.cs
- InternalConfigEventArgs.cs
- BamlResourceContent.cs
- PackageProperties.cs
- ExtendedProperty.cs
- BufferModesCollection.cs
- TimelineGroup.cs
- ConvertEvent.cs
- DataServiceContext.cs
- CapabilitiesPattern.cs
- Window.cs
- EllipticalNodeOperations.cs
- EntitySetRetriever.cs
- SecurityRuntime.cs
- CopyAttributesAction.cs
- HTMLTagNameToTypeMapper.cs
- ConstraintStruct.cs
- FixedSOMElement.cs
- AutomationPropertyInfo.cs
- WebPartsPersonalizationAuthorization.cs
- SpecularMaterial.cs
- NamedObject.cs
- ClientSettings.cs
- EndEvent.cs
- SecurityDocument.cs
- PrivateFontCollection.cs
- TableAutomationPeer.cs
- SetIndexBinder.cs
- BufferedWebEventProvider.cs
- Logging.cs
- PropertyGridCommands.cs
- Int32RectValueSerializer.cs
- ConfigXmlWhitespace.cs
- DbConnectionPool.cs
- DataGridViewLinkColumn.cs
- EditBehavior.cs
- InkPresenter.cs
- SecurityUtils.cs
- InkCanvasFeedbackAdorner.cs
- HostedElements.cs
- ComEventsHelper.cs
- ScrollChangedEventArgs.cs
- SimplePropertyEntry.cs
- NodeFunctions.cs
- InputQueue.cs
- DependencyPropertyDescriptor.cs
- DetailsViewInsertedEventArgs.cs
- HwndProxyElementProvider.cs
- TypeConverterMarkupExtension.cs
- LongValidatorAttribute.cs
- BitmapSizeOptions.cs
- RequestCacheManager.cs
- DeflateStream.cs
- InternalConfigRoot.cs
- TraversalRequest.cs
- ResourceFallbackManager.cs
- SoapMessage.cs
- UntrustedRecipientException.cs
- IntSecurity.cs
- Trace.cs
- XsdBuilder.cs
- ResolveDuplex11AsyncResult.cs
- DebugViewWriter.cs
- XmlSecureResolver.cs
- SerializationObjectManager.cs
- PtsContext.cs
- RenderOptions.cs
- tooltip.cs
- Slider.cs
- SecurityPermission.cs
- TextTreeFixupNode.cs
- TypeForwardedToAttribute.cs