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
- SparseMemoryStream.cs
- LongSumAggregationOperator.cs
- ServiceChannel.cs
- CharacterMetrics.cs
- Pkcs7Signer.cs
- CompilerScopeManager.cs
- StreamGeometry.cs
- WindowVisualStateTracker.cs
- SqlBooleanizer.cs
- ActivityTrace.cs
- NoneExcludedImageIndexConverter.cs
- XmlSchemaGroupRef.cs
- EventMap.cs
- ScrollChrome.cs
- LoopExpression.cs
- ValidationRuleCollection.cs
- UnsafeNativeMethods.cs
- LayoutEngine.cs
- DistinctQueryOperator.cs
- TemplatedWizardStep.cs
- EntityDataSourceState.cs
- coordinatorfactory.cs
- TdsValueSetter.cs
- TypeValidationEventArgs.cs
- PackagePart.cs
- HitTestParameters3D.cs
- ApplicationServiceHelper.cs
- DropDownButton.cs
- CssStyleCollection.cs
- Pens.cs
- PriorityBinding.cs
- MultiView.cs
- DebugView.cs
- FixedSOMContainer.cs
- RepeaterItemCollection.cs
- OutOfMemoryException.cs
- Pointer.cs
- LogReservationCollection.cs
- RepeatInfo.cs
- InputScopeNameConverter.cs
- ClientSettings.cs
- ColorInterpolationModeValidation.cs
- ISessionStateStore.cs
- Geometry.cs
- EncryptedType.cs
- ShapingWorkspace.cs
- TcpChannelFactory.cs
- DesignerRegion.cs
- tooltip.cs
- StorageEntityTypeMapping.cs
- MobileListItem.cs
- OdbcDataReader.cs
- ArrayList.cs
- ConcurrentBag.cs
- assemblycache.cs
- OracleSqlParser.cs
- CheckBox.cs
- SafeCryptHandles.cs
- ObjectSet.cs
- AssertValidation.cs
- BoolExpression.cs
- UnsafeNativeMethods.cs
- Constraint.cs
- WebPartConnectionsCancelEventArgs.cs
- ToolboxCategory.cs
- CapabilitiesSection.cs
- LambdaCompiler.Generated.cs
- ContainerActivationHelper.cs
- SwitchAttribute.cs
- BufferedStream.cs
- SharedStatics.cs
- Debug.cs
- ComponentManagerBroker.cs
- InstanceNameConverter.cs
- NativeObjectSecurity.cs
- HelpEvent.cs
- AffineTransform3D.cs
- EventProviderClassic.cs
- SMSvcHost.cs
- TransactionState.cs
- SourceFileInfo.cs
- AuthorizationRule.cs
- FacetChecker.cs
- MailMessage.cs
- FormViewRow.cs
- InkCanvasSelectionAdorner.cs
- XmlAnyAttributeAttribute.cs
- IntPtr.cs
- CommandBinding.cs
- AdapterDictionary.cs
- TextOutput.cs
- ErasingStroke.cs
- PathParser.cs
- OutputCacheProfileCollection.cs
- GlobalizationAssembly.cs
- ChangeBlockUndoRecord.cs
- StylusPointPropertyId.cs
- BufferAllocator.cs
- ConfigurationStrings.cs
- DataBoundLiteralControl.cs