Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CodeCatchClause.cs
- GridViewUpdatedEventArgs.cs
- BindingsCollection.cs
- HWStack.cs
- VisualBrush.cs
- MemberDomainMap.cs
- GeneralTransform3DTo2DTo3D.cs
- PrincipalPermission.cs
- ContainerAction.cs
- DiscoveryDocumentLinksPattern.cs
- TextElementEditingBehaviorAttribute.cs
- TextRenderer.cs
- ErrorView.xaml.cs
- XmlTypeAttribute.cs
- BrushValueSerializer.cs
- DesignBindingPropertyDescriptor.cs
- SqlClientFactory.cs
- HttpModuleAction.cs
- ImmutableCollection.cs
- DispatcherOperation.cs
- __Error.cs
- DataConnectionHelper.cs
- BindingsCollection.cs
- KeyValueConfigurationCollection.cs
- OpCellTreeNode.cs
- ZipIOExtraField.cs
- XmlDeclaration.cs
- XmlSchemaElement.cs
- ZipFileInfo.cs
- HealthMonitoringSectionHelper.cs
- EmptyEnumerable.cs
- RegistrationServices.cs
- Rule.cs
- CollectionType.cs
- ReadOnlyDictionary.cs
- OpCellTreeNode.cs
- SelectiveScrollingGrid.cs
- AppModelKnownContentFactory.cs
- XPathNavigatorReader.cs
- StaticContext.cs
- EnumUnknown.cs
- RightsManagementPermission.cs
- AnchoredBlock.cs
- PageOrientation.cs
- MonthCalendar.cs
- SmtpCommands.cs
- SecurityState.cs
- DynamicPropertyHolder.cs
- ProfilePropertySettingsCollection.cs
- InputLangChangeEvent.cs
- XmlSchemaInfo.cs
- SocketInformation.cs
- TableHeaderCell.cs
- IPipelineRuntime.cs
- HtmlMeta.cs
- Geometry.cs
- DataPagerFieldItem.cs
- RelationshipWrapper.cs
- CapacityStreamGeometryContext.cs
- TextCompositionEventArgs.cs
- DataObjectSettingDataEventArgs.cs
- TimerEventSubscriptionCollection.cs
- VerticalAlignConverter.cs
- WebServicesSection.cs
- ProfileGroupSettings.cs
- OutputCacheProfile.cs
- SecurityRuntime.cs
- SimpleTypesSurrogate.cs
- MergeExecutor.cs
- StateMachineWorkflow.cs
- CheckBox.cs
- MetadataItem.cs
- MatrixConverter.cs
- XmlSequenceWriter.cs
- StateDesigner.Layouts.cs
- GridViewEditEventArgs.cs
- XmlDocument.cs
- StylusPoint.cs
- DataContractJsonSerializer.cs
- TypedElement.cs
- DbBuffer.cs
- DBBindings.cs
- Selector.cs
- HealthMonitoringSectionHelper.cs
- WorkflowRuntimeBehavior.cs
- DataServiceConfiguration.cs
- WebPartActionVerb.cs
- DesignUtil.cs
- SortedList.cs
- ElementHostPropertyMap.cs
- Soap12ProtocolImporter.cs
- SafeSecurityHandles.cs
- QueueProcessor.cs
- DispatcherTimer.cs
- hwndwrapper.cs
- Style.cs
- FontSizeConverter.cs
- TextRenderingModeValidation.cs
- MulticastIPAddressInformationCollection.cs