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
- EntityDesignerUtils.cs
- TextEditor.cs
- StringHelper.cs
- ServiceOperationHelpers.cs
- GeometryHitTestParameters.cs
- CommandTreeTypeHelper.cs
- WebBrowserNavigatedEventHandler.cs
- SerializationSectionGroup.cs
- HandlerFactoryCache.cs
- DoWhileDesigner.xaml.cs
- PagerStyle.cs
- BindingGroup.cs
- ItemsControlAutomationPeer.cs
- ListViewItemSelectionChangedEvent.cs
- WCFModelStrings.Designer.cs
- ScrollEventArgs.cs
- DefaultMemberAttribute.cs
- VectorAnimationBase.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- URL.cs
- QilSortKey.cs
- Html32TextWriter.cs
- XPathNodeInfoAtom.cs
- AbstractSvcMapFileLoader.cs
- Byte.cs
- DbTransaction.cs
- CoordinationService.cs
- ResXBuildProvider.cs
- TextBox.cs
- RelationshipFixer.cs
- CompilerGeneratedAttribute.cs
- OracleConnection.cs
- SourceFileInfo.cs
- DBDataPermission.cs
- ApplicationId.cs
- FormViewUpdatedEventArgs.cs
- XPathSelectionIterator.cs
- WorkflowTransactionService.cs
- odbcmetadatacolumnnames.cs
- AssemblyNameUtility.cs
- OperatingSystem.cs
- CopyOnWriteList.cs
- LineBreakRecord.cs
- FragmentQuery.cs
- ViewStateChangedEventArgs.cs
- DSASignatureDeformatter.cs
- FormView.cs
- UnsafeNativeMethods.cs
- Range.cs
- SerTrace.cs
- AsymmetricSecurityProtocolFactory.cs
- BrushProxy.cs
- xmlglyphRunInfo.cs
- AmbientLight.cs
- ColumnHeaderCollectionEditor.cs
- ExpressionBindingsDialog.cs
- KeyedCollection.cs
- MailAddressCollection.cs
- ListViewContainer.cs
- DispatchWrapper.cs
- SecUtil.cs
- CompilationUtil.cs
- GlobalAllocSafeHandle.cs
- MediaContext.cs
- FontResourceCache.cs
- NativeMethods.cs
- RegexWorker.cs
- SimpleColumnProvider.cs
- SQLInt64.cs
- CachedFontFace.cs
- XmlWhitespace.cs
- PersonalizationProviderHelper.cs
- SimpleModelProvider.cs
- WebPartEditVerb.cs
- EventToken.cs
- ChangePassword.cs
- XamlTypeMapper.cs
- Point3DAnimation.cs
- SslStream.cs
- MetricEntry.cs
- SocketManager.cs
- DataBinder.cs
- LocationEnvironment.cs
- LogAppendAsyncResult.cs
- RowCache.cs
- TextTreeInsertUndoUnit.cs
- StyleCollectionEditor.cs
- ValidationPropertyAttribute.cs
- OutputCacheProfileCollection.cs
- SettingsAttributes.cs
- GC.cs
- ElementsClipboardData.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- BlockCollection.cs
- Calendar.cs
- WebPartsSection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- FixedSOMLineCollection.cs
- TreeNodeStyleCollection.cs
- PaintValueEventArgs.cs