Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- AssemblyName.cs
- NavigationProperty.cs
- TextAdaptor.cs
- TableItemPatternIdentifiers.cs
- DoubleLinkList.cs
- MiniCustomAttributeInfo.cs
- SqlHelper.cs
- XmlCustomFormatter.cs
- ToolStripDropDownMenu.cs
- TextTreeUndoUnit.cs
- Matrix3DStack.cs
- ControlValuePropertyAttribute.cs
- BitSet.cs
- CacheChildrenQuery.cs
- HttpListenerPrefixCollection.cs
- WindowPattern.cs
- XamlValidatingReader.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ProtocolsConfigurationHandler.cs
- CreateSequence.cs
- ThreadExceptionEvent.cs
- TimeSpanValidatorAttribute.cs
- SqlDataSourceTableQuery.cs
- LinqDataSource.cs
- StateWorkerRequest.cs
- SystemIcmpV4Statistics.cs
- MimeWriter.cs
- Int32CollectionConverter.cs
- FeatureAttribute.cs
- XmlParserContext.cs
- WindowsToolbarItemAsMenuItem.cs
- DecimalAnimation.cs
- COAUTHIDENTITY.cs
- DoubleStorage.cs
- PopupEventArgs.cs
- ArraySegment.cs
- UIServiceHelper.cs
- WebBrowserNavigatingEventHandler.cs
- _TLSstream.cs
- ChannelSinkStacks.cs
- DataGridViewTextBoxColumn.cs
- Point.cs
- Tokenizer.cs
- BaseValidator.cs
- DbParameterCollectionHelper.cs
- ComEventsSink.cs
- DataObjectEventArgs.cs
- ExpressionNormalizer.cs
- CaseCqlBlock.cs
- GraphicsPath.cs
- WorkflowInstanceProvider.cs
- SiteMapPath.cs
- AssociativeAggregationOperator.cs
- RouteUrlExpressionBuilder.cs
- MenuItemStyleCollection.cs
- TrackingMemoryStreamFactory.cs
- XmlSchemaObjectTable.cs
- ValueUtilsSmi.cs
- KeyValuePairs.cs
- EncoderNLS.cs
- DataExpression.cs
- TargetException.cs
- _IPv6Address.cs
- AssemblyCollection.cs
- SocketAddress.cs
- DataViewListener.cs
- Quaternion.cs
- Matrix3DStack.cs
- KnownBoxes.cs
- SqlCachedBuffer.cs
- FixedTextPointer.cs
- DesignerRegionMouseEventArgs.cs
- XmlObjectSerializerReadContextComplexJson.cs
- NavigationCommands.cs
- LogArchiveSnapshot.cs
- DataMemberFieldEditor.cs
- wgx_sdk_version.cs
- ToolStripPanelRenderEventArgs.cs
- RadioButtonList.cs
- BookmarkList.cs
- ObfuscationAttribute.cs
- BitmapEffectDrawingContextState.cs
- Accessible.cs
- StateBag.cs
- TypeDescriptionProviderAttribute.cs
- DataServiceKeyAttribute.cs
- XXXOnTypeBuilderInstantiation.cs
- latinshape.cs
- Timeline.cs
- UserControlCodeDomTreeGenerator.cs
- HttpCapabilitiesEvaluator.cs
- SkipStoryboardToFill.cs
- TextPattern.cs
- IsolatedStoragePermission.cs
- TypeValidationEventArgs.cs
- DataGridViewRowCollection.cs
- TextureBrush.cs
- Win32.cs
- MachineKeySection.cs
- DynamicMethod.cs