Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- XmlSchemaSet.cs
- UpDownEvent.cs
- ContextStack.cs
- MonthChangedEventArgs.cs
- NativeWrapper.cs
- QueryExtender.cs
- MemoryStream.cs
- ExpressionEditorSheet.cs
- ScriptResourceInfo.cs
- DataSpaceManager.cs
- LazyInitializer.cs
- RowBinding.cs
- StrongNamePublicKeyBlob.cs
- SafeRegistryHandle.cs
- TextTreeNode.cs
- OleDbFactory.cs
- ObjectContext.cs
- BitmapEffectState.cs
- HttpResponseHeader.cs
- TypeSystem.cs
- TagNameToTypeMapper.cs
- ProfileSection.cs
- MultipartContentParser.cs
- Crypto.cs
- mediaclock.cs
- MaterialGroup.cs
- TypeGeneratedEventArgs.cs
- ConfigurationProperty.cs
- FormViewPagerRow.cs
- ClickablePoint.cs
- VerticalAlignConverter.cs
- QilGenerator.cs
- RegistrationServices.cs
- DispatcherExceptionFilterEventArgs.cs
- DataGridClipboardCellContent.cs
- RadioButton.cs
- ChildTable.cs
- ExpressionWriter.cs
- ToolStripButton.cs
- HttpProfileGroupBase.cs
- ObjectDataSourceMethodEventArgs.cs
- DataGridViewImageColumn.cs
- TextSchema.cs
- RecognizedWordUnit.cs
- ProtectedProviderSettings.cs
- DescendantBaseQuery.cs
- DataServiceResponse.cs
- AnchoredBlock.cs
- RetrieveVirtualItemEventArgs.cs
- SafeNativeMethods.cs
- QueryComponents.cs
- BaseValidatorDesigner.cs
- QilInvokeEarlyBound.cs
- OutputCache.cs
- __TransparentProxy.cs
- HelpKeywordAttribute.cs
- JsonSerializer.cs
- BindingElement.cs
- EntityStoreSchemaGenerator.cs
- DataGridViewCell.cs
- XmlSchemaSet.cs
- DictationGrammar.cs
- ISAPIWorkerRequest.cs
- DefaultConfirmation.cs
- CanonicalFontFamilyReference.cs
- UnsettableComboBox.cs
- PersonalizationEntry.cs
- HotCommands.cs
- AuthorizationPolicyTypeElementCollection.cs
- Font.cs
- OutputScopeManager.cs
- ControlParser.cs
- SequenceFullException.cs
- clipboard.cs
- MemberProjectedSlot.cs
- infer.cs
- DbMetaDataColumnNames.cs
- RuleInfoComparer.cs
- DeploymentExceptionMapper.cs
- NamedElement.cs
- RoutedCommand.cs
- FormViewRow.cs
- VisualStyleElement.cs
- TaiwanLunisolarCalendar.cs
- DataViewSetting.cs
- Int32Storage.cs
- FeedUtils.cs
- BaseTemplateParser.cs
- Base64Encoding.cs
- DictionarySectionHandler.cs
- Security.cs
- SerializationSectionGroup.cs
- StorageRoot.cs
- OracleRowUpdatingEventArgs.cs
- FileLogRecordHeader.cs
- RouteParametersHelper.cs
- CachedPathData.cs
- XmlSignatureManifest.cs
- DatatypeImplementation.cs
- DecimalAnimationUsingKeyFrames.cs