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
- Int64Converter.cs
- AsyncPostBackErrorEventArgs.cs
- XmlUtilWriter.cs
- HostProtectionException.cs
- SpotLight.cs
- CaseDesigner.xaml.cs
- PersistencePipeline.cs
- PersonalizablePropertyEntry.cs
- BamlRecordReader.cs
- LayoutDump.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SQLBytes.cs
- SimpleHandlerBuildProvider.cs
- SettingsContext.cs
- SymbolMethod.cs
- ErrorHandlerModule.cs
- AuthenticationModuleElement.cs
- LongValidator.cs
- DbRetry.cs
- Compiler.cs
- TypedElement.cs
- HttpCachePolicyBase.cs
- ShaderRenderModeValidation.cs
- SqlConnectionManager.cs
- TlsSspiNegotiation.cs
- ItemDragEvent.cs
- WmlObjectListAdapter.cs
- BackgroundFormatInfo.cs
- XmlHelper.cs
- TraceListener.cs
- SafeFileMappingHandle.cs
- HostSecurityManager.cs
- UndoEngine.cs
- ToolStripDropDownMenu.cs
- SafePEFileHandle.cs
- SafeArrayTypeMismatchException.cs
- ConfigurationCollectionAttribute.cs
- FileEnumerator.cs
- InkPresenterAutomationPeer.cs
- ContextQuery.cs
- ErrorFormatter.cs
- DateTimeStorage.cs
- ResourcesBuildProvider.cs
- GregorianCalendarHelper.cs
- XmlILModule.cs
- TileBrush.cs
- SiteMapPath.cs
- CodeSnippetExpression.cs
- GatewayDefinition.cs
- OracleRowUpdatedEventArgs.cs
- Point3DConverter.cs
- LabelLiteral.cs
- ProcessStartInfo.cs
- ExcCanonicalXml.cs
- ProgressBarHighlightConverter.cs
- ParseHttpDate.cs
- RC2CryptoServiceProvider.cs
- StringBuilder.cs
- UIElement.cs
- connectionpool.cs
- DefaultDialogButtons.cs
- TemplateBindingExtensionConverter.cs
- MimeReflector.cs
- DependentTransaction.cs
- sortedlist.cs
- XmlSchemaDocumentation.cs
- ManualWorkflowSchedulerService.cs
- FixUp.cs
- formatter.cs
- CookielessHelper.cs
- WS2007FederationHttpBinding.cs
- SoundPlayer.cs
- IHttpResponseInternal.cs
- TextServicesProperty.cs
- TextRangeEditTables.cs
- SimplePropertyEntry.cs
- SpecularMaterial.cs
- CookieParameter.cs
- DataMemberConverter.cs
- SafeIUnknown.cs
- XmlSchemaGroup.cs
- MatrixAnimationUsingPath.cs
- UserNameSecurityTokenAuthenticator.cs
- MetadataException.cs
- PathSegmentCollection.cs
- JapaneseLunisolarCalendar.cs
- DetailsViewPageEventArgs.cs
- ElementProxy.cs
- adornercollection.cs
- DebuggerService.cs
- ObfuscateAssemblyAttribute.cs
- FixedSchema.cs
- PriorityQueue.cs
- EmptyImpersonationContext.cs
- TreeNodeEventArgs.cs
- ExternalException.cs
- LoginUtil.cs
- Stack.cs
- PerformanceCounterManager.cs
- ImageListImage.cs