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
- ProfileGroupSettings.cs
- AppSettingsSection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- IProvider.cs
- EntityDataSourceWrapperCollection.cs
- ProcessModuleCollection.cs
- OracleEncoding.cs
- IPAddress.cs
- Workspace.cs
- documentsequencetextview.cs
- SecureUICommand.cs
- BrowserTree.cs
- ModuleConfigurationInfo.cs
- ImageDrawing.cs
- WebPartConnectionsConfigureVerb.cs
- DataSvcMapFile.cs
- ServiceInstallComponent.cs
- SQLInt16Storage.cs
- EmptyEnumerable.cs
- EditingMode.cs
- ReferentialConstraint.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- FrameworkContentElement.cs
- GeometryModel3D.cs
- DataGridViewColumnHeaderCell.cs
- VersionValidator.cs
- TypeConverters.cs
- BitmapMetadataEnumerator.cs
- Pool.cs
- ToolStripPanelDesigner.cs
- Types.cs
- EventQueueState.cs
- ChooseAction.cs
- TypedElement.cs
- EntityViewGenerator.cs
- AutomationElementCollection.cs
- ProviderCommandInfoUtils.cs
- GridView.cs
- SQLDateTime.cs
- InteropTrackingRecord.cs
- ListBase.cs
- ContentElement.cs
- TriggerActionCollection.cs
- StringConcat.cs
- AssociationSetEnd.cs
- ActivityExecutorOperation.cs
- PathFigureCollectionValueSerializer.cs
- HttpCacheVary.cs
- DBSchemaTable.cs
- ApplicationDirectory.cs
- FastEncoderWindow.cs
- TextStore.cs
- QilLiteral.cs
- HierarchicalDataSourceIDConverter.cs
- DataColumnMapping.cs
- TemplateBindingExpressionConverter.cs
- EdmValidator.cs
- ClickablePoint.cs
- FlowDocumentPageViewerAutomationPeer.cs
- DataColumn.cs
- HeaderedItemsControl.cs
- NativeMethods.cs
- NotSupportedException.cs
- SubclassTypeValidatorAttribute.cs
- VisualStyleInformation.cs
- StringReader.cs
- DynamicResourceExtensionConverter.cs
- FtpRequestCacheValidator.cs
- ProvideValueServiceProvider.cs
- ObjectContext.cs
- SessionEndingCancelEventArgs.cs
- Vector3DCollectionValueSerializer.cs
- DetailsView.cs
- COM2IDispatchConverter.cs
- QilChoice.cs
- XmlAttribute.cs
- PreApplicationStartMethodAttribute.cs
- PropertyItemInternal.cs
- ConfigXmlCDataSection.cs
- PriorityBindingExpression.cs
- SplitterEvent.cs
- SqlDataSourceConfigureSelectPanel.cs
- WebBrowserNavigatedEventHandler.cs
- PrimitiveSchema.cs
- PeerContact.cs
- ApplicationSecurityManager.cs
- SessionEndedEventArgs.cs
- Int16Animation.cs
- EvidenceBase.cs
- PowerStatus.cs
- WarningException.cs
- SmiXetterAccessMap.cs
- VisemeEventArgs.cs
- ByteFacetDescriptionElement.cs
- TypeForwardedToAttribute.cs
- UInt64Storage.cs
- MenuRenderer.cs
- StrokeNode.cs
- ProcessMonitor.cs
- EncryptedReference.cs