Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Management / IisTraceWebEventProvider.cs / 1 / IisTraceWebEventProvider.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Management {
using System.Configuration;
using System.Configuration.Provider;
using System.Collections.Specialized;
using System.Web.Util;
using System.Web.Hosting;
using System.Security.Permissions;
////////////
// Events
////////////
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class IisTraceWebEventProvider : WebEventProvider {
public IisTraceWebEventProvider() {
// only supported on IIS version 7 and later
HttpContext context = HttpContext.Current;
if (context != null) {
if (!HttpRuntime.UseIntegratedPipeline && !(context.WorkerRequest is ISAPIWorkerRequestInProcForIIS7)) {
throw new PlatformNotSupportedException(SR.GetString(SR.Requires_Iis_7));
}
}
}
public override void Initialize(string name, NameValueCollection config)
{
Debug.Trace("IisTraceWebEventProvider", "Initializing: name=" + name);
base.Initialize(name, config);
ProviderUtil.CheckUnrecognizedAttributes(config, name);
}
public override void ProcessEvent(WebBaseEvent eventRaised)
{
HttpContext context = HttpContext.Current;
if (context != null) {
context.WorkerRequest.RaiseTraceEvent(eventRaised);
}
}
public override void Flush() {
}
public override void Shutdown() {
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Management {
using System.Configuration;
using System.Configuration.Provider;
using System.Collections.Specialized;
using System.Web.Util;
using System.Web.Hosting;
using System.Security.Permissions;
////////////
// Events
////////////
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class IisTraceWebEventProvider : WebEventProvider {
public IisTraceWebEventProvider() {
// only supported on IIS version 7 and later
HttpContext context = HttpContext.Current;
if (context != null) {
if (!HttpRuntime.UseIntegratedPipeline && !(context.WorkerRequest is ISAPIWorkerRequestInProcForIIS7)) {
throw new PlatformNotSupportedException(SR.GetString(SR.Requires_Iis_7));
}
}
}
public override void Initialize(string name, NameValueCollection config)
{
Debug.Trace("IisTraceWebEventProvider", "Initializing: name=" + name);
base.Initialize(name, config);
ProviderUtil.CheckUnrecognizedAttributes(config, name);
}
public override void ProcessEvent(WebBaseEvent eventRaised)
{
HttpContext context = HttpContext.Current;
if (context != null) {
context.WorkerRequest.RaiseTraceEvent(eventRaised);
}
}
public override void Flush() {
}
public override void Shutdown() {
}
}
}
// 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
- ServiceDescriptionSerializer.cs
- ChangeInterceptorAttribute.cs
- ValueUtilsSmi.cs
- InvokePatternIdentifiers.cs
- Knowncolors.cs
- WindowsIPAddress.cs
- ServiceHttpModule.cs
- SmiMetaData.cs
- SerializationException.cs
- Win32Native.cs
- ClientRoleProvider.cs
- BaseDataBoundControl.cs
- UIElement3DAutomationPeer.cs
- ListChangedEventArgs.cs
- ReturnEventArgs.cs
- HtmlWindowCollection.cs
- EdmPropertyAttribute.cs
- BuildManager.cs
- ToolboxBitmapAttribute.cs
- CalendarDataBindingHandler.cs
- OleStrCAMarshaler.cs
- WebBrowserContainer.cs
- EditorReuseAttribute.cs
- HwndProxyElementProvider.cs
- Light.cs
- DataTemplateKey.cs
- FlowNode.cs
- WorkingDirectoryEditor.cs
- ContainerUtilities.cs
- TimersDescriptionAttribute.cs
- TextLineResult.cs
- TickBar.cs
- DivideByZeroException.cs
- UnsafeNativeMethodsPenimc.cs
- TimeoutException.cs
- HwndSourceParameters.cs
- Compiler.cs
- AccessDataSourceView.cs
- Stacktrace.cs
- StopStoryboard.cs
- XamlHttpHandlerFactory.cs
- DataMisalignedException.cs
- DirectionalLight.cs
- ClientRolePrincipal.cs
- RedirectionProxy.cs
- GlyphRunDrawing.cs
- NativeMethods.cs
- ObjectReaderCompiler.cs
- HttpFileCollectionWrapper.cs
- TextModifier.cs
- RtType.cs
- ColorContextHelper.cs
- JoinCqlBlock.cs
- CompositeDuplexBindingElement.cs
- OptimalTextSource.cs
- StyleBamlRecordReader.cs
- SignedPkcs7.cs
- FormsAuthenticationEventArgs.cs
- CurrentChangedEventManager.cs
- XhtmlConformanceSection.cs
- arabicshape.cs
- errorpatternmatcher.cs
- EntityDataSourceWrapper.cs
- ClassDataContract.cs
- RequestQueue.cs
- DependencySource.cs
- Transform3D.cs
- DbCommandTree.cs
- SiteMapNodeItemEventArgs.cs
- Splitter.cs
- Translator.cs
- DrawingCollection.cs
- ProfileParameter.cs
- KnownBoxes.cs
- VersionedStream.cs
- ModelFactory.cs
- HandlerFactoryWrapper.cs
- InvalidOleVariantTypeException.cs
- JobPageOrder.cs
- PasswordBox.cs
- Command.cs
- DataGridDesigner.cs
- SqlDelegatedTransaction.cs
- SizeConverter.cs
- ControlDesigner.cs
- ResourceProviderFactory.cs
- GlobalAllocSafeHandle.cs
- DocumentReferenceCollection.cs
- ListDataHelper.cs
- arclist.cs
- SettingsBindableAttribute.cs
- TextPatternIdentifiers.cs
- Message.cs
- WindowsFormsHostAutomationPeer.cs
- CodeMethodReturnStatement.cs
- SQLStringStorage.cs
- OdbcDataAdapter.cs
- XmlNavigatorFilter.cs
- localization.cs
- DesignSurfaceServiceContainer.cs