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
- MouseWheelEventArgs.cs
- EdmSchemaError.cs
- InheritanceService.cs
- SpanIndex.cs
- PermissionRequestEvidence.cs
- Literal.cs
- ResourcePermissionBaseEntry.cs
- BaseTemplateCodeDomTreeGenerator.cs
- RadioButtonList.cs
- ActivityAction.cs
- ToolStripComboBox.cs
- OwnerDrawPropertyBag.cs
- UserNamePasswordValidator.cs
- FullTrustAssemblyCollection.cs
- AnimationException.cs
- SecurityKeyIdentifier.cs
- WebBrowserNavigatingEventHandler.cs
- TextViewSelectionProcessor.cs
- XmlIncludeAttribute.cs
- ExpandCollapsePatternIdentifiers.cs
- SequenceDesigner.cs
- Serializer.cs
- Type.cs
- PolicyDesigner.cs
- BindingCompleteEventArgs.cs
- WindowVisualStateTracker.cs
- UInt16Converter.cs
- CreateCardRequest.cs
- XsltException.cs
- RangeValuePattern.cs
- CodeAttributeArgument.cs
- InternalConfigHost.cs
- TreeNode.cs
- Int32Storage.cs
- MarshalDirectiveException.cs
- HtmlInputImage.cs
- DataContractSerializerFaultFormatter.cs
- XmlSchemaValidationException.cs
- EntityCommandDefinition.cs
- __FastResourceComparer.cs
- LineVisual.cs
- GridViewColumnHeaderAutomationPeer.cs
- SiteMapSection.cs
- WebPartMenu.cs
- DoubleAnimationUsingPath.cs
- CodeDomConfigurationHandler.cs
- FixedDSBuilder.cs
- ThreadStaticAttribute.cs
- XmlText.cs
- TreeView.cs
- DataContractSerializerOperationGenerator.cs
- IgnoreSectionHandler.cs
- DbSetClause.cs
- SymLanguageType.cs
- WebUtility.cs
- RequestContext.cs
- BufferBuilder.cs
- BamlTreeNode.cs
- EditBehavior.cs
- HttpInputStream.cs
- TemplateComponentConnector.cs
- SafeNativeMethods.cs
- WebHttpBinding.cs
- PageEventArgs.cs
- PropagatorResult.cs
- RepeaterItemEventArgs.cs
- SerializationHelper.cs
- EventListener.cs
- Soap12ProtocolReflector.cs
- InstanceValue.cs
- TextServicesLoader.cs
- Inflater.cs
- Executor.cs
- ButtonBase.cs
- Comparer.cs
- InfoCardSymmetricCrypto.cs
- SByteStorage.cs
- ColorConverter.cs
- CalendarTable.cs
- SerializationInfoEnumerator.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- UriWriter.cs
- AsyncOperation.cs
- PageTheme.cs
- RenderCapability.cs
- LogicalExpr.cs
- RegistryKey.cs
- DiscoveryService.cs
- ChtmlTextBoxAdapter.cs
- ControlBuilderAttribute.cs
- FragmentQueryProcessor.cs
- BlobPersonalizationState.cs
- SchemaInfo.cs
- InputBindingCollection.cs
- XmlSchemaComplexType.cs
- Int32CollectionValueSerializer.cs
- Scripts.cs
- CrossContextChannel.cs
- BrowserInteropHelper.cs
- ToolStrip.cs