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
- SQLResource.cs
- EntitySqlException.cs
- SrgsDocumentParser.cs
- TypeCollectionDesigner.xaml.cs
- SmtpCommands.cs
- ObjectSpanRewriter.cs
- ListView.cs
- AnimationStorage.cs
- ExceptionHandlerDesigner.cs
- ExceptionHandlers.cs
- ScriptReferenceBase.cs
- TextTrailingWordEllipsis.cs
- AgileSafeNativeMemoryHandle.cs
- IndexedWhereQueryOperator.cs
- OleDbTransaction.cs
- PeerNearMe.cs
- DataObjectEventArgs.cs
- CodeSnippetTypeMember.cs
- ExpandedProjectionNode.cs
- ControlValuePropertyAttribute.cs
- Console.cs
- ErrorProvider.cs
- __FastResourceComparer.cs
- NodeCounter.cs
- RoleService.cs
- Geometry3D.cs
- MessagePropertyFilter.cs
- BevelBitmapEffect.cs
- SqlLiftIndependentRowExpressions.cs
- CursorConverter.cs
- KoreanLunisolarCalendar.cs
- CredentialCache.cs
- RuntimeConfigurationRecord.cs
- PointAnimationUsingPath.cs
- AdornedElementPlaceholder.cs
- ThemeInfoAttribute.cs
- StickyNoteAnnotations.cs
- AdornerDecorator.cs
- FontStretchConverter.cs
- NavigationService.cs
- SplitContainer.cs
- Padding.cs
- HideDisabledControlAdapter.cs
- ColorContext.cs
- DataGridViewCellCancelEventArgs.cs
- PixelFormat.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- ElementHost.cs
- CloudCollection.cs
- WebPartCatalogAddVerb.cs
- VectorConverter.cs
- SystemIPInterfaceProperties.cs
- MouseActionConverter.cs
- Decimal.cs
- BitmapDownload.cs
- CacheEntry.cs
- PermissionAttributes.cs
- SamlAudienceRestrictionCondition.cs
- TypeConverterAttribute.cs
- SHA512.cs
- TreeNodeStyle.cs
- HttpCapabilitiesEvaluator.cs
- ContextMenu.cs
- AsyncOperation.cs
- VerificationAttribute.cs
- TreeNodeMouseHoverEvent.cs
- GeneralTransform2DTo3DTo2D.cs
- ByteStack.cs
- WebResponse.cs
- ListViewSortEventArgs.cs
- SettingsAttributeDictionary.cs
- XmlObjectSerializerContext.cs
- Line.cs
- MatrixTransform.cs
- WmlLinkAdapter.cs
- SystemInfo.cs
- CmsInterop.cs
- DataRelation.cs
- Rect3D.cs
- DateTimeSerializationSection.cs
- SmiGettersStream.cs
- ItemCheckedEvent.cs
- ComPlusTypeLoader.cs
- IndependentAnimationStorage.cs
- ClipboardProcessor.cs
- TitleStyle.cs
- ElementAtQueryOperator.cs
- WriteTimeStream.cs
- TableCell.cs
- TextReader.cs
- NegationPusher.cs
- DbgUtil.cs
- TabPage.cs
- ConstrainedDataObject.cs
- NetSectionGroup.cs
- SessionStateSection.cs
- ObjectViewEntityCollectionData.cs
- ValueHandle.cs
- Transform3DGroup.cs
- CodeNamespaceCollection.cs