Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / StringPropertyBuilder.cs / 1305376 / 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
- ValidationRuleCollection.cs
- ConnectionOrientedTransportChannelListener.cs
- RC2.cs
- CompiledQueryCacheKey.cs
- Events.cs
- TreeNodeBinding.cs
- DbConvert.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- SimpleLine.cs
- AnnotationHelper.cs
- XmlNotation.cs
- AgileSafeNativeMemoryHandle.cs
- DefaultEvaluationContext.cs
- TemplateBuilder.cs
- ResourceBinder.cs
- Missing.cs
- OletxResourceManager.cs
- D3DImage.cs
- TableHeaderCell.cs
- TreeNodeBindingCollection.cs
- ViewgenContext.cs
- ToolStripManager.cs
- ISFTagAndGuidCache.cs
- DataGridViewRowsRemovedEventArgs.cs
- SkewTransform.cs
- DocumentXmlWriter.cs
- PagerSettings.cs
- SinglePageViewer.cs
- EventLogPermission.cs
- ConsoleCancelEventArgs.cs
- XmlAttributeProperties.cs
- EventDescriptorCollection.cs
- ReservationCollection.cs
- NotifyIcon.cs
- followingsibling.cs
- WindowsAuthenticationEventArgs.cs
- AsymmetricSignatureFormatter.cs
- PhoneCall.cs
- EntityDataSource.cs
- CanonicalXml.cs
- Crc32Helper.cs
- TrackingRecord.cs
- InstanceLockQueryResult.cs
- EdmToObjectNamespaceMap.cs
- FieldNameLookup.cs
- SystemEvents.cs
- ImpersonationContext.cs
- TextCompositionManager.cs
- DownloadProgressEventArgs.cs
- handlecollector.cs
- ResetableIterator.cs
- DesignerVerbCollection.cs
- XPathDocumentNavigator.cs
- SHA1.cs
- XAMLParseException.cs
- LocationReferenceEnvironment.cs
- AdornedElementPlaceholder.cs
- DrawToolTipEventArgs.cs
- ClientSettingsSection.cs
- Ray3DHitTestResult.cs
- QueryStringConverter.cs
- DataGridViewCellStyle.cs
- SubMenuStyle.cs
- ListDictionary.cs
- WebEventTraceProvider.cs
- StateMachineWorkflow.cs
- MultipleViewProviderWrapper.cs
- XmlConvert.cs
- LinearGradientBrush.cs
- FileLevelControlBuilderAttribute.cs
- KnownBoxes.cs
- InlineCollection.cs
- EventLog.cs
- Vars.cs
- CompiledQueryCacheEntry.cs
- ResourceSetExpression.cs
- BadImageFormatException.cs
- SqlRewriteScalarSubqueries.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- SystemIcmpV4Statistics.cs
- CipherData.cs
- DataGridColumnCollection.cs
- BuilderInfo.cs
- sqlmetadatafactory.cs
- DecimalStorage.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- ToolStripDropTargetManager.cs
- StorageInfo.cs
- SemanticValue.cs
- TrackingCondition.cs
- RuntimeIdentifierPropertyAttribute.cs
- Logging.cs
- LinqDataSourceDeleteEventArgs.cs
- FixedTextView.cs
- AbandonedMutexException.cs
- ExpressionLexer.cs
- TrackingConditionCollection.cs
- PageWrapper.cs
- User.cs
- TextElement.cs