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
- InitializationEventAttribute.cs
- BooleanToVisibilityConverter.cs
- VisualBrush.cs
- RectAnimationUsingKeyFrames.cs
- WindowsStatusBar.cs
- CheckBoxField.cs
- ManualResetEvent.cs
- RadioButtonStandardAdapter.cs
- SourceFileInfo.cs
- TdsParserStaticMethods.cs
- SizeAnimation.cs
- SQLChars.cs
- SchemaImporterExtension.cs
- FixedSOMTableCell.cs
- WindowsButton.cs
- TraceLevelStore.cs
- CharEntityEncoderFallback.cs
- WSDualHttpBindingCollectionElement.cs
- ClientTargetCollection.cs
- IgnoreSectionHandler.cs
- DEREncoding.cs
- Profiler.cs
- CalloutQueueItem.cs
- DataGridTable.cs
- RenameRuleObjectDialog.Designer.cs
- XmlSchemaIdentityConstraint.cs
- MobileRedirect.cs
- StrongNameUtility.cs
- BitmapInitialize.cs
- CompilationUnit.cs
- DbgUtil.cs
- ChildDocumentBlock.cs
- DataAdapter.cs
- SecurityElement.cs
- SqlDataSourceCommandParser.cs
- HelpInfo.cs
- EntityDataSourceContextCreatedEventArgs.cs
- ImmutableObjectAttribute.cs
- XPathDocument.cs
- shaperfactory.cs
- UpDownBase.cs
- EastAsianLunisolarCalendar.cs
- DataControlButton.cs
- SafeCloseHandleCritical.cs
- SmiGettersStream.cs
- InstanceDescriptor.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MutableAssemblyCacheEntry.cs
- HtmlSelectionListAdapter.cs
- FixedPage.cs
- MetadataSource.cs
- _SpnDictionary.cs
- SqlDataRecord.cs
- HtmlWindowCollection.cs
- ViewStateModeByIdAttribute.cs
- shaperfactory.cs
- ParserExtension.cs
- EmulateRecognizeCompletedEventArgs.cs
- FileDialog_Vista.cs
- InkCanvasSelectionAdorner.cs
- HttpProcessUtility.cs
- CSharpCodeProvider.cs
- PropertyItemInternal.cs
- CultureSpecificCharacterBufferRange.cs
- DataGridViewColumnConverter.cs
- ObjectListGeneralPage.cs
- TextSpanModifier.cs
- MenuAdapter.cs
- ApplicationServiceManager.cs
- ViewStateModeByIdAttribute.cs
- DropSourceBehavior.cs
- AdornerPresentationContext.cs
- MethodSignatureGenerator.cs
- GC.cs
- Graphics.cs
- CodeTypeDeclaration.cs
- Guid.cs
- StatusBarDrawItemEvent.cs
- ServiceChannelFactory.cs
- ThreadExceptionDialog.cs
- RemotingConfigParser.cs
- XmlExceptionHelper.cs
- mongolianshape.cs
- ClientSession.cs
- EntityViewGenerationAttribute.cs
- ReferencedCollectionType.cs
- ComboBox.cs
- TranslateTransform.cs
- ComponentEvent.cs
- Listbox.cs
- designeractionlistschangedeventargs.cs
- FontStyles.cs
- KnownBoxes.cs
- HScrollProperties.cs
- DesignerCategoryAttribute.cs
- RenderTargetBitmap.cs
- WmlPageAdapter.cs
- EdmValidator.cs
- RequestUriProcessor.cs
- MDIWindowDialog.cs