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
- ListView.cs
- TreeChangeInfo.cs
- CustomGrammar.cs
- NTAccount.cs
- EncodingInfo.cs
- StringCollectionMarkupSerializer.cs
- PointLightBase.cs
- DynamicRouteExpression.cs
- PackagePartCollection.cs
- HtmlControl.cs
- StylusEventArgs.cs
- ListBindingHelper.cs
- SynchronizedDispatch.cs
- TimeIntervalCollection.cs
- CategoryValueConverter.cs
- COM2ColorConverter.cs
- DataRowView.cs
- MouseActionValueSerializer.cs
- DBAsyncResult.cs
- SR.cs
- InkCanvasSelectionAdorner.cs
- EventBindingService.cs
- TextBoxLine.cs
- WsdlInspector.cs
- SupportsEventValidationAttribute.cs
- EditorServiceContext.cs
- CollectionBase.cs
- ErrorTolerantObjectWriter.cs
- _ListenerRequestStream.cs
- WizardForm.cs
- RadioButton.cs
- TabPanel.cs
- UrlMappingCollection.cs
- BinaryQueryOperator.cs
- smtpconnection.cs
- Freezable.cs
- WebPartRestoreVerb.cs
- SuppressMessageAttribute.cs
- HatchBrush.cs
- ContentPlaceHolder.cs
- SqlDataSourceSelectingEventArgs.cs
- ZipIOModeEnforcingStream.cs
- ConfigXmlCDataSection.cs
- PointLight.cs
- IgnoreSectionHandler.cs
- ServiceX509SecurityTokenProvider.cs
- coordinator.cs
- XamlContextStack.cs
- DelegateSerializationHolder.cs
- _Rfc2616CacheValidators.cs
- DateTimeConverter2.cs
- RtfNavigator.cs
- StorageBasedPackageProperties.cs
- PersonalizationEntry.cs
- HashCodeCombiner.cs
- MessageContractExporter.cs
- EntityDataSourceSelectedEventArgs.cs
- XPathCompileException.cs
- GeneralTransform3D.cs
- Encoder.cs
- FlowDocumentScrollViewer.cs
- ExpressionEditorAttribute.cs
- FontEmbeddingManager.cs
- Executor.cs
- InputScopeConverter.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- AssociatedControlConverter.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- TextReader.cs
- SkinBuilder.cs
- RecognitionResult.cs
- CaseInsensitiveHashCodeProvider.cs
- ConsoleTraceListener.cs
- HtmlDocument.cs
- XPathDescendantIterator.cs
- WebRequest.cs
- SqlCacheDependency.cs
- StatusBar.cs
- TextRangeSerialization.cs
- DataGridViewRowPostPaintEventArgs.cs
- JsonDeserializer.cs
- ComponentResourceKeyConverter.cs
- Manipulation.cs
- TextBoxBase.cs
- OrderedDictionary.cs
- ResolveCriteria11.cs
- COSERVERINFO.cs
- Separator.cs
- PartitionerQueryOperator.cs
- DesigntimeLicenseContextSerializer.cs
- ConfigurationCollectionAttribute.cs
- BitmapCodecInfo.cs
- PathSegment.cs
- SimpleLine.cs
- QilBinary.cs
- Point3D.cs
- PersistNameAttribute.cs
- ShaderRenderModeValidation.cs
- WebBrowserNavigatedEventHandler.cs
- WindowInteropHelper.cs