Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / GcSettings.cs / 1305376 / GcSettings.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime {
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Security.Permissions;
using System.Diagnostics.Contracts;
// This is the same format as in clr\src\vm\gcpriv.h
// make sure you change that one if you change this one!
[Serializable]
public enum GCLatencyMode
{
Batch = 0,
Interactive = 1,
LowLatency = 2
}
public static class GCSettings
{
public static GCLatencyMode LatencyMode
{
[System.Security.SecuritySafeCritical] // auto-generated
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (GCLatencyMode)(GC.GetGCLatencyMode());
}
// We don't want to allow this API when hosted.
[System.Security.SecurityCritical] // auto-generated_required
[HostProtection(MayLeakOnAbort = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
set
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.LowLatency))
{
throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
}
Contract.EndContractBlock();
GC.SetGCLatencyMode((int)value);
}
}
public static bool IsServerGC
{
[System.Security.SecuritySafeCritical] // auto-generated
get {
return GC.IsServerGC();
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime {
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Security.Permissions;
using System.Diagnostics.Contracts;
// This is the same format as in clr\src\vm\gcpriv.h
// make sure you change that one if you change this one!
[Serializable]
public enum GCLatencyMode
{
Batch = 0,
Interactive = 1,
LowLatency = 2
}
public static class GCSettings
{
public static GCLatencyMode LatencyMode
{
[System.Security.SecuritySafeCritical] // auto-generated
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (GCLatencyMode)(GC.GetGCLatencyMode());
}
// We don't want to allow this API when hosted.
[System.Security.SecurityCritical] // auto-generated_required
[HostProtection(MayLeakOnAbort = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
set
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.LowLatency))
{
throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
}
Contract.EndContractBlock();
GC.SetGCLatencyMode((int)value);
}
}
public static bool IsServerGC
{
[System.Security.SecuritySafeCritical] // auto-generated
get {
return GC.IsServerGC();
}
}
}
}
// 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
- ListViewDeleteEventArgs.cs
- XsltException.cs
- PointLightBase.cs
- XmlAnyElementAttribute.cs
- DBConnectionString.cs
- ProfileSection.cs
- TextBox.cs
- HScrollProperties.cs
- DataGridViewColumn.cs
- DebugView.cs
- SiteMapDataSource.cs
- BasicKeyConstraint.cs
- ExtentCqlBlock.cs
- CaseInsensitiveOrdinalStringComparer.cs
- xml.cs
- DESCryptoServiceProvider.cs
- DirectoryInfo.cs
- Triplet.cs
- log.cs
- HitTestWithPointDrawingContextWalker.cs
- RelationshipEntry.cs
- Pkcs7Signer.cs
- XPathDocumentNavigator.cs
- WebPartConnectionsCancelVerb.cs
- ListViewDataItem.cs
- ServiceNameElementCollection.cs
- RtfControlWordInfo.cs
- StreamInfo.cs
- BinaryReader.cs
- IISMapPath.cs
- ProgressBarAutomationPeer.cs
- Mouse.cs
- EntityViewGenerationConstants.cs
- DropDownButton.cs
- TagPrefixCollection.cs
- BulletChrome.cs
- SqlClientMetaDataCollectionNames.cs
- QilInvoke.cs
- DBCommandBuilder.cs
- EventLogPermissionAttribute.cs
- DataPagerCommandEventArgs.cs
- EntityDataSourceWizardForm.cs
- ComponentEvent.cs
- NavigationPropertyEmitter.cs
- CompositeDataBoundControl.cs
- ObjectMemberMapping.cs
- Unit.cs
- DesigntimeLicenseContextSerializer.cs
- HwndStylusInputProvider.cs
- SQLInt32Storage.cs
- JumpList.cs
- IFlowDocumentViewer.cs
- DataFormats.cs
- XPathNodeHelper.cs
- ToolStripComboBox.cs
- WCFServiceClientProxyGenerator.cs
- XmlNotation.cs
- RawUIStateInputReport.cs
- CounterSampleCalculator.cs
- ControlBindingsCollection.cs
- ExceptionValidationRule.cs
- QueryServiceConfigHandle.cs
- Bold.cs
- ConfigsHelper.cs
- DbTransaction.cs
- DependencyPropertyKind.cs
- TreeNodeStyle.cs
- ProfileSettingsCollection.cs
- WeakReferenceKey.cs
- Paragraph.cs
- DecimalKeyFrameCollection.cs
- OdbcConnectionFactory.cs
- WebContext.cs
- TheQuery.cs
- PublishLicense.cs
- ExtendLockCommand.cs
- Canvas.cs
- BamlMapTable.cs
- EventlogProvider.cs
- ClientScriptManager.cs
- WriterOutput.cs
- DataTemplateSelector.cs
- SqlDependency.cs
- XmlQueryTypeFactory.cs
- Version.cs
- PropagatorResult.cs
- AutomationElementCollection.cs
- RedBlackList.cs
- CodeAttributeArgument.cs
- StylusPointDescription.cs
- SectionXmlInfo.cs
- PromptBuilder.cs
- HtmlAnchor.cs
- EventMappingSettingsCollection.cs
- PreviewKeyDownEventArgs.cs
- Int64AnimationUsingKeyFrames.cs
- EndpointIdentityExtension.cs
- AuthenticatedStream.cs
- input.cs
- SelectiveScrollingGrid.cs