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
- InputReport.cs
- DashStyles.cs
- arabicshape.cs
- ApplicationId.cs
- TargetInvocationException.cs
- Substitution.cs
- HttpProfileBase.cs
- ComPlusThreadInitializer.cs
- ZipIOLocalFileHeader.cs
- RequiredAttributeAttribute.cs
- ErrorTableItemStyle.cs
- AdapterDictionary.cs
- DocumentXPathNavigator.cs
- BufferedGraphics.cs
- basenumberconverter.cs
- CollectionViewSource.cs
- MimeMultiPart.cs
- DefaultProxySection.cs
- DurableInstanceProvider.cs
- LassoHelper.cs
- TemplateBindingExpressionConverter.cs
- UniqueEventHelper.cs
- GeometryCollection.cs
- If.cs
- SqlMethodAttribute.cs
- XmlWrappingReader.cs
- ResumeStoryboard.cs
- HitTestFilterBehavior.cs
- ErrorStyle.cs
- EndpointInfo.cs
- FixedStringLookup.cs
- SettingsSavedEventArgs.cs
- Command.cs
- ManagedFilter.cs
- PropertyValueEditor.cs
- VisualStates.cs
- GridProviderWrapper.cs
- TransformedBitmap.cs
- LiteralControl.cs
- ResXResourceWriter.cs
- ConstrainedGroup.cs
- Crc32Helper.cs
- AudioFileOut.cs
- sortedlist.cs
- XamlVector3DCollectionSerializer.cs
- SQLDoubleStorage.cs
- XmlQualifiedName.cs
- RealProxy.cs
- VisualStyleElement.cs
- Rect.cs
- ScrollPatternIdentifiers.cs
- SegmentInfo.cs
- SubclassTypeValidator.cs
- Setter.cs
- ExpressionConverter.cs
- WebHeaderCollection.cs
- ParameterBuilder.cs
- XmlILModule.cs
- EdmValidator.cs
- AnonymousIdentificationModule.cs
- ThreadAttributes.cs
- StyleSelector.cs
- UserMapPath.cs
- StaticSiteMapProvider.cs
- IDispatchConstantAttribute.cs
- DbgUtil.cs
- SerializableAuthorizationContext.cs
- DllNotFoundException.cs
- XmlSerializerFactory.cs
- CodeExpressionCollection.cs
- Normalization.cs
- TimerElapsedEvenArgs.cs
- ProcessingInstructionAction.cs
- DataViewManager.cs
- XslAstAnalyzer.cs
- SqlTransaction.cs
- Group.cs
- DataColumnMappingCollection.cs
- FixUpCollection.cs
- PopOutPanel.cs
- SqlPersonalizationProvider.cs
- BitConverter.cs
- VirtualizedItemProviderWrapper.cs
- RangeValueProviderWrapper.cs
- OrderedParallelQuery.cs
- TreeViewDesigner.cs
- ScrollProperties.cs
- XPathScanner.cs
- HandlerFactoryCache.cs
- WebConfigurationHostFileChange.cs
- XmlSchemaSimpleTypeList.cs
- ValueTypeFieldReference.cs
- EventListenerClientSide.cs
- HandlerBase.cs
- XmlWrappingReader.cs
- PropertyGroupDescription.cs
- NominalTypeEliminator.cs
- XmlAttributeCollection.cs
- ListenerConstants.cs
- GridViewDeleteEventArgs.cs