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
- OciLobLocator.cs
- TextSpan.cs
- shaper.cs
- CodeCompileUnit.cs
- ChangeProcessor.cs
- Color.cs
- NameValueSectionHandler.cs
- BamlRecordWriter.cs
- CodeSubDirectoriesCollection.cs
- DatagridviewDisplayedBandsData.cs
- IconConverter.cs
- DataMemberAttribute.cs
- DocumentPage.cs
- safesecurityhelperavalon.cs
- DeclarativeCatalogPart.cs
- SmiContextFactory.cs
- Executor.cs
- StrongNamePublicKeyBlob.cs
- PathNode.cs
- FontFaceLayoutInfo.cs
- CellTreeSimplifier.cs
- CacheDependency.cs
- CookielessHelper.cs
- MergeFailedEvent.cs
- sortedlist.cs
- DataGridViewButtonCell.cs
- Point3DConverter.cs
- RegexCode.cs
- KeyFrames.cs
- TypeReference.cs
- AnnotationObservableCollection.cs
- TextFormatter.cs
- StorageEndPropertyMapping.cs
- RemoteWebConfigurationHostServer.cs
- CategoryState.cs
- Imaging.cs
- TableLayoutPanelDesigner.cs
- XmlDataCollection.cs
- DomNameTable.cs
- EncodingInfo.cs
- CellParagraph.cs
- SiteMapDataSource.cs
- GridViewHeaderRowPresenter.cs
- Roles.cs
- DelegatingHeader.cs
- DesignBindingPicker.cs
- ConfigurationSectionGroup.cs
- Sentence.cs
- Maps.cs
- HtmlTableCellCollection.cs
- ValueUnavailableException.cs
- EventRouteFactory.cs
- ReadOnlyAttribute.cs
- DrawingContextWalker.cs
- ContractUtils.cs
- PageThemeBuildProvider.cs
- TableParagraph.cs
- EventDrivenDesigner.cs
- WebPartMenu.cs
- GroupBoxAutomationPeer.cs
- OSFeature.cs
- DataGridViewHeaderCell.cs
- BufferedReadStream.cs
- BitmapEffectDrawing.cs
- OdbcHandle.cs
- ArraySubsetEnumerator.cs
- BooleanConverter.cs
- MouseButton.cs
- IItemProperties.cs
- BamlRecordWriter.cs
- SystemUnicastIPAddressInformation.cs
- UTF7Encoding.cs
- MimeBasePart.cs
- DataSet.cs
- ShutDownListener.cs
- StylusPoint.cs
- DecimalAnimationBase.cs
- EventHandlerList.cs
- SystemDropShadowChrome.cs
- JsonReader.cs
- SafeRightsManagementSessionHandle.cs
- FixedSOMElement.cs
- MissingMethodException.cs
- OracleParameterCollection.cs
- FilterRepeater.cs
- ListCollectionView.cs
- SQLDateTimeStorage.cs
- ScrollContentPresenter.cs
- SubstitutionList.cs
- _ProxyRegBlob.cs
- EventMappingSettingsCollection.cs
- sqlstateclientmanager.cs
- PackageFilter.cs
- SqlNamer.cs
- SecurityTokenSerializer.cs
- ScriptControl.cs
- ImageDrawing.cs
- Msmq4SubqueuePoisonHandler.cs
- WebPartDisplayModeEventArgs.cs
- DBCommand.cs