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
- TouchEventArgs.cs
- MethodBuilderInstantiation.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- ReachUIElementCollectionSerializerAsync.cs
- ComplexPropertyEntry.cs
- KnownTypesHelper.cs
- TimeEnumHelper.cs
- ThreadInterruptedException.cs
- DataGridViewButtonCell.cs
- dbdatarecord.cs
- LinqToSqlWrapper.cs
- PathFigureCollection.cs
- Int32AnimationBase.cs
- base64Transforms.cs
- SQLDecimal.cs
- TaiwanCalendar.cs
- TableColumn.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HttpClientCertificate.cs
- SafeArrayTypeMismatchException.cs
- StyleTypedPropertyAttribute.cs
- IntSecurity.cs
- FormatterConverter.cs
- ConstrainedDataObject.cs
- UrlMappingsSection.cs
- OdbcDataReader.cs
- MessageDecoder.cs
- DBSqlParserColumn.cs
- DataGridViewHeaderCell.cs
- ItemCheckedEvent.cs
- WebPartConnectionsEventArgs.cs
- QueryGeneratorBase.cs
- SortedList.cs
- ReceiveReply.cs
- StrokeNodeOperations.cs
- StringPropertyBuilder.cs
- SafeEventHandle.cs
- CellQuery.cs
- SqlAliasesReferenced.cs
- CapiSymmetricAlgorithm.cs
- ListViewInsertEventArgs.cs
- ChannelServices.cs
- sortedlist.cs
- TypeConstant.cs
- AtlasWeb.Designer.cs
- StringReader.cs
- BlockCollection.cs
- PrintDocument.cs
- DbConnectionPool.cs
- LayoutEngine.cs
- BindingEntityInfo.cs
- xsdvalidator.cs
- WCFBuildProvider.cs
- TypeConverterAttribute.cs
- Pair.cs
- MetadataCache.cs
- Transform3DGroup.cs
- GridViewRowPresenterBase.cs
- QueueException.cs
- DoubleLink.cs
- RemotingAttributes.cs
- SafeArrayTypeMismatchException.cs
- Block.cs
- TimeSpanConverter.cs
- QilPatternFactory.cs
- XmlUnspecifiedAttribute.cs
- XmlComment.cs
- CompositeScriptReferenceEventArgs.cs
- COM2Properties.cs
- ContainerFilterService.cs
- _UriTypeConverter.cs
- ForceCopyBuildProvider.cs
- TableParagraph.cs
- ColumnResult.cs
- VariantWrapper.cs
- XmlSchemas.cs
- EditorPart.cs
- WebUtil.cs
- ProcessModelSection.cs
- IntPtr.cs
- SchemaConstraints.cs
- BasicBrowserDialog.cs
- TextBoxBase.cs
- ComponentEditorPage.cs
- WebPartCatalogAddVerb.cs
- MonikerUtility.cs
- RelationshipEnd.cs
- XmlIlGenerator.cs
- CollectionsUtil.cs
- EditingCoordinator.cs
- PenThreadPool.cs
- CommandBindingCollection.cs
- PropertyInformationCollection.cs
- JournalNavigationScope.cs
- HatchBrush.cs
- SymbolMethod.cs
- CngAlgorithmGroup.cs
- ConnectionInterfaceCollection.cs
- DllNotFoundException.cs
- FormatStringEditor.cs