Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / UI / WebControls / AdPostCacheSubstitution.cs / 1 / AdPostCacheSubstitution.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * The class is used internally to handle post-cache substitution mechanism in * AdRotator. * * Copyright (c) 2002 Microsoft Corporation */ namespace System.Web.UI.WebControls { using System.Globalization; using System.IO; using System.Web.Util; internal class AdPostCacheSubstitution { private AdRotator _adRotatorHelper; private AdPostCacheSubstitution() {} internal AdPostCacheSubstitution(AdRotator adRotator) { _adRotatorHelper = new AdRotator(); _adRotatorHelper.CopyFrom(adRotator); _adRotatorHelper.IsPostCacheAdHelper = true; _adRotatorHelper.Page = new Page(); } internal void RegisterPostCacheCallBack(HttpContext context, Page page, HtmlTextWriter writer) { // Assumption: called from AdRotator's Render phase HttpResponseSubstitutionCallback callback = new HttpResponseSubstitutionCallback(Render); context.Response.WriteSubstitution(callback); } internal string Render(HttpContext context) { // Debug.Assert(_adRotatorHelper != null && _adRotatorHelper.Page != null); // In PostCache Substitution, we use a string writer to return the markup. StringWriter stringWriter = new StringWriter(CultureInfo.CurrentCulture); HtmlTextWriter htmlWriter = _adRotatorHelper.Page.CreateHtmlTextWriter(stringWriter); Debug.Assert(htmlWriter != null); _adRotatorHelper.RenderControl(htmlWriter); // Dump the content out as needed for post-cache substitution. return stringWriter.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * The class is used internally to handle post-cache substitution mechanism in * AdRotator. * * Copyright (c) 2002 Microsoft Corporation */ namespace System.Web.UI.WebControls { using System.Globalization; using System.IO; using System.Web.Util; internal class AdPostCacheSubstitution { private AdRotator _adRotatorHelper; private AdPostCacheSubstitution() {} internal AdPostCacheSubstitution(AdRotator adRotator) { _adRotatorHelper = new AdRotator(); _adRotatorHelper.CopyFrom(adRotator); _adRotatorHelper.IsPostCacheAdHelper = true; _adRotatorHelper.Page = new Page(); } internal void RegisterPostCacheCallBack(HttpContext context, Page page, HtmlTextWriter writer) { // Assumption: called from AdRotator's Render phase HttpResponseSubstitutionCallback callback = new HttpResponseSubstitutionCallback(Render); context.Response.WriteSubstitution(callback); } internal string Render(HttpContext context) { // Debug.Assert(_adRotatorHelper != null && _adRotatorHelper.Page != null); // In PostCache Substitution, we use a string writer to return the markup. StringWriter stringWriter = new StringWriter(CultureInfo.CurrentCulture); HtmlTextWriter htmlWriter = _adRotatorHelper.Page.CreateHtmlTextWriter(stringWriter); Debug.Assert(htmlWriter != null); _adRotatorHelper.RenderControl(htmlWriter); // Dump the content out as needed for post-cache substitution. return stringWriter.ToString(); } } } // 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
- OnOperation.cs
- Command.cs
- CharEntityEncoderFallback.cs
- HttpTransportBindingElement.cs
- processwaithandle.cs
- SqlParameter.cs
- StylusButtonEventArgs.cs
- Latin1Encoding.cs
- TimerTable.cs
- FunctionCommandText.cs
- Gdiplus.cs
- TypeValidationEventArgs.cs
- XPathScanner.cs
- XhtmlBasicSelectionListAdapter.cs
- InvalidOperationException.cs
- XmlNamedNodeMap.cs
- IndependentAnimationStorage.cs
- ComplexPropertyEntry.cs
- DataViewSetting.cs
- HostVisual.cs
- TextOutput.cs
- MediaContext.cs
- RangeValidator.cs
- ModelUIElement3D.cs
- ConfigurationValues.cs
- ArgumentException.cs
- HwndTarget.cs
- ProjectionNode.cs
- UnsafeNetInfoNativeMethods.cs
- CapabilitiesPattern.cs
- VectorConverter.cs
- DataBoundControlAdapter.cs
- DelegateHelpers.cs
- Int32AnimationBase.cs
- SrgsItemList.cs
- DashStyle.cs
- RemotingConfiguration.cs
- ListViewItemMouseHoverEvent.cs
- Hex.cs
- ParagraphVisual.cs
- OdbcInfoMessageEvent.cs
- EdmComplexTypeAttribute.cs
- DataGridViewLinkColumn.cs
- DataMemberListEditor.cs
- AssociationProvider.cs
- HuffCodec.cs
- CodeSnippetStatement.cs
- ValidationHelper.cs
- SoapElementAttribute.cs
- ContextMenuService.cs
- HttpCookie.cs
- SqlMultiplexer.cs
- BindingParameterCollection.cs
- LinearKeyFrames.cs
- VirtualDirectoryMappingCollection.cs
- DataGridRelationshipRow.cs
- HashHelper.cs
- AnnotationDocumentPaginator.cs
- NativeWindow.cs
- IntegerValidatorAttribute.cs
- ListControlConvertEventArgs.cs
- SBCSCodePageEncoding.cs
- XmlEncoding.cs
- RuleProcessor.cs
- QilExpression.cs
- Maps.cs
- DispatcherObject.cs
- xsdvalidator.cs
- XmlSchemaExporter.cs
- RedistVersionInfo.cs
- RangeBase.cs
- UnsafeNativeMethods.cs
- InternalCompensate.cs
- FirstQueryOperator.cs
- ManifestResourceInfo.cs
- Events.cs
- RemotingAttributes.cs
- StateBag.cs
- CardSpacePolicyElement.cs
- PointLight.cs
- CodeSubDirectory.cs
- FlowDocumentScrollViewer.cs
- InstanceData.cs
- FunctionNode.cs
- SQLGuid.cs
- RpcCryptoContext.cs
- XsltException.cs
- GeometryConverter.cs
- Annotation.cs
- DesignerActionPropertyItem.cs
- TextAdaptor.cs
- PeerResolverMode.cs
- Transform3D.cs
- TextSelectionProcessor.cs
- UpdateCommand.cs
- XamlSerializerUtil.cs
- HwndKeyboardInputProvider.cs
- sqlinternaltransaction.cs
- XmlAttribute.cs
- TransactionState.cs