Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / ProcessInfo.cs / 1 / ProcessInfo.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* ProcessInfo class
*/
namespace System.Web {
using System.Threading;
using System.Security.Permissions;
///
/// Provides enumerated values representing status of a process.
///
public enum ProcessStatus {
///
/// Specifies that the process is running.
///
Alive = 1,
///
/// Specifies that the process has begun shutting down.
///
ShuttingDown = 2,
///
/// Specifies the the process has been shut down.
///
ShutDown = 3,
///
/// Specifies that the process has been terminated.
///
Terminated = 4
}
///
/// Provides enumerated values representing the reason a process has shut
/// down.
///
public enum ProcessShutdownReason {
///
/// Specifies that the process has not been shut down.
///
None = 0, // alive
///
/// Specifies that the process has been shut down unexpectedly.
///
Unexpected = 1,
///
/// Specifies that the process request exceeded the limit on number of
/// processes.
///
RequestsLimit = 2,
///
/// Specifies that the process request exceeded the limit on number of
/// processes in que.
///
RequestQueueLimit = 3,
///
/// Specifies that the process timed out.
///
Timeout = 4,
///
/// Specifies that the process exceeded the limit on process idle time.
///
IdleTimeout = 5,
///
/// Specifies that the process exceeded the limit of memory available per process.
///
MemoryLimitExceeded = 6,
PingFailed = 7,
DeadlockSuspected = 8
}
///
/// Provides information on processes.
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class ProcessInfo {
///
/// Indicates the time a process was started.
///
public DateTime StartTime { get { return _StartTime;}}
///
/// Indicates the length of time the process has been running.
///
public TimeSpan Age { get { return _Age;}}
///
/// Indicates the process id of the process.
///
public int ProcessID { get { return _ProcessID;}}
public int RequestCount { get { return _RequestCount;}}
///
/// Indicates the current status of the process.
///
public ProcessStatus Status { get { return _Status;}}
///
/// Indicates the reason the process shut down.
///
public ProcessShutdownReason ShutdownReason { get { return _ShutdownReason;}}
///
/// Indicates the maximum amount of memory the process has used.
///
public int PeakMemoryUsed { get { return _PeakMemoryUsed;}}
private DateTime _StartTime;
private TimeSpan _Age;
private int _ProcessID;
private int _RequestCount;
private ProcessStatus _Status;
private ProcessShutdownReason _ShutdownReason;
private int _PeakMemoryUsed;
///
/// Sets internal information indicating the status of the process.
///
public void SetAll (DateTime startTime, TimeSpan age, int processID, int requestCount, ProcessStatus status,
ProcessShutdownReason shutdownReason, int peakMemoryUsed) {
_StartTime = startTime;
_Age = age;
_ProcessID = processID;
_RequestCount = requestCount;
_Status = status;
_ShutdownReason = shutdownReason;
_PeakMemoryUsed = peakMemoryUsed;
}
///
/// Initializes a new instance of the class and sets internal information
/// indicating the status of the process.
///
public ProcessInfo (DateTime startTime, TimeSpan age, int processID, int requestCount, ProcessStatus status,
ProcessShutdownReason shutdownReason, int peakMemoryUsed) {
_StartTime = startTime;
_Age = age;
_ProcessID = processID;
_RequestCount = requestCount;
_Status = status;
_ShutdownReason = shutdownReason;
_PeakMemoryUsed = peakMemoryUsed;
}
public ProcessInfo() {
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* ProcessInfo class
*/
namespace System.Web {
using System.Threading;
using System.Security.Permissions;
///
/// Provides enumerated values representing status of a process.
///
public enum ProcessStatus {
///
/// Specifies that the process is running.
///
Alive = 1,
///
/// Specifies that the process has begun shutting down.
///
ShuttingDown = 2,
///
/// Specifies the the process has been shut down.
///
ShutDown = 3,
///
/// Specifies that the process has been terminated.
///
Terminated = 4
}
///
/// Provides enumerated values representing the reason a process has shut
/// down.
///
public enum ProcessShutdownReason {
///
/// Specifies that the process has not been shut down.
///
None = 0, // alive
///
/// Specifies that the process has been shut down unexpectedly.
///
Unexpected = 1,
///
/// Specifies that the process request exceeded the limit on number of
/// processes.
///
RequestsLimit = 2,
///
/// Specifies that the process request exceeded the limit on number of
/// processes in que.
///
RequestQueueLimit = 3,
///
/// Specifies that the process timed out.
///
Timeout = 4,
///
/// Specifies that the process exceeded the limit on process idle time.
///
IdleTimeout = 5,
///
/// Specifies that the process exceeded the limit of memory available per process.
///
MemoryLimitExceeded = 6,
PingFailed = 7,
DeadlockSuspected = 8
}
///
/// Provides information on processes.
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class ProcessInfo {
///
/// Indicates the time a process was started.
///
public DateTime StartTime { get { return _StartTime;}}
///
/// Indicates the length of time the process has been running.
///
public TimeSpan Age { get { return _Age;}}
///
/// Indicates the process id of the process.
///
public int ProcessID { get { return _ProcessID;}}
public int RequestCount { get { return _RequestCount;}}
///
/// Indicates the current status of the process.
///
public ProcessStatus Status { get { return _Status;}}
///
/// Indicates the reason the process shut down.
///
public ProcessShutdownReason ShutdownReason { get { return _ShutdownReason;}}
///
/// Indicates the maximum amount of memory the process has used.
///
public int PeakMemoryUsed { get { return _PeakMemoryUsed;}}
private DateTime _StartTime;
private TimeSpan _Age;
private int _ProcessID;
private int _RequestCount;
private ProcessStatus _Status;
private ProcessShutdownReason _ShutdownReason;
private int _PeakMemoryUsed;
///
/// Sets internal information indicating the status of the process.
///
public void SetAll (DateTime startTime, TimeSpan age, int processID, int requestCount, ProcessStatus status,
ProcessShutdownReason shutdownReason, int peakMemoryUsed) {
_StartTime = startTime;
_Age = age;
_ProcessID = processID;
_RequestCount = requestCount;
_Status = status;
_ShutdownReason = shutdownReason;
_PeakMemoryUsed = peakMemoryUsed;
}
///
/// Initializes a new instance of the class and sets internal information
/// indicating the status of the process.
///
public ProcessInfo (DateTime startTime, TimeSpan age, int processID, int requestCount, ProcessStatus status,
ProcessShutdownReason shutdownReason, int peakMemoryUsed) {
_StartTime = startTime;
_Age = age;
_ProcessID = processID;
_RequestCount = requestCount;
_Status = status;
_ShutdownReason = shutdownReason;
_PeakMemoryUsed = peakMemoryUsed;
}
public ProcessInfo() {
}
}
}
// 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
- XD.cs
- CommonXSendMessage.cs
- ToolStripItem.cs
- ControlPaint.cs
- ObjectDataSourceDisposingEventArgs.cs
- PrePostDescendentsWalker.cs
- AttachedPropertyMethodSelector.cs
- Facet.cs
- BidPrivateBase.cs
- FigureParaClient.cs
- oledbmetadatacolumnnames.cs
- ExpressionPrinter.cs
- DateTimeConstantAttribute.cs
- ResXResourceWriter.cs
- ProviderUtil.cs
- IdentityNotMappedException.cs
- WebConfigurationFileMap.cs
- SqlUtil.cs
- SqlCacheDependency.cs
- CorrelationKeyCalculator.cs
- ConfigXmlElement.cs
- MulticastOption.cs
- BaseComponentEditor.cs
- ToolStripDesigner.cs
- BitmapCodecInfo.cs
- VisualStyleElement.cs
- ClientSettingsStore.cs
- ToolStripDropDownClosedEventArgs.cs
- MimeBasePart.cs
- ApplicationProxyInternal.cs
- BCLDebug.cs
- ToolStripMenuItem.cs
- SemanticBasicElement.cs
- XmlConvert.cs
- InstalledFontCollection.cs
- figurelength.cs
- XmlDocumentFragment.cs
- LogicalTreeHelper.cs
- RecordManager.cs
- DateTime.cs
- BinaryCommonClasses.cs
- WrappedIUnknown.cs
- SafeViewOfFileHandle.cs
- Odbc32.cs
- ToolBar.cs
- ToolStripItemImageRenderEventArgs.cs
- OleDbConnectionFactory.cs
- TraceUtils.cs
- DataColumnMappingCollection.cs
- Application.cs
- CachedTypeface.cs
- UserUseLicenseDictionaryLoader.cs
- HttpProtocolImporter.cs
- DoubleCollection.cs
- ObjectDataSourceMethodEventArgs.cs
- ExeContext.cs
- XmlQuerySequence.cs
- TypeForwardedToAttribute.cs
- CompModSwitches.cs
- EncryptedKey.cs
- EncoderReplacementFallback.cs
- AbstractSvcMapFileLoader.cs
- DecoderExceptionFallback.cs
- WebUtil.cs
- CachedPathData.cs
- ViewStateModeByIdAttribute.cs
- DelegatingConfigHost.cs
- CustomWebEventKey.cs
- LineServicesCallbacks.cs
- WinCategoryAttribute.cs
- assemblycache.cs
- DifferencingCollection.cs
- LoadGrammarCompletedEventArgs.cs
- Property.cs
- LiteralControl.cs
- GraphicsContext.cs
- PerformanceCounterNameAttribute.cs
- PageThemeParser.cs
- HttpInputStream.cs
- DataColumnChangeEvent.cs
- SchemaExporter.cs
- OnOperation.cs
- ToolStripPanelDesigner.cs
- WinEventQueueItem.cs
- QuaternionKeyFrameCollection.cs
- DataSourceXmlClassAttribute.cs
- PropagatorResult.cs
- FormViewInsertedEventArgs.cs
- TemplateApplicationHelper.cs
- ViewBox.cs
- MessageQuerySet.cs
- SpAudioStreamWrapper.cs
- StatusCommandUI.cs
- MSAANativeProvider.cs
- IndexedEnumerable.cs
- AssemblyEvidenceFactory.cs
- WizardStepBase.cs
- Rule.cs
- CustomCredentialPolicy.cs
- GridViewSortEventArgs.cs