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
- ImageSource.cs
- HtmlToClrEventProxy.cs
- PersianCalendar.cs
- CodeArrayCreateExpression.cs
- InternalEnumValidatorAttribute.cs
- TableAutomationPeer.cs
- TextTreeObjectNode.cs
- TextElement.cs
- ScrollItemPatternIdentifiers.cs
- SafeSystemMetrics.cs
- Visual3D.cs
- DispatcherSynchronizationContext.cs
- BaseDataList.cs
- WebBrowserUriTypeConverter.cs
- TogglePattern.cs
- WsatEtwTraceListener.cs
- CallbackHandler.cs
- SessionEndedEventArgs.cs
- ToolStripContentPanelRenderEventArgs.cs
- XmlObjectSerializerReadContextComplexJson.cs
- HatchBrush.cs
- SecurityTokenResolver.cs
- ConfigXmlReader.cs
- GridPattern.cs
- CodeDomConfigurationHandler.cs
- AsyncPostBackErrorEventArgs.cs
- WebPartVerb.cs
- MultipleFilterMatchesException.cs
- Emitter.cs
- ObjectQueryProvider.cs
- ContentDisposition.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- XPathQilFactory.cs
- AttachedAnnotationChangedEventArgs.cs
- ExceptionHelpers.cs
- ProfileSettings.cs
- FrameworkObject.cs
- assertwrapper.cs
- ParseChildrenAsPropertiesAttribute.cs
- DragEventArgs.cs
- Debugger.cs
- wmiprovider.cs
- XmlTextReaderImpl.cs
- BlurEffect.cs
- ThemeDictionaryExtension.cs
- ToolStripMenuItem.cs
- TdsParserSafeHandles.cs
- FixedSOMContainer.cs
- CmsUtils.cs
- FieldAccessException.cs
- UIElementHelper.cs
- MDIWindowDialog.cs
- StatusBar.cs
- QilInvokeLateBound.cs
- HtmlInputHidden.cs
- Rotation3DAnimationUsingKeyFrames.cs
- OleDragDropHandler.cs
- ScrollPattern.cs
- LinearGradientBrush.cs
- TextEncodedRawTextWriter.cs
- ItemCollection.cs
- XamlSerializerUtil.cs
- FileLogRecordStream.cs
- ActivityExecutorDelegateInfo.cs
- CellIdBoolean.cs
- FeatureManager.cs
- TextDecorationLocationValidation.cs
- Substitution.cs
- KnownTypesHelper.cs
- DrawingContextDrawingContextWalker.cs
- WebServiceBindingAttribute.cs
- MethodToken.cs
- RuleInfoComparer.cs
- DataBindingsDialog.cs
- PermissionToken.cs
- Guid.cs
- Header.cs
- DoubleAnimation.cs
- HashSet.cs
- MSAAEventDispatcher.cs
- PropertyGridCommands.cs
- SecUtil.cs
- DBBindings.cs
- PresentationTraceSources.cs
- VersionedStream.cs
- MenuItemCollection.cs
- DetailsViewDeleteEventArgs.cs
- UriTemplateClientFormatter.cs
- VisualTreeHelper.cs
- relpropertyhelper.cs
- ImageSourceValueSerializer.cs
- BuildProvider.cs
- ControlEvent.cs
- FlatButtonAppearance.cs
- Query.cs
- SqlDataReader.cs
- QueryReaderSettings.cs
- TextInfo.cs
- ScanQueryOperator.cs
- XPathScanner.cs