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
- DataGridViewSelectedCellCollection.cs
- ReferentialConstraintRoleElement.cs
- TimelineClockCollection.cs
- DynamicValueConverter.cs
- TextOutput.cs
- LingerOption.cs
- COM2PropertyDescriptor.cs
- SrgsText.cs
- WindowsFormsHostPropertyMap.cs
- InputReport.cs
- AssemblyBuilder.cs
- PageThemeCodeDomTreeGenerator.cs
- XmlTextWriter.cs
- BindingObserver.cs
- SiteMap.cs
- CodeExporter.cs
- LayoutSettings.cs
- ImmComposition.cs
- ConfigurationSectionGroupCollection.cs
- _NetRes.cs
- XmlElementAttribute.cs
- SmtpReplyReader.cs
- RightsManagementEncryptionTransform.cs
- CustomAttributeFormatException.cs
- Line.cs
- BaseTemplateBuildProvider.cs
- EventTrigger.cs
- TargetControlTypeAttribute.cs
- ScrollProperties.cs
- DLinqTableProvider.cs
- DockPatternIdentifiers.cs
- SoapAttributeAttribute.cs
- BaseUriWithWildcard.cs
- HttpCacheParams.cs
- Expressions.cs
- IdentityManager.cs
- PlanCompilerUtil.cs
- ServiceNotStartedException.cs
- Logging.cs
- FloaterBaseParaClient.cs
- GeneratedView.cs
- Comparer.cs
- SchemaCollectionCompiler.cs
- AgileSafeNativeMemoryHandle.cs
- CheckBoxList.cs
- MetadataArtifactLoader.cs
- CustomAttributeFormatException.cs
- DbConnectionPoolOptions.cs
- Memoizer.cs
- ConsumerConnectionPointCollection.cs
- CapabilitiesRule.cs
- NamespaceDecl.cs
- InvalidAsynchronousStateException.cs
- MenuEventArgs.cs
- ButtonChrome.cs
- FormViewUpdatedEventArgs.cs
- Registry.cs
- COM2EnumConverter.cs
- CompositeFontFamily.cs
- OdbcException.cs
- WebServiceAttribute.cs
- DetailsViewPageEventArgs.cs
- SignatureTargetIdManager.cs
- PathGeometry.cs
- LinqDataSourceContextData.cs
- sqlser.cs
- XsdDateTime.cs
- HtmlHead.cs
- sqlnorm.cs
- FileEnumerator.cs
- FlowLayout.cs
- AccessedThroughPropertyAttribute.cs
- DataException.cs
- ModelServiceImpl.cs
- AdapterDictionary.cs
- Membership.cs
- ObjectDataSourceFilteringEventArgs.cs
- IdentifierService.cs
- GB18030Encoding.cs
- ToolBarTray.cs
- DecoderBestFitFallback.cs
- Int32Storage.cs
- _ConnectionGroup.cs
- XmlRawWriter.cs
- GB18030Encoding.cs
- PageAction.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- PriorityBinding.cs
- WebServiceErrorEvent.cs
- ParserHooks.cs
- ColorTransform.cs
- WebBrowser.cs
- DbCommandDefinition.cs
- PLINQETWProvider.cs
- CalendarModeChangedEventArgs.cs
- NameSpaceExtractor.cs
- BrushValueSerializer.cs
- PageHandlerFactory.cs
- PrintSchema.cs
- SchemaTypeEmitter.cs