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
- ButtonRenderer.cs
- MetadataCache.cs
- HtmlTableCellCollection.cs
- SizeChangedEventArgs.cs
- DictionarySectionHandler.cs
- HtmlMobileTextWriter.cs
- AttributeUsageAttribute.cs
- BaseResourcesBuildProvider.cs
- CheckBox.cs
- MasterPageCodeDomTreeGenerator.cs
- FormViewModeEventArgs.cs
- NativeMethods.cs
- FacetChecker.cs
- MasterPageCodeDomTreeGenerator.cs
- XmlQueryRuntime.cs
- GridProviderWrapper.cs
- HyperLink.cs
- MenuItemBinding.cs
- XmlBinaryReader.cs
- DataGridViewRowsRemovedEventArgs.cs
- DecoderFallback.cs
- MultiBindingExpression.cs
- ToggleButtonAutomationPeer.cs
- SecurityContextSecurityToken.cs
- IERequestCache.cs
- ScriptingAuthenticationServiceSection.cs
- Connector.cs
- ReservationNotFoundException.cs
- BuildResult.cs
- WebPartConnectionsCancelEventArgs.cs
- DataErrorValidationRule.cs
- StatusBarPanel.cs
- TypeElement.cs
- PackagePartCollection.cs
- ReadOnlyMetadataCollection.cs
- CurrentTimeZone.cs
- SplitterDesigner.cs
- JoinTreeSlot.cs
- ControlDesigner.cs
- StatusBar.cs
- KeyConstraint.cs
- RankException.cs
- Translator.cs
- DrawingGroup.cs
- XPathNodePointer.cs
- ITextView.cs
- PhysicalAddress.cs
- DrawingVisualDrawingContext.cs
- PageParserFilter.cs
- MLangCodePageEncoding.cs
- LocalValueEnumerator.cs
- WaitForChangedResult.cs
- XPathNodeInfoAtom.cs
- TrackingServices.cs
- TemplateBindingExtension.cs
- ListChangedEventArgs.cs
- DisplayMemberTemplateSelector.cs
- smtpconnection.cs
- PathFigureCollection.cs
- XmlSchemaSimpleContentExtension.cs
- PinnedBufferMemoryStream.cs
- MinimizableAttributeTypeConverter.cs
- FontStretchConverter.cs
- UIElement.cs
- RangeBaseAutomationPeer.cs
- ZipIOModeEnforcingStream.cs
- ScrollChrome.cs
- OdbcConnectionString.cs
- RawUIStateInputReport.cs
- CqlWriter.cs
- FrameworkElement.cs
- Guid.cs
- VirtualDirectoryMapping.cs
- SqlWebEventProvider.cs
- ProfileParameter.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- FixedHighlight.cs
- ConnectionOrientedTransportBindingElement.cs
- CacheAxisQuery.cs
- DateTimeEditor.cs
- TextEditorLists.cs
- AuthenticatingEventArgs.cs
- ScriptControlManager.cs
- Utilities.cs
- EntityConnection.cs
- CommandID.cs
- PersonalizationStateInfoCollection.cs
- _TransmitFileOverlappedAsyncResult.cs
- MetaModel.cs
- SqlRewriteScalarSubqueries.cs
- UInt64Converter.cs
- DisplayNameAttribute.cs
- PreProcessor.cs
- XmlMembersMapping.cs
- Compiler.cs
- CacheAxisQuery.cs
- SocketInformation.cs
- ApplicationHost.cs
- SchemaInfo.cs
- __Filters.cs