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
- HandlerBase.cs
- SchemaManager.cs
- PropertyDescriptorGridEntry.cs
- ExpressionConverter.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- PenThread.cs
- smtpconnection.cs
- TreeNodeBindingCollection.cs
- ControlBindingsCollection.cs
- ParameterRetriever.cs
- ToolboxItemLoader.cs
- DirtyTextRange.cs
- SystemWebExtensionsSectionGroup.cs
- MessageBuilder.cs
- IPAddressCollection.cs
- Serializer.cs
- CodeSubDirectory.cs
- OrderPreservingPipeliningMergeHelper.cs
- IOThreadTimer.cs
- TypedTableGenerator.cs
- HtmlToClrEventProxy.cs
- RpcAsyncResult.cs
- AccessDataSourceView.cs
- LicFileLicenseProvider.cs
- WorkflowPersistenceContext.cs
- InputProcessorProfilesLoader.cs
- PropertyHelper.cs
- NamespaceEmitter.cs
- RuntimeWrappedException.cs
- CharacterMetrics.cs
- Predicate.cs
- AppliedDeviceFiltersDialog.cs
- DynamicControl.cs
- SHA1CryptoServiceProvider.cs
- BackgroundFormatInfo.cs
- SafeSecurityHelper.cs
- AudioBase.cs
- WebPartMenuStyle.cs
- FrameDimension.cs
- DataGridState.cs
- InternalException.cs
- Array.cs
- ModulesEntry.cs
- ClientOptions.cs
- AssemblyName.cs
- SafeNativeMethods.cs
- Barrier.cs
- RotateTransform.cs
- CatalogZoneBase.cs
- MulticastDelegate.cs
- OutArgument.cs
- HiddenFieldPageStatePersister.cs
- BackgroundWorker.cs
- FontConverter.cs
- CrossAppDomainChannel.cs
- pingexception.cs
- TimeEnumHelper.cs
- DbModificationClause.cs
- AstTree.cs
- HttpConfigurationContext.cs
- UriScheme.cs
- CachedBitmap.cs
- DataServiceHost.cs
- IRCollection.cs
- GridViewUpdateEventArgs.cs
- GridViewUpdateEventArgs.cs
- FileRecordSequenceCompletedAsyncResult.cs
- WinEventTracker.cs
- EraserBehavior.cs
- UIElementIsland.cs
- DiscreteKeyFrames.cs
- GridView.cs
- ConnectionAcceptor.cs
- ResourcesBuildProvider.cs
- WebServiceHostFactory.cs
- ContentTextAutomationPeer.cs
- NameValuePermission.cs
- XmlNodeChangedEventArgs.cs
- XmlLoader.cs
- NameNode.cs
- BindValidationContext.cs
- DataObject.cs
- WebUtil.cs
- TextEditorParagraphs.cs
- StateBag.cs
- ThemeableAttribute.cs
- OracleRowUpdatingEventArgs.cs
- TableColumn.cs
- CompilerResults.cs
- AutomationPropertyInfo.cs
- PersonalizationProviderHelper.cs
- BamlTreeNode.cs
- TextServicesCompartment.cs
- RefreshEventArgs.cs
- ValueCollectionParameterReader.cs
- WebPartEditVerb.cs
- UIElement3D.cs
- BamlMapTable.cs
- VScrollProperties.cs
- MetadataFile.cs