Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DockProviderWrapper.cs
- NullPackagingPolicy.cs
- MatcherBuilder.cs
- ConfigXmlCDataSection.cs
- XmlImplementation.cs
- ZoneMembershipCondition.cs
- MonitorWrapper.cs
- PersonalizablePropertyEntry.cs
- PerfCounters.cs
- ConfigXmlSignificantWhitespace.cs
- DecimalAnimation.cs
- InvalidOleVariantTypeException.cs
- PopupEventArgs.cs
- QilStrConcat.cs
- ArgumentReference.cs
- ManagementEventArgs.cs
- WebPartHelpVerb.cs
- ISO2022Encoding.cs
- MonikerProxyAttribute.cs
- wgx_sdk_version.cs
- CodeTypeOfExpression.cs
- DateTimeFormatInfoScanner.cs
- CngUIPolicy.cs
- NoneExcludedImageIndexConverter.cs
- UIElementCollection.cs
- SmtpNtlmAuthenticationModule.cs
- WebScriptMetadataMessageEncoderFactory.cs
- PassportAuthenticationEventArgs.cs
- OleDbCommandBuilder.cs
- DataObject.cs
- UIPropertyMetadata.cs
- NavigateEvent.cs
- ProxyGenerationError.cs
- HostProtectionException.cs
- DockAndAnchorLayout.cs
- BinHexDecoder.cs
- JsonServiceDocumentSerializer.cs
- ObjectTag.cs
- BmpBitmapDecoder.cs
- StylusDownEventArgs.cs
- UnsettableComboBox.cs
- HiddenFieldPageStatePersister.cs
- AutomationFocusChangedEventArgs.cs
- StringBuilder.cs
- counter.cs
- XPathScanner.cs
- While.cs
- ISAPIRuntime.cs
- AddInAdapter.cs
- DotExpr.cs
- XmlQualifiedNameTest.cs
- SortDescriptionCollection.cs
- AffineTransform3D.cs
- GradientBrush.cs
- SqlServer2KCompatibilityCheck.cs
- SQLSingleStorage.cs
- TimerEventSubscription.cs
- ClientSettingsProvider.cs
- AppDomainCompilerProxy.cs
- TextPatternIdentifiers.cs
- TableRowGroupCollection.cs
- TrackingRecord.cs
- ControlPager.cs
- QilInvokeEarlyBound.cs
- DelimitedListTraceListener.cs
- WindowsScrollBarBits.cs
- ViewSimplifier.cs
- TabPanel.cs
- BindingWorker.cs
- DependencyObjectType.cs
- TextBoxAutomationPeer.cs
- DataGridTablesFactory.cs
- XslAstAnalyzer.cs
- ExceptionRoutedEventArgs.cs
- _NetworkingPerfCounters.cs
- DynamicDataManager.cs
- ExpressionBuilderContext.cs
- safex509handles.cs
- BitmapVisualManager.cs
- Lease.cs
- SID.cs
- ByeMessageApril2005.cs
- ProfileProvider.cs
- XmlName.cs
- TdsParser.cs
- DeleteIndexBinder.cs
- InheritanceUI.cs
- HashCodeCombiner.cs
- DoubleCollectionConverter.cs
- DeclarativeCatalogPartDesigner.cs
- LabelExpression.cs
- DataGridBoolColumn.cs
- BooleanStorage.cs
- BaseProcessor.cs
- FilteredDataSetHelper.cs
- TextDecorationCollectionConverter.cs
- CriticalExceptions.cs
- PageClientProxyGenerator.cs
- SoapAttributeAttribute.cs
- PKCS1MaskGenerationMethod.cs