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
- ADRoleFactoryConfiguration.cs
- WindowsFormsSynchronizationContext.cs
- UrlMappingsSection.cs
- TextProperties.cs
- ReferencedAssembly.cs
- StateWorkerRequest.cs
- TextRunCache.cs
- ComUdtElementCollection.cs
- DataGridViewComboBoxEditingControl.cs
- CustomTypeDescriptor.cs
- HeaderCollection.cs
- CommandBindingCollection.cs
- NonPrimarySelectionGlyph.cs
- ReadingWritingEntityEventArgs.cs
- DetailsViewCommandEventArgs.cs
- SHA256.cs
- DescendantQuery.cs
- DocComment.cs
- SecureEnvironment.cs
- ExternalDataExchangeClient.cs
- NamespaceCollection.cs
- MemberAccessException.cs
- DefaultTraceListener.cs
- PiiTraceSource.cs
- GridViewDeletedEventArgs.cs
- EntityDesignerBuildProvider.cs
- DesignerVerbCollection.cs
- EntityDataSourceDataSelection.cs
- RowToParametersTransformer.cs
- EntityDataSourceWrapper.cs
- SafeBitVector32.cs
- Point4D.cs
- shaper.cs
- StylusSystemGestureEventArgs.cs
- DataGridViewBand.cs
- ParseChildrenAsPropertiesAttribute.cs
- BindableTemplateBuilder.cs
- DatagridviewDisplayedBandsData.cs
- FrameworkRichTextComposition.cs
- TreeNodeCollection.cs
- ColorConverter.cs
- OutputScopeManager.cs
- ParameterModifier.cs
- TransformerConfigurationWizardBase.cs
- DbDataSourceEnumerator.cs
- EdmItemError.cs
- AnimationTimeline.cs
- BamlLocalizer.cs
- httpstaticobjectscollection.cs
- StylusLogic.cs
- WebPartConnectionCollection.cs
- TreeWalkHelper.cs
- ServiceChannel.cs
- EmptyStringExpandableObjectConverter.cs
- CipherData.cs
- TreeNodeEventArgs.cs
- ExceptionUtil.cs
- EncodingInfo.cs
- ListBindingHelper.cs
- DPAPIProtectedConfigurationProvider.cs
- WeakReferenceList.cs
- MaterialCollection.cs
- MasterPageBuildProvider.cs
- EUCJPEncoding.cs
- Clipboard.cs
- SrgsGrammarCompiler.cs
- CqlLexer.cs
- WebConfigurationManager.cs
- FacetChecker.cs
- UriTemplateEquivalenceComparer.cs
- SqlDataSourceCustomCommandPanel.cs
- FixedSOMFixedBlock.cs
- ShadowGlyph.cs
- ItemsPanelTemplate.cs
- SerializationEventsCache.cs
- InstancePersistenceCommandException.cs
- ReadWriteSpinLock.cs
- EnumValAlphaComparer.cs
- CqlErrorHelper.cs
- EventLog.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DotExpr.cs
- SerializerWriterEventHandlers.cs
- HostingEnvironment.cs
- Scheduling.cs
- HttpListenerRequest.cs
- Matrix.cs
- PathTooLongException.cs
- ValidationHelper.cs
- EntityDataSourceContextCreatingEventArgs.cs
- EncoderParameters.cs
- AppearanceEditorPart.cs
- SmiMetaData.cs
- DragAssistanceManager.cs
- BitmapPalettes.cs
- StateWorkerRequest.cs
- XmlDataSourceView.cs
- DataControlLinkButton.cs
- IsolatedStorageFilePermission.cs
- UnsafeNativeMethods.cs