Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Range.cs / 1305376 / 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
- RectAnimation.cs
- MULTI_QI.cs
- XPathSingletonIterator.cs
- Memoizer.cs
- assemblycache.cs
- MarshalByRefObject.cs
- XmlDocument.cs
- Mappings.cs
- EntityClassGenerator.cs
- CodeLabeledStatement.cs
- PropertyGridEditorPart.cs
- BamlLocalizabilityResolver.cs
- ExceptionWrapper.cs
- CellRelation.cs
- UserControl.cs
- ImportCatalogPart.cs
- InfoCardServiceInstallComponent.cs
- OracleCommand.cs
- TextAnchor.cs
- CacheOutputQuery.cs
- ClientCultureInfo.cs
- SqlRecordBuffer.cs
- SafeFindHandle.cs
- MouseGesture.cs
- DataDocumentXPathNavigator.cs
- DBDataPermission.cs
- SQLDouble.cs
- BitmapData.cs
- Property.cs
- ObjectStateEntryDbDataRecord.cs
- ScriptServiceAttribute.cs
- Mapping.cs
- CachedResourceDictionaryExtension.cs
- SystemIcons.cs
- ObjectDataSourceMethodEventArgs.cs
- ZeroOpNode.cs
- EventLogPermissionEntryCollection.cs
- ObjectView.cs
- CallInfo.cs
- __Error.cs
- Matrix3DValueSerializer.cs
- RtfControlWordInfo.cs
- CookieProtection.cs
- ActivityCompletionCallbackWrapper.cs
- DiagnosticTraceRecords.cs
- Marshal.cs
- TrackingServices.cs
- infer.cs
- SqlTrackingWorkflowInstance.cs
- TextRunCacheImp.cs
- FileFormatException.cs
- SizeConverter.cs
- DelegatingTypeDescriptionProvider.cs
- XsdDataContractExporter.cs
- CharEntityEncoderFallback.cs
- ZipIOLocalFileHeader.cs
- FileClassifier.cs
- InvalidCommandTreeException.cs
- XmlWriter.cs
- DbUpdateCommandTree.cs
- ServiceOperationParameter.cs
- RepeatButtonAutomationPeer.cs
- XmlAttributes.cs
- ToolStripRenderEventArgs.cs
- InvocationExpression.cs
- HostProtectionException.cs
- SimpleTypeResolver.cs
- RC2.cs
- SoapUnknownHeader.cs
- VirtualPath.cs
- XmlSchemaException.cs
- SessionIDManager.cs
- NameValueCollection.cs
- RestClientProxyHandler.cs
- ListView.cs
- NameValueSectionHandler.cs
- _StreamFramer.cs
- ListViewItemMouseHoverEvent.cs
- ForwardPositionQuery.cs
- rsa.cs
- MatchSingleFxEngineOpcode.cs
- DropShadowEffect.cs
- AvTraceDetails.cs
- JsonEnumDataContract.cs
- PassportAuthenticationEventArgs.cs
- LazyInitializer.cs
- HttpRuntimeSection.cs
- ExpressionBinding.cs
- HashStream.cs
- ExpressionConverter.cs
- storagemappingitemcollection.viewdictionary.cs
- State.cs
- WebPartConnectionsCloseVerb.cs
- Converter.cs
- SQLDouble.cs
- BuildManager.cs
- UIntPtr.cs
- RootProfilePropertySettingsCollection.cs
- NameObjectCollectionBase.cs
- CqlGenerator.cs