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
- SocketException.cs
- DBParameter.cs
- Update.cs
- StringStorage.cs
- OrCondition.cs
- SeekableMessageNavigator.cs
- LocalValueEnumerator.cs
- HttpApplicationStateWrapper.cs
- RowToFieldTransformer.cs
- EUCJPEncoding.cs
- DataPagerFieldCollection.cs
- PackagingUtilities.cs
- ControlCommandSet.cs
- namescope.cs
- PeerEndPoint.cs
- VisualBasicSettingsHandler.cs
- ExecutionContext.cs
- MenuDesigner.cs
- SrgsText.cs
- LinkLabelLinkClickedEvent.cs
- PixelFormats.cs
- PointHitTestParameters.cs
- ClaimSet.cs
- ComplexPropertyEntry.cs
- BevelBitmapEffect.cs
- NativeMethods.cs
- WebPart.cs
- OracleMonthSpan.cs
- UrlAuthFailedErrorFormatter.cs
- PeerInvitationResponse.cs
- FileLogRecordEnumerator.cs
- RawKeyboardInputReport.cs
- ProvidersHelper.cs
- Version.cs
- EnumMemberAttribute.cs
- DrawingVisual.cs
- DataGridViewImageCell.cs
- DbParameterHelper.cs
- ValidationSummary.cs
- DataGridViewRowsRemovedEventArgs.cs
- PropertyContainer.cs
- KeyNotFoundException.cs
- Triangle.cs
- Aggregates.cs
- EdmComplexTypeAttribute.cs
- CapabilitiesPattern.cs
- DataSet.cs
- Regex.cs
- BinaryFormatterWriter.cs
- BeginStoryboard.cs
- InheritanceService.cs
- TreeWalker.cs
- XmlElementCollection.cs
- SmiRecordBuffer.cs
- ExtensionWindow.cs
- _ConnectOverlappedAsyncResult.cs
- DefinitionUpdate.cs
- PeerCollaborationPermission.cs
- OleDbConnectionFactory.cs
- UnauthorizedWebPart.cs
- MSAANativeProvider.cs
- TraceContextRecord.cs
- XmlSchemaAttribute.cs
- UpdateCommand.cs
- FileInfo.cs
- SystemIPv4InterfaceProperties.cs
- WebRequestModulesSection.cs
- RemotingException.cs
- PersonalizationEntry.cs
- cookiecollection.cs
- AppModelKnownContentFactory.cs
- QueryResults.cs
- RoutedEventValueSerializer.cs
- ConnectionInterfaceCollection.cs
- DecimalConstantAttribute.cs
- DataGridCaption.cs
- CustomPopupPlacement.cs
- InlineCollection.cs
- XmlDigitalSignatureProcessor.cs
- DatePickerDateValidationErrorEventArgs.cs
- TextViewSelectionProcessor.cs
- TemplatedAdorner.cs
- UnsafeNativeMethodsPenimc.cs
- DataGrid.cs
- LookupNode.cs
- TagPrefixAttribute.cs
- CrossSiteScriptingValidation.cs
- AlternationConverter.cs
- DecimalAnimationBase.cs
- IPHostEntry.cs
- SamlAssertionKeyIdentifierClause.cs
- InkCanvasFeedbackAdorner.cs
- GlobalItem.cs
- MimeWriter.cs
- PresentationSource.cs
- OleDbInfoMessageEvent.cs
- XPathAxisIterator.cs
- NavigationWindow.cs
- Matrix.cs
- DropDownButton.cs