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
- KnownIds.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- JsonReaderDelegator.cs
- LabelEditEvent.cs
- RoutedEvent.cs
- TextRunTypographyProperties.cs
- CornerRadiusConverter.cs
- DependencyPropertyAttribute.cs
- StorageComplexPropertyMapping.cs
- XmlWrappingReader.cs
- SingleObjectCollection.cs
- TimelineGroup.cs
- SyndicationSerializer.cs
- CompensatableTransactionScopeActivity.cs
- SoapElementAttribute.cs
- TextParagraphProperties.cs
- Properties.cs
- BlobPersonalizationState.cs
- HyperLinkField.cs
- cookiecontainer.cs
- InputProcessorProfiles.cs
- BrowserDefinitionCollection.cs
- DataGridHeaderBorder.cs
- IPEndPoint.cs
- ExpressionTable.cs
- BitmapCacheBrush.cs
- LocalFileSettingsProvider.cs
- ScrollBar.cs
- DispatchProxy.cs
- TimeSpanOrInfiniteConverter.cs
- XmlAnyElementAttribute.cs
- DesignerOptionService.cs
- AsymmetricKeyExchangeFormatter.cs
- DbConnectionStringCommon.cs
- RawStylusInput.cs
- FastEncoderWindow.cs
- TypeToken.cs
- SystemWebCachingSectionGroup.cs
- SHA256Managed.cs
- StylusDevice.cs
- XmlNamespaceDeclarationsAttribute.cs
- MdiWindowListStrip.cs
- PrimitiveSchema.cs
- StrokeNodeEnumerator.cs
- HttpPostedFile.cs
- SchemaEntity.cs
- BackEase.cs
- ConfigXmlText.cs
- thaishape.cs
- InstanceDescriptor.cs
- GenerateTemporaryTargetAssembly.cs
- ExpandCollapseProviderWrapper.cs
- DataMember.cs
- Point.cs
- DeviceFilterEditorDialog.cs
- Assert.cs
- XmlSchemaAnnotation.cs
- SchemaTableOptionalColumn.cs
- ContentElement.cs
- CacheEntry.cs
- UInt16.cs
- WebPartMenu.cs
- AssemblyResolver.cs
- ProvidePropertyAttribute.cs
- DataFieldConverter.cs
- PixelShader.cs
- _DigestClient.cs
- ServiceBehaviorElementCollection.cs
- CodeTypeReference.cs
- SourceChangedEventArgs.cs
- ToolStripDropTargetManager.cs
- DataService.cs
- SpeechSynthesizer.cs
- DiagnosticsConfigurationHandler.cs
- TextElement.cs
- RightsManagementPermission.cs
- HtmlWindow.cs
- Enlistment.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- GlyphRunDrawing.cs
- LocalizationComments.cs
- ToolBarButton.cs
- AggregationMinMaxHelpers.cs
- Decoder.cs
- BindingOperations.cs
- DataGrid.cs
- QueryCorrelationInitializer.cs
- ServicePointManagerElement.cs
- TargetConverter.cs
- OdbcReferenceCollection.cs
- NoResizeHandleGlyph.cs
- TypeExtensionSerializer.cs
- ThicknessAnimationUsingKeyFrames.cs
- TreeViewDesigner.cs
- sqlmetadatafactory.cs
- FixedSOMSemanticBox.cs
- DockAndAnchorLayout.cs
- HatchBrush.cs
- WebPageTraceListener.cs
- FrameworkElement.cs