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
- EdmFunction.cs
- BackStopAuthenticationModule.cs
- OdbcConnectionFactory.cs
- assertwrapper.cs
- SymbolTable.cs
- PropertyCollection.cs
- QueryAsyncResult.cs
- Sorting.cs
- TraceContextEventArgs.cs
- HyperLinkDataBindingHandler.cs
- PropertyFilter.cs
- WebControlsSection.cs
- TdsParameterSetter.cs
- CanonicalFontFamilyReference.cs
- HttpServerUtilityWrapper.cs
- ServiceDurableInstanceContextProvider.cs
- LogRecordSequence.cs
- PathParser.cs
- EventSetterHandlerConverter.cs
- QilPatternFactory.cs
- ChannelEndpointElement.cs
- DecoderNLS.cs
- HttpRuntimeSection.cs
- CodeDirectionExpression.cs
- WorkerRequest.cs
- PersonalizationEntry.cs
- AndMessageFilter.cs
- ControlBuilderAttribute.cs
- InkCanvas.cs
- SystemIPv6InterfaceProperties.cs
- XmlDownloadManager.cs
- Scene3D.cs
- TreeNodeBindingCollection.cs
- FilterableAttribute.cs
- XmlSchemaSequence.cs
- ApplyTemplatesAction.cs
- BinaryConverter.cs
- rsa.cs
- OptimalBreakSession.cs
- BaseDataListComponentEditor.cs
- MaskedTextBoxDesignerActionList.cs
- PackageRelationshipCollection.cs
- EUCJPEncoding.cs
- PrintDocument.cs
- CounterCreationDataCollection.cs
- COM2ComponentEditor.cs
- WebUtility.cs
- Atom10FormatterFactory.cs
- SiteMapNodeCollection.cs
- ThreadSafeList.cs
- HashAlgorithm.cs
- AbstractExpressions.cs
- HttpDebugHandler.cs
- StorageMappingFragment.cs
- SingleConverter.cs
- UpnEndpointIdentity.cs
- Pts.cs
- FormsAuthenticationModule.cs
- DelimitedListTraceListener.cs
- DataServiceConfiguration.cs
- Int32.cs
- CompilerResults.cs
- OdbcConnection.cs
- TypeUtil.cs
- ToolStripStatusLabel.cs
- DataGridColumnHeaderCollection.cs
- CacheAxisQuery.cs
- Journaling.cs
- FormsAuthentication.cs
- UncommonField.cs
- HttpContextBase.cs
- milrender.cs
- XDeferredAxisSource.cs
- DesignerActionHeaderItem.cs
- Calendar.cs
- TemplateBindingExtensionConverter.cs
- FileDialog.cs
- StartUpEventArgs.cs
- WebPartZone.cs
- Options.cs
- MaskedTextProvider.cs
- ExpressionBuilder.cs
- SapiRecognizer.cs
- NotConverter.cs
- PopupRootAutomationPeer.cs
- ResXFileRef.cs
- TransactionFilter.cs
- FileCodeGroup.cs
- ListItemParagraph.cs
- CodeIterationStatement.cs
- HttpServerChannel.cs
- XsdCachingReader.cs
- UnknownBitmapEncoder.cs
- FontDialog.cs
- BinaryFormatter.cs
- CompositeFontInfo.cs
- DivideByZeroException.cs
- BitmapPalettes.cs
- SystemIcmpV6Statistics.cs
- _OSSOCK.cs