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
- securestring.cs
- SoapMessage.cs
- Renderer.cs
- KeyProperty.cs
- UnsafeNativeMethodsMilCoreApi.cs
- WaitForChangedResult.cs
- ValidatingPropertiesEventArgs.cs
- PrintDocument.cs
- AudioBase.cs
- Registry.cs
- RSACryptoServiceProvider.cs
- Compilation.cs
- WeakReference.cs
- CachedPathData.cs
- Subset.cs
- ProviderSettingsCollection.cs
- unsafeIndexingFilterStream.cs
- ColorContextHelper.cs
- ApplicationId.cs
- VisualBasicSettingsHandler.cs
- SoapIgnoreAttribute.cs
- MouseBinding.cs
- AuthenticationSchemesHelper.cs
- MetaType.cs
- FileSystemEnumerable.cs
- SQLDateTime.cs
- CdpEqualityComparer.cs
- MailWebEventProvider.cs
- HashJoinQueryOperatorEnumerator.cs
- WebPartAuthorizationEventArgs.cs
- CompileXomlTask.cs
- DbDeleteCommandTree.cs
- ProfileModule.cs
- WindowInteractionStateTracker.cs
- PageParser.cs
- URLMembershipCondition.cs
- CommentEmitter.cs
- CombinedGeometry.cs
- XmlSchemaCompilationSettings.cs
- Attachment.cs
- DescendantBaseQuery.cs
- Transaction.cs
- MatrixIndependentAnimationStorage.cs
- TypeSystemProvider.cs
- Module.cs
- MimePart.cs
- XmlText.cs
- BamlLocalizationDictionary.cs
- DisplayNameAttribute.cs
- InstancePersistence.cs
- ProgramPublisher.cs
- PageAsyncTask.cs
- Quack.cs
- BoolExpression.cs
- Psha1DerivedKeyGenerator.cs
- InstalledVoice.cs
- SynchronizationValidator.cs
- EditorBrowsableAttribute.cs
- DefaultTypeArgumentAttribute.cs
- CodePrimitiveExpression.cs
- SQLBinary.cs
- FunctionQuery.cs
- Propagator.cs
- Perspective.cs
- BasicKeyConstraint.cs
- SocketManager.cs
- TemplatePropertyEntry.cs
- Object.cs
- EmissiveMaterial.cs
- QueryOutputWriter.cs
- Parser.cs
- PropertyDescriptor.cs
- CryptoProvider.cs
- DispatcherExceptionEventArgs.cs
- TextServicesContext.cs
- XslAstAnalyzer.cs
- HttpCacheParams.cs
- QuestionEventArgs.cs
- AutomationFocusChangedEventArgs.cs
- PointConverter.cs
- WebServiceFault.cs
- AddressAccessDeniedException.cs
- VoiceSynthesis.cs
- ReservationNotFoundException.cs
- ResourceType.cs
- ValidationErrorCollection.cs
- InnerItemCollectionView.cs
- MimeMapping.cs
- InvalidCastException.cs
- AsyncOperation.cs
- DataSourceSelectArguments.cs
- InnerItemCollectionView.cs
- TreeNodeStyleCollection.cs
- AnnotationComponentManager.cs
- RecognizeCompletedEventArgs.cs
- SRef.cs
- SoundPlayer.cs
- ClientRuntime.cs
- SQLInt64.cs
- MD5.cs