Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Hosting / PreloadHost.cs / 1305376 / PreloadHost.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Hosting { using System; using System.Web; using System.Web.Util; using System.Configuration; internal sealed class PreloadHost : MarshalByRefObject, IRegisteredObject { public PreloadHost() { HostingEnvironment.RegisterObject(this); } public void CreateIProcessHostPreloadClientInstanceAndCallPreload(string preloadObjTypeName, string[] paramsForStartupObj) { using (new ApplicationImpersonationContext()) { // Check the type Type preloadObjType = null; try { preloadObjType = Type.GetType(preloadObjTypeName, true); } catch (Exception e) { throw new InvalidOperationException ( Misc.FormatExceptionMessage(e, new string[]{ SR.GetString(SR.Failure_Create_Application_Preload_Provider_Type, preloadObjTypeName)} )); } if (!typeof(IProcessHostPreloadClient).IsAssignableFrom(preloadObjType)) { throw new ConfigurationErrorsException(SR.GetString(SR.Invalid_Application_Preload_Provider_Type, preloadObjTypeName)); } // Let all other exceptons fall through to the default AppDomain IProcessHostPreloadClient preloadClient = (IProcessHostPreloadClient)Activator.CreateInstance(preloadObjType); preloadClient.Preload(paramsForStartupObj); } } internal Exception InitializationException { get { return HttpRuntime.InitializationException; } } void IRegisteredObject.Stop(bool immediate) { HostingEnvironment.UnregisterObject(this); } public override Object InitializeLifetimeService() { return null; // never expire lease } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Hosting { using System; using System.Web; using System.Web.Util; using System.Configuration; internal sealed class PreloadHost : MarshalByRefObject, IRegisteredObject { public PreloadHost() { HostingEnvironment.RegisterObject(this); } public void CreateIProcessHostPreloadClientInstanceAndCallPreload(string preloadObjTypeName, string[] paramsForStartupObj) { using (new ApplicationImpersonationContext()) { // Check the type Type preloadObjType = null; try { preloadObjType = Type.GetType(preloadObjTypeName, true); } catch (Exception e) { throw new InvalidOperationException ( Misc.FormatExceptionMessage(e, new string[]{ SR.GetString(SR.Failure_Create_Application_Preload_Provider_Type, preloadObjTypeName)} )); } if (!typeof(IProcessHostPreloadClient).IsAssignableFrom(preloadObjType)) { throw new ConfigurationErrorsException(SR.GetString(SR.Invalid_Application_Preload_Provider_Type, preloadObjTypeName)); } // Let all other exceptons fall through to the default AppDomain IProcessHostPreloadClient preloadClient = (IProcessHostPreloadClient)Activator.CreateInstance(preloadObjType); preloadClient.Preload(paramsForStartupObj); } } internal Exception InitializationException { get { return HttpRuntime.InitializationException; } } void IRegisteredObject.Stop(bool immediate) { HostingEnvironment.UnregisterObject(this); } public override Object InitializeLifetimeService() { return null; // never expire lease } } } // 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
- UrlAuthFailedErrorFormatter.cs
- ControlEvent.cs
- complextypematerializer.cs
- AppDomainFactory.cs
- PropertyValueChangedEvent.cs
- MetadataHelper.cs
- SchemeSettingElementCollection.cs
- StreamInfo.cs
- WebPartChrome.cs
- DatePicker.cs
- ContentPlaceHolder.cs
- XamlParser.cs
- CacheSection.cs
- SubclassTypeValidator.cs
- ElementAtQueryOperator.cs
- HostExecutionContextManager.cs
- Events.cs
- PaintEvent.cs
- AuthenticationSchemesHelper.cs
- OleAutBinder.cs
- ObjectDataSourceDisposingEventArgs.cs
- TemplateControlCodeDomTreeGenerator.cs
- InternalDuplexChannelListener.cs
- NegationPusher.cs
- ContentTextAutomationPeer.cs
- AppModelKnownContentFactory.cs
- RightsManagementEncryptionTransform.cs
- LocatorBase.cs
- ToolStripDropDownClosedEventArgs.cs
- SequenceRangeCollection.cs
- TypeUnloadedException.cs
- WebPartConnectionsCancelVerb.cs
- CodeAttributeArgumentCollection.cs
- SoapIncludeAttribute.cs
- ComponentConverter.cs
- XPathArrayIterator.cs
- QuaternionRotation3D.cs
- ResourcePermissionBase.cs
- Int16Animation.cs
- ShadowGlyph.cs
- View.cs
- ImmComposition.cs
- Light.cs
- StringConverter.cs
- RuleValidation.cs
- DataStorage.cs
- CompModSwitches.cs
- EmissiveMaterial.cs
- OleDbParameter.cs
- CalendarDataBindingHandler.cs
- DocumentOrderComparer.cs
- KnownIds.cs
- ScrollableControl.cs
- PixelShader.cs
- CustomGrammar.cs
- _TimerThread.cs
- DataSet.cs
- CharacterShapingProperties.cs
- ProfessionalColorTable.cs
- MimeMultiPart.cs
- ThrowHelper.cs
- RealProxy.cs
- PngBitmapDecoder.cs
- WebPartVerb.cs
- GACMembershipCondition.cs
- DropDownList.cs
- DataGridViewComboBoxCell.cs
- DesignerTransaction.cs
- CodeCastExpression.cs
- UshortList2.cs
- __Error.cs
- SimpleWorkerRequest.cs
- DataGridLinkButton.cs
- DesignSurfaceEvent.cs
- Message.cs
- EntityContainerEntitySet.cs
- CodeMethodReturnStatement.cs
- Identity.cs
- CodeMemberField.cs
- BinarySerializer.cs
- EventRouteFactory.cs
- EnumerationRangeValidationUtil.cs
- SafeFileMapViewHandle.cs
- NamespaceInfo.cs
- PropertyEmitterBase.cs
- RuntimeHelpers.cs
- ChameleonKey.cs
- _emptywebproxy.cs
- XmlSchemaObjectTable.cs
- WriteableBitmap.cs
- ImpersonationOption.cs
- PrivilegedConfigurationManager.cs
- TextServicesContext.cs
- Environment.cs
- GlyphTypeface.cs
- DataGridViewTextBoxColumn.cs
- StringStorage.cs
- OdbcStatementHandle.cs
- XmlSchemaFacet.cs
- XDeferredAxisSource.cs