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
- RadioButton.cs
- ActiveXContainer.cs
- ProcessProtocolHandler.cs
- QilIterator.cs
- InternalDispatchObject.cs
- EntityDesignPluralizationHandler.cs
- SchemaTableOptionalColumn.cs
- SerialErrors.cs
- ResourcePermissionBaseEntry.cs
- isolationinterop.cs
- CounterSample.cs
- DelegateArgument.cs
- SecurityPolicySection.cs
- Options.cs
- QilReference.cs
- JapaneseLunisolarCalendar.cs
- ExceptionValidationRule.cs
- ImageBrush.cs
- ProcessModule.cs
- ArgumentOutOfRangeException.cs
- CheckableControlBaseAdapter.cs
- EllipseGeometry.cs
- SchemaImporterExtensionsSection.cs
- SHA256Cng.cs
- SerializableAttribute.cs
- webclient.cs
- ConsoleTraceListener.cs
- ContentType.cs
- NameNode.cs
- BackgroundWorker.cs
- _ContextAwareResult.cs
- MetadataFile.cs
- AssemblyUtil.cs
- SqlConnectionString.cs
- DPCustomTypeDescriptor.cs
- MouseBinding.cs
- ComboBoxRenderer.cs
- WebPartTransformer.cs
- XmlWrappingWriter.cs
- TargetInvocationException.cs
- DocumentNUp.cs
- StackBuilderSink.cs
- AddInBase.cs
- CodeMemberEvent.cs
- EdgeProfileValidation.cs
- SetIterators.cs
- ProfilePropertySettings.cs
- ContainsRowNumberChecker.cs
- FloaterParagraph.cs
- ItemContainerGenerator.cs
- WsatProxy.cs
- ConditionBrowserDialog.cs
- Label.cs
- StylusOverProperty.cs
- DropDownButton.cs
- DataGridItemAttachedStorage.cs
- NavigationPropertyEmitter.cs
- WmpBitmapEncoder.cs
- TypefaceCollection.cs
- RandomNumberGenerator.cs
- ZipIOFileItemStream.cs
- AuthStoreRoleProvider.cs
- DataServiceQueryProvider.cs
- TaskbarItemInfo.cs
- MemoryMappedView.cs
- DetailsViewPageEventArgs.cs
- SetStateDesigner.cs
- PrePrepareMethodAttribute.cs
- LinqDataSourceView.cs
- NamespaceCollection.cs
- IgnoreDeviceFilterElement.cs
- UrlAuthorizationModule.cs
- FatalException.cs
- TextBoxRenderer.cs
- TimeSpanMinutesConverter.cs
- DataControlPagerLinkButton.cs
- CalendarDataBindingHandler.cs
- CalendarDateRangeChangingEventArgs.cs
- DataTableReaderListener.cs
- HotSpotCollection.cs
- CacheSection.cs
- DashStyle.cs
- PopupControlService.cs
- TypePresenter.xaml.cs
- SeparatorAutomationPeer.cs
- CookieParameter.cs
- EditBehavior.cs
- XmlSchemaSimpleTypeList.cs
- ResourceDisplayNameAttribute.cs
- FacetValues.cs
- StaticExtension.cs
- DefaultValidator.cs
- Util.cs
- PrtTicket_Public_Simple.cs
- PatternMatcher.cs
- SpeakProgressEventArgs.cs
- UnlockInstanceCommand.cs
- MenuItemStyle.cs
- ControlPropertyNameConverter.cs
- Literal.cs