Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / SequenceRange.cs / 1 / SequenceRange.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Globalization; struct SequenceRange { // fields Int64 lower; Int64 upper; // constructors public SequenceRange(Int64 number): this(number, number) { } public SequenceRange(Int64 lower, Int64 upper) { if (lower < 0) { DiagnosticUtility.DebugAssert("Argument lower cannot be negative."); throw DiagnosticUtility.ExceptionUtility.ThrowHelperInternal(false); } if (lower > upper) { DiagnosticUtility.DebugAssert("Argument upper cannot be less than argument lower."); throw DiagnosticUtility.ExceptionUtility.ThrowHelperInternal(false); } this.lower = lower; this.upper = upper; } // properties public Int64 Lower { get { return this.lower; } } public Int64 Upper { get { return this.upper; } } public static bool operator ==(SequenceRange a, SequenceRange b) { return (a.lower == b.lower) && (a.upper == b.upper); } public static bool operator !=(SequenceRange a, SequenceRange b) { return !(a == b); } public bool Contains(Int64 number) { return (number >= this.lower && number <= this.upper); } public bool Contains(SequenceRange range) { return (range.Lower >= this.lower && range.Upper <= this.upper); } public override bool Equals(object obj) { if (obj == null) { return false; } else if (obj is SequenceRange) { return this == (SequenceRange)obj; } else { return false; } } public override int GetHashCode() { Int64 hashCode = (this.upper ^ (this.upper - this.lower)); return (int) ((hashCode << 32) ^ (hashCode >> 32)); } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "{0}-{1}", this.lower, this.upper); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewCellMouseEventArgs.cs
- BaseHashHelper.cs
- CultureTable.cs
- XPathChildIterator.cs
- DateTimeOffsetConverter.cs
- DescendantBaseQuery.cs
- TranslateTransform3D.cs
- SecureEnvironment.cs
- AttachedAnnotation.cs
- FontEmbeddingManager.cs
- InvokeProviderWrapper.cs
- DocumentViewer.cs
- Part.cs
- MdiWindowListStrip.cs
- ThemeableAttribute.cs
- FileDialog_Vista_Interop.cs
- QuotedPrintableStream.cs
- MenuItem.cs
- ProfileService.cs
- RuntimeConfig.cs
- BaseParagraph.cs
- SafeProcessHandle.cs
- _SingleItemRequestCache.cs
- TableLayoutPanelCellPosition.cs
- ControlHelper.cs
- FormsAuthenticationModule.cs
- LinqDataSourceSelectEventArgs.cs
- CodeChecksumPragma.cs
- DefinitionBase.cs
- DataColumnMapping.cs
- Table.cs
- ReadonlyMessageFilter.cs
- ExpressionValueEditor.cs
- RowParagraph.cs
- AppliedDeviceFiltersEditor.cs
- MarkerProperties.cs
- CodePrimitiveExpression.cs
- EncryptedReference.cs
- BaseComponentEditor.cs
- SafeSystemMetrics.cs
- CodeCastExpression.cs
- DetailsViewModeEventArgs.cs
- BindingMemberInfo.cs
- ApplicationDirectoryMembershipCondition.cs
- QilLoop.cs
- ToolStripDropDownItem.cs
- PageRouteHandler.cs
- RootProfilePropertySettingsCollection.cs
- ApplicationSettingsBase.cs
- BamlTreeMap.cs
- HttpPostProtocolReflector.cs
- TrackingProfileManager.cs
- XLinq.cs
- MetadataCollection.cs
- SystemFonts.cs
- SamlSecurityTokenAuthenticator.cs
- TextTreePropertyUndoUnit.cs
- Object.cs
- WebPartMenu.cs
- CompensableActivity.cs
- NetworkStream.cs
- MailSettingsSection.cs
- DependencyObjectProvider.cs
- DBCommandBuilder.cs
- TypeGenericEnumerableViewSchema.cs
- Splitter.cs
- InternalControlCollection.cs
- HtmlTable.cs
- IImplicitResourceProvider.cs
- ComponentConverter.cs
- StreamGeometry.cs
- DataFormats.cs
- BuiltInExpr.cs
- OciHandle.cs
- Buffer.cs
- FixedSOMFixedBlock.cs
- HttpVersion.cs
- CommonObjectSecurity.cs
- LabelLiteral.cs
- FontCacheUtil.cs
- BlurBitmapEffect.cs
- OverflowException.cs
- AttributeProviderAttribute.cs
- AccessDataSource.cs
- RecordsAffectedEventArgs.cs
- SqlSelectStatement.cs
- PixelShader.cs
- PolicyStatement.cs
- AccessedThroughPropertyAttribute.cs
- MiniConstructorInfo.cs
- XpsFilter.cs
- ServiceParser.cs
- HandlerBase.cs
- TextEditorLists.cs
- Memoizer.cs
- LinearGradientBrush.cs
- SqlCharStream.cs
- TextRangeSerialization.cs
- LexicalChunk.cs
- BasePattern.cs