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
- ResourceKey.cs
- UnmanagedMemoryStreamWrapper.cs
- GlyphRunDrawing.cs
- CmsUtils.cs
- ComponentResourceKey.cs
- AuthorizationPolicyTypeElementCollection.cs
- MultiTrigger.cs
- StatusBar.cs
- CheckBoxStandardAdapter.cs
- DataGridViewCellStyleBuilderDialog.cs
- Compiler.cs
- VirtualDirectoryMappingCollection.cs
- DomNameTable.cs
- BindingCollection.cs
- RouteItem.cs
- UdpAnnouncementEndpoint.cs
- BindingValueChangedEventArgs.cs
- SqlNodeAnnotations.cs
- XmlAtomicValue.cs
- HtmlTable.cs
- WSMessageEncoding.cs
- ToolStripDropDownButton.cs
- ParallelDesigner.cs
- NetStream.cs
- designeractionbehavior.cs
- ClaimComparer.cs
- MouseEvent.cs
- DataGridViewRowEventArgs.cs
- WinEventWrap.cs
- DateTimeParse.cs
- ApplicationSecurityManager.cs
- CngProperty.cs
- BufferedMessageWriter.cs
- DataGridViewControlCollection.cs
- AccessDataSource.cs
- CoreSwitches.cs
- CollectionEditorDialog.cs
- DataTable.cs
- MissingMemberException.cs
- UseLicense.cs
- UpdatableGenericsFeature.cs
- Item.cs
- TextSelectionProcessor.cs
- ClientProxyGenerator.cs
- ObjectParameterCollection.cs
- ResourceProviderFactory.cs
- XmlReflectionImporter.cs
- PublishLicense.cs
- DesignerTransaction.cs
- UInt64Storage.cs
- FixedFlowMap.cs
- IDQuery.cs
- UndoManager.cs
- XmlSchemaComplexContentRestriction.cs
- CalendarDesigner.cs
- PartBasedPackageProperties.cs
- CalendarDay.cs
- MarkupCompilePass2.cs
- SqlCaseSimplifier.cs
- MemberJoinTreeNode.cs
- RegisteredArrayDeclaration.cs
- RelationshipSet.cs
- FileNotFoundException.cs
- RelatedImageListAttribute.cs
- MethodRental.cs
- CompositeActivityTypeDescriptor.cs
- IDReferencePropertyAttribute.cs
- TrackingMemoryStreamFactory.cs
- SimpleHandlerFactory.cs
- ConfigXmlCDataSection.cs
- DataGridParentRows.cs
- SqlCommandBuilder.cs
- OleDbParameter.cs
- HttpDebugHandler.cs
- KeyValueSerializer.cs
- PropertyChangingEventArgs.cs
- HMAC.cs
- OleDbException.cs
- HTTPRemotingHandler.cs
- TrackBar.cs
- ColorTransformHelper.cs
- NegotiateStream.cs
- SHA256Managed.cs
- ProjectionPath.cs
- ResourceReferenceKeyNotFoundException.cs
- ApplicationSecurityManager.cs
- GridEntryCollection.cs
- GraphicsContainer.cs
- BitmapScalingModeValidation.cs
- SpecialTypeDataContract.cs
- ResourceKey.cs
- XmlSchemaExporter.cs
- SelectionHighlightInfo.cs
- nulltextcontainer.cs
- EntityDataReader.cs
- ObjectDataSource.cs
- Context.cs
- Camera.cs
- DateTimeOffsetStorage.cs
- CompModHelpers.cs