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
- HttpStreamXmlDictionaryWriter.cs
- FontResourceCache.cs
- CustomValidator.cs
- HelpProvider.cs
- HostProtectionException.cs
- Size.cs
- ReferencedType.cs
- XmlResolver.cs
- AvTrace.cs
- TreeViewImageKeyConverter.cs
- AutomationIdentifierGuids.cs
- SessionStateContainer.cs
- hebrewshape.cs
- XPathException.cs
- CategoryAttribute.cs
- EqualityComparer.cs
- assertwrapper.cs
- Dynamic.cs
- SqlTransaction.cs
- FrameworkContentElement.cs
- SettingsAttributeDictionary.cs
- WebCategoryAttribute.cs
- Memoizer.cs
- RTLAwareMessageBox.cs
- ToolStripMenuItem.cs
- ChineseLunisolarCalendar.cs
- ObsoleteAttribute.cs
- HttpCapabilitiesEvaluator.cs
- TreeNodeSelectionProcessor.cs
- NameValueFileSectionHandler.cs
- StringBuilder.cs
- TextSpan.cs
- ErrorWrapper.cs
- Matrix3D.cs
- PageHandlerFactory.cs
- AuthStoreRoleProvider.cs
- Tokenizer.cs
- DataSourceBooleanViewSchemaConverter.cs
- TransformProviderWrapper.cs
- PrePrepareMethodAttribute.cs
- CodeCompiler.cs
- ProgressBarAutomationPeer.cs
- DBSqlParserTable.cs
- NativeMethods.cs
- Matrix3DConverter.cs
- RenamedEventArgs.cs
- ColorAnimationBase.cs
- ObjectToIdCache.cs
- UnauthorizedWebPart.cs
- EntityConnectionStringBuilder.cs
- HtmlSelectionListAdapter.cs
- ObjectListCommandEventArgs.cs
- MailDefinitionBodyFileNameEditor.cs
- WmlPanelAdapter.cs
- RightsManagementEncryptedStream.cs
- InternalEnumValidatorAttribute.cs
- KnownBoxes.cs
- QueryPageSettingsEventArgs.cs
- ColorConvertedBitmap.cs
- DefaultCommandConverter.cs
- XPathNodePointer.cs
- SynchronizingStream.cs
- SrgsRulesCollection.cs
- VectorConverter.cs
- ComAdminWrapper.cs
- PropertyGroupDescription.cs
- ExpressionEditorAttribute.cs
- DelayDesigner.cs
- SelectionUIService.cs
- Underline.cs
- MemberBinding.cs
- InProcStateClientManager.cs
- DecoderBestFitFallback.cs
- X509Utils.cs
- followingsibling.cs
- StateMachineWorkflow.cs
- SchemaName.cs
- _emptywebproxy.cs
- Double.cs
- IdentityManager.cs
- If.cs
- FamilyTypeface.cs
- CardSpaceException.cs
- DataGridViewElement.cs
- Underline.cs
- TypeUtils.cs
- sapiproxy.cs
- RegistryKey.cs
- QilGenerator.cs
- HtmlInputCheckBox.cs
- ConfigurationCollectionAttribute.cs
- SelectionEditor.cs
- PreparingEnlistment.cs
- QilXmlReader.cs
- ByteStreamGeometryContext.cs
- SqlGatherConsumedAliases.cs
- DocumentViewerBaseAutomationPeer.cs
- BinaryConverter.cs
- PrimitiveType.cs
- SessionIDManager.cs