Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / ApplicationServices / ApplicationServicesHostFactory.cs / 1 / ApplicationServicesHostFactory.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
using System.ServiceModel;
using System.ServiceModel.Activation;
namespace System.Web.ApplicationServices {
[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ApplicationServicesHostFactory : ServiceHostFactory {
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "Can't modify the base class.")]
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) {
ServiceHost host = null;
if (typeof(ProfileService).Equals(serviceType)) {
host = new ServiceHost(new ProfileService(), baseAddresses);
}
else if (typeof(RoleService).Equals(serviceType)) {
host = new ServiceHost(new RoleService(), baseAddresses);
}
else if (typeof(AuthenticationService).Equals(serviceType)) {
host = new ServiceHost(new AuthenticationService(), baseAddresses);
}
else {
host = base.CreateServiceHost(serviceType, baseAddresses);
}
return host;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
using System.ServiceModel;
using System.ServiceModel.Activation;
namespace System.Web.ApplicationServices {
[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ApplicationServicesHostFactory : ServiceHostFactory {
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "Can't modify the base class.")]
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) {
ServiceHost host = null;
if (typeof(ProfileService).Equals(serviceType)) {
host = new ServiceHost(new ProfileService(), baseAddresses);
}
else if (typeof(RoleService).Equals(serviceType)) {
host = new ServiceHost(new RoleService(), baseAddresses);
}
else if (typeof(AuthenticationService).Equals(serviceType)) {
host = new ServiceHost(new AuthenticationService(), baseAddresses);
}
else {
host = base.CreateServiceHost(serviceType, baseAddresses);
}
return host;
}
}
}
// 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
- COM2PictureConverter.cs
- DataBoundLiteralControl.cs
- Compilation.cs
- ObjectTypeMapping.cs
- BitmapFrame.cs
- SizeAnimation.cs
- ProcessModelSection.cs
- SamlAssertion.cs
- SafeCryptoHandles.cs
- AnonymousIdentificationSection.cs
- SpellerInterop.cs
- HtmlHistory.cs
- HttpCookieCollection.cs
- XmlAtomicValue.cs
- BindingEntityInfo.cs
- StringReader.cs
- UInt32Storage.cs
- remotingproxy.cs
- Encoder.cs
- DynamicPhysicalDiscoSearcher.cs
- Version.cs
- WindowsComboBox.cs
- HtmlInputText.cs
- DataContractAttribute.cs
- FontEmbeddingManager.cs
- StyleHelper.cs
- FloaterBaseParagraph.cs
- NativeMethods.cs
- FixedSOMElement.cs
- FixedTextBuilder.cs
- Hex.cs
- PngBitmapEncoder.cs
- FlowDocumentView.cs
- DataSourceComponent.cs
- EastAsianLunisolarCalendar.cs
- PingOptions.cs
- dbdatarecord.cs
- ResolvePPIDRequest.cs
- TcpServerChannel.cs
- XmlNamespaceMapping.cs
- BroadcastEventHelper.cs
- DbDataAdapter.cs
- ECDsaCng.cs
- ProcessHostMapPath.cs
- SerializationSectionGroup.cs
- PerformanceCounterCategory.cs
- WebBaseEventKeyComparer.cs
- X509AsymmetricSecurityKey.cs
- ListViewUpdatedEventArgs.cs
- InfoCardKeyedHashAlgorithm.cs
- SystemDiagnosticsSection.cs
- CurrentTimeZone.cs
- HelpOperationInvoker.cs
- CounterSetInstanceCounterDataSet.cs
- SqlProcedureAttribute.cs
- Helpers.cs
- DataGridViewHitTestInfo.cs
- EntityViewGenerationAttribute.cs
- SaveFileDialog.cs
- OperandQuery.cs
- WindowsListViewScroll.cs
- FontEmbeddingManager.cs
- ClipboardProcessor.cs
- SapiRecognizer.cs
- LiteralDesigner.cs
- ReliableMessagingHelpers.cs
- ExtendedProtectionPolicy.cs
- OracleInternalConnection.cs
- RegexStringValidatorAttribute.cs
- InputMethodStateTypeInfo.cs
- BindingOperations.cs
- SystemFonts.cs
- FormsAuthenticationUserCollection.cs
- FileDialogCustomPlace.cs
- RuleRef.cs
- SimpleHandlerBuildProvider.cs
- UnsafeNativeMethods.cs
- BlockUIContainer.cs
- EventTrigger.cs
- KeyedHashAlgorithm.cs
- ObjectSpanRewriter.cs
- DbModificationCommandTree.cs
- ArrayWithOffset.cs
- TypeUsage.cs
- SafeFindHandle.cs
- EntityDataSourceState.cs
- HtmlInputHidden.cs
- DesignerSerializationVisibilityAttribute.cs
- SamlAssertionKeyIdentifierClause.cs
- CodeGenerator.cs
- NameTable.cs
- InheritanceAttribute.cs
- GlobalAclOperationRequirement.cs
- odbcmetadatafactory.cs
- MembershipPasswordException.cs
- SelectiveScrollingGrid.cs
- SmtpNtlmAuthenticationModule.cs
- BridgeDataReader.cs
- SecurityTokenInclusionMode.cs
- _OverlappedAsyncResult.cs