Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileDialog.cs
- RootContext.cs
- MimeMapping.cs
- DataContractJsonSerializer.cs
- XamlParser.cs
- IsolatedStorageException.cs
- MessageQueueEnumerator.cs
- AncillaryOps.cs
- StringCollection.cs
- ScalarOps.cs
- WebPartTracker.cs
- InputLangChangeEvent.cs
- HtmlAnchor.cs
- DataBoundControlDesigner.cs
- SmtpLoginAuthenticationModule.cs
- StackBuilderSink.cs
- IOException.cs
- HttpPostedFile.cs
- OleDbRowUpdatedEvent.cs
- Effect.cs
- SafeSecurityHandles.cs
- LockRecoveryTask.cs
- InkCanvasFeedbackAdorner.cs
- XmlEntity.cs
- HttpDictionary.cs
- InvalidOperationException.cs
- SqlReorderer.cs
- ZoneButton.cs
- DESCryptoServiceProvider.cs
- DelegateSerializationHolder.cs
- ChangeTracker.cs
- CellIdBoolean.cs
- PointCollectionConverter.cs
- XamlParser.cs
- HitTestWithPointDrawingContextWalker.cs
- TextContainerHelper.cs
- PropertyGridView.cs
- DataGridViewLinkColumn.cs
- BaseTemplatedMobileComponentEditor.cs
- SqlWebEventProvider.cs
- InputDevice.cs
- DataSourceProvider.cs
- FontStretchConverter.cs
- State.cs
- FilterException.cs
- CreateUserWizardStep.cs
- WebPartEditVerb.cs
- LinkConverter.cs
- HtmlCalendarAdapter.cs
- BindingManagerDataErrorEventArgs.cs
- TraceContextRecord.cs
- RewritingValidator.cs
- NetNamedPipeSecurityMode.cs
- BaseEntityWrapper.cs
- PaginationProgressEventArgs.cs
- ISAPIWorkerRequest.cs
- StateMachineExecutionState.cs
- TransactionState.cs
- DataGridViewLinkCell.cs
- DetailsViewDeleteEventArgs.cs
- AutoResizedEvent.cs
- StreamingContext.cs
- DelimitedListTraceListener.cs
- MailMessage.cs
- ArrayWithOffset.cs
- Listbox.cs
- GridViewRowPresenterBase.cs
- ToolStripContainerActionList.cs
- CommandHelper.cs
- BaseWebProxyFinder.cs
- ArrayList.cs
- ProtocolViolationException.cs
- DbProviderFactories.cs
- AssertFilter.cs
- DocumentApplicationJournalEntry.cs
- PerformanceCounterManager.cs
- OutputCacheProfile.cs
- ButtonBase.cs
- TextFormatter.cs
- iisPickupDirectory.cs
- CompressionTracing.cs
- securitycriticaldata.cs
- PaperSource.cs
- SoapObjectInfo.cs
- ToolStripStatusLabel.cs
- MarshalByValueComponent.cs
- ReadOnlyDictionary.cs
- XmlName.cs
- BaseParaClient.cs
- TraceEventCache.cs
- SmiEventStream.cs
- WebPartDisplayModeEventArgs.cs
- HelpPage.cs
- Frame.cs
- XpsDigitalSignature.cs
- MobileControlDesigner.cs
- SymmetricAlgorithm.cs
- LightweightCodeGenerator.cs
- Model3D.cs
- SecurityVerifiedMessage.cs