Code:
/ 4.0 / 4.0 / 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. 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
- DataGridViewLinkCell.cs
- ComponentResourceManager.cs
- TransactionScope.cs
- X509Extension.cs
- RoutedEventConverter.cs
- ThousandthOfEmRealPoints.cs
- PhonemeEventArgs.cs
- WebPartDisplayModeEventArgs.cs
- ConcurrencyMode.cs
- XPathNavigatorKeyComparer.cs
- CustomError.cs
- PeerEndPoint.cs
- TouchPoint.cs
- CardSpacePolicyElement.cs
- SqlFlattener.cs
- ImpersonateTokenRef.cs
- TextWriter.cs
- CultureTableRecord.cs
- ChtmlImageAdapter.cs
- ConfigurationManagerHelperFactory.cs
- returneventsaver.cs
- ClientTarget.cs
- IndependentlyAnimatedPropertyMetadata.cs
- AdCreatedEventArgs.cs
- DBSqlParser.cs
- Roles.cs
- ISO2022Encoding.cs
- ColumnBinding.cs
- Light.cs
- PackageRelationshipCollection.cs
- TabControl.cs
- HwndHostAutomationPeer.cs
- SortedList.cs
- DataBindingExpressionBuilder.cs
- DetailsViewPageEventArgs.cs
- SemanticResultKey.cs
- Deflater.cs
- GridErrorDlg.cs
- JavaScriptObjectDeserializer.cs
- AffineTransform3D.cs
- XamlStyleSerializer.cs
- LayoutEvent.cs
- BamlRecordWriter.cs
- SelectorAutomationPeer.cs
- MessageAction.cs
- EntityTransaction.cs
- DuplexClientBase.cs
- CqlParserHelpers.cs
- SecurityDescriptor.cs
- ReflectTypeDescriptionProvider.cs
- SetterBaseCollection.cs
- RowVisual.cs
- XmlSerializerSection.cs
- XmlAnyElementAttributes.cs
- DataGridViewComboBoxEditingControl.cs
- CodeDirectionExpression.cs
- LoginDesignerUtil.cs
- UdpDiscoveryMessageFilter.cs
- AstTree.cs
- SystemSounds.cs
- SortDescription.cs
- Point3D.cs
- SelectionHighlightInfo.cs
- ResourcesChangeInfo.cs
- XmlSchemaGroup.cs
- XmlReflectionMember.cs
- LinqDataView.cs
- HttpDebugHandler.cs
- XPathNodeHelper.cs
- NamedPipeChannelFactory.cs
- EmbeddedObject.cs
- ToolStripPanelCell.cs
- GatewayDefinition.cs
- CachedPathData.cs
- BinaryCommonClasses.cs
- SecUtil.cs
- PipelineModuleStepContainer.cs
- ButtonField.cs
- StringHandle.cs
- SystemResourceHost.cs
- LinkLabelLinkClickedEvent.cs
- ToolStripDropDownMenu.cs
- PrimitiveSchema.cs
- PrimaryKeyTypeConverter.cs
- Pair.cs
- ScriptModule.cs
- BuildProvider.cs
- TraceSwitch.cs
- SqlConnectionManager.cs
- SecurityRuntime.cs
- PersistenceContext.cs
- ResolveMatchesCD1.cs
- OletxEnlistment.cs
- WinCategoryAttribute.cs
- VirtualizedItemPattern.cs
- CookieParameter.cs
- StateValidator.cs
- FlowDocumentFormatter.cs
- ListDictionaryInternal.cs
- _AcceptOverlappedAsyncResult.cs