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
- ProcessModule.cs
- ObjectDataSourceView.cs
- PerformanceCounterLib.cs
- StylusButton.cs
- DATA_BLOB.cs
- NotifyIcon.cs
- EdmItemCollection.OcAssemblyCache.cs
- XmlQueryType.cs
- WebExceptionStatus.cs
- ParseChildrenAsPropertiesAttribute.cs
- TextTabProperties.cs
- StringBuilder.cs
- ButtonField.cs
- ColorComboBox.cs
- CommonDialog.cs
- BasePattern.cs
- RegexParser.cs
- Scene3D.cs
- RequestCachePolicy.cs
- StorageMappingItemLoader.cs
- ClaimComparer.cs
- EditCommandColumn.cs
- SafeNativeMethods.cs
- TableLayoutStyle.cs
- SynchronizingStream.cs
- UiaCoreTypesApi.cs
- Reference.cs
- TypeInformation.cs
- ElementProxy.cs
- ReferencedAssembly.cs
- JsonFormatWriterGenerator.cs
- LocatorPartList.cs
- OrthographicCamera.cs
- IPipelineRuntime.cs
- TreeViewImageIndexConverter.cs
- SecurityPolicySection.cs
- AuthStoreRoleProvider.cs
- CommunicationObjectAbortedException.cs
- Clipboard.cs
- XmlSchemaAppInfo.cs
- SqlDataSourceConfigureSelectPanel.cs
- SHA512.cs
- ClientData.cs
- FuncTypeConverter.cs
- SplashScreen.cs
- UmAlQuraCalendar.cs
- TableHeaderCell.cs
- CodeMemberMethod.cs
- RegexGroup.cs
- PrinterSettings.cs
- HelpProvider.cs
- GPStream.cs
- MsmqHostedTransportManager.cs
- EncodingDataItem.cs
- OutputCacheProfileCollection.cs
- OdbcEnvironmentHandle.cs
- StyleXamlParser.cs
- InternalControlCollection.cs
- TextFormatterHost.cs
- CallContext.cs
- DebugView.cs
- BreakSafeBase.cs
- LookupNode.cs
- CodeExporter.cs
- ObjectTag.cs
- PersistenceException.cs
- FixUp.cs
- ScrollBarAutomationPeer.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ContentFileHelper.cs
- GridViewRow.cs
- ThrowHelper.cs
- Pair.cs
- Axis.cs
- SplitterPanel.cs
- GlobalItem.cs
- XmlSubtreeReader.cs
- BrowserCapabilitiesCodeGenerator.cs
- Stream.cs
- Listbox.cs
- DebuggerAttributes.cs
- CursorInteropHelper.cs
- RuntimeVariablesExpression.cs
- AssertSection.cs
- ErasingStroke.cs
- TransactionTraceIdentifier.cs
- XmlIgnoreAttribute.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- MobileCapabilities.cs
- Typeface.cs
- Point3DAnimation.cs
- EventMap.cs
- Quad.cs
- SqlCacheDependencyDatabaseCollection.cs
- RangeValidator.cs
- XPathAxisIterator.cs
- FrameworkTemplate.cs
- Pts.cs
- ErrorWrapper.cs
- NetworkAddressChange.cs