Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / Range.cs / 1 / Range.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// [....]
// [....]
//-----------------------------------------------------------------------------
namespace System.Data {
using System;
internal struct Range {
private int min;
private int max;
private bool isNotNull; // zero bit pattern represents null
public Range(int min, int max) {
if (min > max) {
throw ExceptionBuilder.RangeArgument(min, max);
}
this.min = min;
this.max = max;
isNotNull = true;
}
public int Count {
get {
if (IsNull)
return 0;
return max - min + 1;
}
}
public bool IsNull {
get {
return !isNotNull;
}
}
public int Max {
get {
CheckNull();
return max;
}
}
public int Min {
get {
CheckNull();
return min;
}
}
internal void CheckNull() {
if (this.IsNull) {
throw ExceptionBuilder.NullRange();
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// [....]
// [....]
//-----------------------------------------------------------------------------
namespace System.Data {
using System;
internal struct Range {
private int min;
private int max;
private bool isNotNull; // zero bit pattern represents null
public Range(int min, int max) {
if (min > max) {
throw ExceptionBuilder.RangeArgument(min, max);
}
this.min = min;
this.max = max;
isNotNull = true;
}
public int Count {
get {
if (IsNull)
return 0;
return max - min + 1;
}
}
public bool IsNull {
get {
return !isNotNull;
}
}
public int Max {
get {
CheckNull();
return max;
}
}
public int Min {
get {
CheckNull();
return min;
}
}
internal void CheckNull() {
if (this.IsNull) {
throw ExceptionBuilder.NullRange();
}
}
}
}
// 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
- DynamicRendererThreadManager.cs
- DataGridViewTopLeftHeaderCell.cs
- HtmlControl.cs
- ConnectionPointCookie.cs
- RequiredFieldValidator.cs
- DataKeyArray.cs
- CapabilitiesSection.cs
- StatementContext.cs
- KeyInstance.cs
- XPathSingletonIterator.cs
- WebContext.cs
- XmlLoader.cs
- BaseUriWithWildcard.cs
- SqlBooleanMismatchVisitor.cs
- ContentFileHelper.cs
- MouseBinding.cs
- _Connection.cs
- Substitution.cs
- NavigationProperty.cs
- EntityConnectionStringBuilder.cs
- DataGridViewCellPaintingEventArgs.cs
- ExpandSegmentCollection.cs
- SBCSCodePageEncoding.cs
- StringUtil.cs
- NavigationWindow.cs
- InProcStateClientManager.cs
- LocalizabilityAttribute.cs
- ApplicationBuildProvider.cs
- ConnectionPoint.cs
- FileAuthorizationModule.cs
- TextTreeTextElementNode.cs
- DataSourceControlBuilder.cs
- ReferenceEqualityComparer.cs
- ProcessThread.cs
- ComplexTypeEmitter.cs
- BevelBitmapEffect.cs
- ButtonField.cs
- Viewport3DVisual.cs
- FilterException.cs
- _HelperAsyncResults.cs
- OuterGlowBitmapEffect.cs
- StreamInfo.cs
- ErrorProvider.cs
- WebServiceHandler.cs
- GlyphRunDrawing.cs
- CompositeCollectionView.cs
- MouseEventArgs.cs
- StringValidator.cs
- XPathMessageFilterTable.cs
- CheckBoxFlatAdapter.cs
- OdbcEnvironmentHandle.cs
- WebContentFormatHelper.cs
- Brush.cs
- SamlAuthorizationDecisionClaimResource.cs
- XmlILIndex.cs
- ClientProxyGenerator.cs
- SessionEndedEventArgs.cs
- BasePropertyDescriptor.cs
- Int32AnimationBase.cs
- Configuration.cs
- TrimSurroundingWhitespaceAttribute.cs
- TileBrush.cs
- XmlResolver.cs
- ConfigurationPermission.cs
- SubstitutionList.cs
- ProcessModelSection.cs
- webbrowsersite.cs
- HybridWebProxyFinder.cs
- WebBrowserNavigatingEventHandler.cs
- FontUnit.cs
- HMACSHA512.cs
- ApplicationActivator.cs
- TableRowGroup.cs
- RightNameExpirationInfoPair.cs
- HelpEvent.cs
- MdiWindowListItemConverter.cs
- HtmlInputRadioButton.cs
- PocoPropertyAccessorStrategy.cs
- PackageDigitalSignature.cs
- XmlWrappingReader.cs
- DbExpressionVisitor.cs
- ImageButton.cs
- DeflateStreamAsyncResult.cs
- DocumentGrid.cs
- Paragraph.cs
- TextElement.cs
- TextModifierScope.cs
- DocumentPageViewAutomationPeer.cs
- HttpListenerPrefixCollection.cs
- MenuItemCollection.cs
- SessionState.cs
- QilStrConcat.cs
- ScrollViewer.cs
- WindowsFormsHostPropertyMap.cs
- NameScopePropertyAttribute.cs
- WebPartConnectionsEventArgs.cs
- DataGridColumn.cs
- VectorKeyFrameCollection.cs
- EarlyBoundInfo.cs
- ProcessHost.cs