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
- DesignObjectWrapper.cs
- TreeNodeStyle.cs
- GridViewColumnCollectionChangedEventArgs.cs
- CanonicalFontFamilyReference.cs
- SqlDataAdapter.cs
- _CookieModule.cs
- FontConverter.cs
- ElapsedEventArgs.cs
- PasswordPropertyTextAttribute.cs
- TreeNodeBindingDepthConverter.cs
- DBSqlParser.cs
- SingleObjectCollection.cs
- DesignConnectionCollection.cs
- WindowsIdentity.cs
- CookielessHelper.cs
- NameTable.cs
- DesignerDataSchemaClass.cs
- DateTimeAutomationPeer.cs
- NativeObjectSecurity.cs
- tooltip.cs
- DataGridViewLinkCell.cs
- ErrorWrapper.cs
- PageFunction.cs
- Accessible.cs
- XpsSerializerWriter.cs
- StrokeIntersection.cs
- PerformanceCounterManager.cs
- AvTraceFormat.cs
- DataGridViewMethods.cs
- DataGridViewImageCell.cs
- FontUnit.cs
- FixedFlowMap.cs
- QueueTransferProtocol.cs
- SqlCacheDependencyDatabaseCollection.cs
- ThreadAbortException.cs
- DragDeltaEventArgs.cs
- ButtonFlatAdapter.cs
- WindowsFont.cs
- PartialCachingControl.cs
- StrongNameIdentityPermission.cs
- PositiveTimeSpanValidator.cs
- JoinGraph.cs
- SID.cs
- PackageRelationshipSelector.cs
- CheckoutException.cs
- RegistryConfigurationProvider.cs
- ContainerAction.cs
- Zone.cs
- FormDesigner.cs
- CharEnumerator.cs
- UInt32Converter.cs
- StrongNameIdentityPermission.cs
- ObjectDataSourceSelectingEventArgs.cs
- HtmlTable.cs
- OAVariantLib.cs
- ContentPresenter.cs
- WebPartDescription.cs
- Rotation3DKeyFrameCollection.cs
- SoundPlayer.cs
- UserMapPath.cs
- AutoGeneratedField.cs
- DirectionalLight.cs
- TemplateControl.cs
- XmlSchemaImport.cs
- HtmlInputControl.cs
- RectangleConverter.cs
- QueryContinueDragEvent.cs
- _ListenerRequestStream.cs
- CodeIdentifier.cs
- DataDocumentXPathNavigator.cs
- FilterEventArgs.cs
- WebEventTraceProvider.cs
- CatchDesigner.xaml.cs
- AnnotationDocumentPaginator.cs
- ColumnWidthChangingEvent.cs
- PoisonMessageException.cs
- XmlReaderSettings.cs
- EditorZoneBase.cs
- SqlPersonalizationProvider.cs
- FormViewDeleteEventArgs.cs
- BufferModesCollection.cs
- CollectionViewGroupRoot.cs
- TrackPointCollection.cs
- CodeAttributeArgument.cs
- CompressionTransform.cs
- CompensationToken.cs
- NotConverter.cs
- AttributeTable.cs
- ConfigsHelper.cs
- InternalsVisibleToAttribute.cs
- ADConnectionHelper.cs
- OdbcErrorCollection.cs
- SqlDataSourceCommandEventArgs.cs
- ConnectionString.cs
- ClientBuildManagerCallback.cs
- ViewEventArgs.cs
- CompModSwitches.cs
- XmlWrappingReader.cs
- Image.cs
- Types.cs