Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Cache / SubstitutionResponseElement.cs / 1305376 / SubstitutionResponseElement.cs
using System; using System.Runtime.Serialization; using System.Security.Permissions; using System.Web; using System.Web.Caching; using System.Web.Compilation; namespace System.Web.Caching { [Serializable] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Unrestricted)] public class SubstitutionResponseElement: ResponseElement { [NonSerialized] private HttpResponseSubstitutionCallback _callback; private string _targetTypeName; private string _methodName; public HttpResponseSubstitutionCallback Callback { get { return _callback; } } private SubstitutionResponseElement() { } // hide default constructor public SubstitutionResponseElement(HttpResponseSubstitutionCallback callback) { if (callback == null) throw new ArgumentNullException("callback"); _callback = callback; } [OnSerializing()] private void OnSerializingMethod(StreamingContext context) { // create a string representation of the callback _targetTypeName = System.Web.UI.Util.GetAssemblyQualifiedTypeName(_callback.Method.ReflectedType); _methodName = _callback.Method.Name; } [OnDeserialized()] private void OnDeserializedMethod(StreamingContext context) { // re-create each ValidationCallbackInfo from its string representation Type target = BuildManager.GetType(_targetTypeName, true /*throwOnFail*/, false /*ignoreCase*/); _callback = (HttpResponseSubstitutionCallback) Delegate.CreateDelegate(typeof(HttpResponseSubstitutionCallback), target, _methodName); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ResizingMessageFilter.cs
- FigureParaClient.cs
- ECDiffieHellmanCng.cs
- Font.cs
- SqlMethodAttribute.cs
- ScrollableControl.cs
- ReferenceTypeElement.cs
- SocketElement.cs
- SimpleFileLog.cs
- ColorTransform.cs
- VisualProxy.cs
- SafeNativeMethods.cs
- NonParentingControl.cs
- EditBehavior.cs
- infer.cs
- XmlSchemaNotation.cs
- DATA_BLOB.cs
- DataGridCommandEventArgs.cs
- FontStyles.cs
- SessionState.cs
- WebPartTransformerAttribute.cs
- HwndHost.cs
- KnownTypesProvider.cs
- IconConverter.cs
- EntityTransaction.cs
- CanonicalizationDriver.cs
- WebPartEditorOkVerb.cs
- CollectionsUtil.cs
- DatagridviewDisplayedBandsData.cs
- ToolboxItemCollection.cs
- DeleteMemberBinder.cs
- MULTI_QI.cs
- RewritingValidator.cs
- _AutoWebProxyScriptWrapper.cs
- DetailsViewUpdateEventArgs.cs
- BufferBuilder.cs
- XmlAggregates.cs
- BitmapEffectInput.cs
- WebPartExportVerb.cs
- SystemGatewayIPAddressInformation.cs
- XmlKeywords.cs
- FigureParaClient.cs
- ListItemViewControl.cs
- DesignerActionUIService.cs
- ThreadStateException.cs
- HwndProxyElementProvider.cs
- ColumnWidthChangedEvent.cs
- DBCommand.cs
- PathStreamGeometryContext.cs
- SimpleRecyclingCache.cs
- SemanticResultKey.cs
- SignedPkcs7.cs
- StringArrayConverter.cs
- UnsafeNetInfoNativeMethods.cs
- DiscoveryEndpointElement.cs
- GridItemCollection.cs
- ProjectionPlan.cs
- Msmq4SubqueuePoisonHandler.cs
- CurrentChangingEventArgs.cs
- DataSysAttribute.cs
- SortQuery.cs
- OrderedDictionary.cs
- TextClipboardData.cs
- RemotingConfiguration.cs
- EdmPropertyAttribute.cs
- sqlstateclientmanager.cs
- DataGridViewTextBoxColumn.cs
- GeneralTransform.cs
- DataGridTextBoxColumn.cs
- HtmlControl.cs
- GridViewColumnHeader.cs
- UniformGrid.cs
- Image.cs
- StyleReferenceConverter.cs
- ServerValidateEventArgs.cs
- EntityDataSourceDesigner.cs
- Binding.cs
- XmlSchemaChoice.cs
- AdornerLayer.cs
- DropSourceBehavior.cs
- MetadataProperty.cs
- AnnotationService.cs
- AnimationTimeline.cs
- DataGridViewRowsAddedEventArgs.cs
- DataRowCollection.cs
- FixedHighlight.cs
- AnimationException.cs
- EncryptedPackageFilter.cs
- ConversionContext.cs
- ASCIIEncoding.cs
- HostedTransportConfigurationBase.cs
- Command.cs
- ScriptModule.cs
- NotifyParentPropertyAttribute.cs
- XmlAttributeCache.cs
- OleDbConnection.cs
- Zone.cs
- ipaddressinformationcollection.cs
- ValuePattern.cs
- TextBlockAutomationPeer.cs