Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / HandlerFactoryWrapper.cs / 1 / HandlerFactoryWrapper.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* Config related classes for HttpApplication
*/
namespace System.Web.Configuration {
using System;
using System.Web.Util;
/*
* Single instance handler factory
*/
internal class HandlerFactoryWrapper : IHttpHandlerFactory {
private IHttpHandler _handler;
private Type _handlerType;
internal HandlerFactoryWrapper(IHttpHandler handler, Type handlerType) {
_handler = handler;
_handlerType = handlerType;
}
public IHttpHandler GetHandler(HttpContext context, String requestType, String url, String pathTranslated) {
if (_handler == null)
_handler = (IHttpHandler)HttpRuntime.CreateNonPublicInstance(_handlerType);
return _handler;
}
public void ReleaseHandler(IHttpHandler handler) {
Debug.Assert(handler == _handler);
if (!_handler.IsReusable)
_handler = null;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* Config related classes for HttpApplication
*/
namespace System.Web.Configuration {
using System;
using System.Web.Util;
/*
* Single instance handler factory
*/
internal class HandlerFactoryWrapper : IHttpHandlerFactory {
private IHttpHandler _handler;
private Type _handlerType;
internal HandlerFactoryWrapper(IHttpHandler handler, Type handlerType) {
_handler = handler;
_handlerType = handlerType;
}
public IHttpHandler GetHandler(HttpContext context, String requestType, String url, String pathTranslated) {
if (_handler == null)
_handler = (IHttpHandler)HttpRuntime.CreateNonPublicInstance(_handlerType);
return _handler;
}
public void ReleaseHandler(IHttpHandler handler) {
Debug.Assert(handler == _handler);
if (!_handler.IsReusable)
_handler = null;
}
}
}
// 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
- SplitterCancelEvent.cs
- SoapEnumAttribute.cs
- StopStoryboard.cs
- ActivityStatusChangeEventArgs.cs
- DateRangeEvent.cs
- DocumentPageViewAutomationPeer.cs
- TextSelection.cs
- BitmapEffectRenderDataResource.cs
- AttachmentCollection.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- CultureInfo.cs
- BindStream.cs
- FixedTextContainer.cs
- StringReader.cs
- ProcessHostFactoryHelper.cs
- BaseCodeDomTreeGenerator.cs
- CommandBindingCollection.cs
- Baml2006KnownTypes.cs
- OleDbReferenceCollection.cs
- HighlightVisual.cs
- SkinBuilder.cs
- PhysicalFontFamily.cs
- ListSourceHelper.cs
- SecurityException.cs
- TextServicesCompartmentEventSink.cs
- PersonalizableAttribute.cs
- TrackingServices.cs
- DirectoryObjectSecurity.cs
- UpdatableWrapper.cs
- EDesignUtil.cs
- CodeBlockBuilder.cs
- RecipientInfo.cs
- ButtonFieldBase.cs
- SiteMapDataSourceDesigner.cs
- FlowLayout.cs
- MethodRental.cs
- StreamWithDictionary.cs
- Parser.cs
- XmlNullResolver.cs
- InProcStateClientManager.cs
- RelationshipEnd.cs
- DataColumnPropertyDescriptor.cs
- ConfigurationSection.cs
- GlobalItem.cs
- GridViewRowEventArgs.cs
- wgx_commands.cs
- ProtocolsSection.cs
- AssociationType.cs
- NumberSubstitution.cs
- TreeBuilderBamlTranslator.cs
- TdsParserSessionPool.cs
- ExtractorMetadata.cs
- NullableDecimalAverageAggregationOperator.cs
- DataGridViewCellPaintingEventArgs.cs
- DesignTimeVisibleAttribute.cs
- DesignerVerb.cs
- RuleInfoComparer.cs
- EditingCommands.cs
- __Filters.cs
- NativeMethodsOther.cs
- AccessibleObject.cs
- ParenthesizePropertyNameAttribute.cs
- Popup.cs
- BlockExpression.cs
- RefExpr.cs
- HttpCookiesSection.cs
- SchemaElementLookUpTable.cs
- configsystem.cs
- _NestedSingleAsyncResult.cs
- CommandHelper.cs
- TaiwanCalendar.cs
- DtdParser.cs
- SrgsSemanticInterpretationTag.cs
- BulletedList.cs
- CompilerWrapper.cs
- ColorTranslator.cs
- Executor.cs
- DependsOnAttribute.cs
- RemoteHelper.cs
- ipaddressinformationcollection.cs
- TransformedBitmap.cs
- TextTrailingWordEllipsis.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- PingOptions.cs
- SoapFault.cs
- SchemaTableOptionalColumn.cs
- HttpClientCertificate.cs
- ConfigWriter.cs
- DoubleAnimationUsingPath.cs
- MarkupObject.cs
- CodeCastExpression.cs
- DesignerOptionService.cs
- Library.cs
- FieldToken.cs
- ServiceModelTimeSpanValidator.cs
- MsmqIntegrationSecurityElement.cs
- WindowsGraphics2.cs
- PersonalizationStateInfo.cs
- EditorZone.cs
- SyncMethodInvoker.cs