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
- FormattedTextSymbols.cs
- MD5HashHelper.cs
- TraceLevelStore.cs
- SecurityToken.cs
- ManualResetEvent.cs
- FormsAuthenticationUserCollection.cs
- ToolBar.cs
- OutputScope.cs
- SortKey.cs
- Clipboard.cs
- RegexCompiler.cs
- RelatedEnd.cs
- DateTimeOffset.cs
- CommonEndpointBehaviorElement.cs
- RuleElement.cs
- InProcStateClientManager.cs
- SubMenuStyle.cs
- VariableExpressionConverter.cs
- OleDbSchemaGuid.cs
- BaseParser.cs
- RegexNode.cs
- CachedTypeface.cs
- CursorConverter.cs
- CompilerCollection.cs
- ConnectionInterfaceCollection.cs
- TraceRecord.cs
- LogoValidationException.cs
- InfoCardBaseException.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- LayoutEngine.cs
- OutputCacheSection.cs
- ToolbarAUtomationPeer.cs
- KeyBinding.cs
- Unit.cs
- FileInfo.cs
- ToolStripEditorManager.cs
- SimpleRecyclingCache.cs
- safelinkcollection.cs
- TimeSpanValidator.cs
- KeyInfo.cs
- AttachmentCollection.cs
- Propagator.Evaluator.cs
- EventRecordWrittenEventArgs.cs
- PersonalizationProviderCollection.cs
- ApplicationHost.cs
- DataBindingExpressionBuilder.cs
- GraphicsState.cs
- RelatedView.cs
- InteropBitmapSource.cs
- GroupItem.cs
- ExpandCollapseProviderWrapper.cs
- LocalizableResourceBuilder.cs
- GridEntryCollection.cs
- ExpressionVisitor.cs
- OleDbRowUpdatingEvent.cs
- BooleanToVisibilityConverter.cs
- TypeGeneratedEventArgs.cs
- TemplateKey.cs
- MeshGeometry3D.cs
- StorageEntitySetMapping.cs
- XmlSerializerFactory.cs
- DataGridViewHitTestInfo.cs
- DataGridViewImageCell.cs
- BasePattern.cs
- QilTargetType.cs
- DataGridViewTextBoxCell.cs
- EasingKeyFrames.cs
- ArrayTypeMismatchException.cs
- QuadraticEase.cs
- SystemIcmpV4Statistics.cs
- FileVersionInfo.cs
- ADMembershipUser.cs
- TimestampInformation.cs
- ConvertersCollection.cs
- MsmqIntegrationMessageProperty.cs
- DeferredReference.cs
- OdbcFactory.cs
- HuffModule.cs
- SQLRoleProvider.cs
- XamlPathDataSerializer.cs
- MemberMaps.cs
- WindowsGraphics2.cs
- StorageBasedPackageProperties.cs
- FieldBuilder.cs
- ReadWriteControlDesigner.cs
- CryptographicAttribute.cs
- WmfPlaceableFileHeader.cs
- ResourceDescriptionAttribute.cs
- BamlRecordReader.cs
- BitmapFrame.cs
- DataRecordObjectView.cs
- RtfFormatStack.cs
- CodeMemberField.cs
- MetaChildrenColumn.cs
- IgnoreFlushAndCloseStream.cs
- BufferedGraphicsManager.cs
- SourceFileBuildProvider.cs
- RequestTimeoutManager.cs
- Win32SafeHandles.cs
- TextCompositionEventArgs.cs