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
- WebConfigurationHostFileChange.cs
- PrintPreviewControl.cs
- ReaderOutput.cs
- DesignerOptions.cs
- ServiceDescriptionReflector.cs
- BindingElement.cs
- WorkflowValidationFailedException.cs
- ProgressBarHighlightConverter.cs
- CellCreator.cs
- QueryAccessibilityHelpEvent.cs
- DSASignatureDeformatter.cs
- ValueHandle.cs
- CaretElement.cs
- AuthenticateEventArgs.cs
- recordstatescratchpad.cs
- MailWriter.cs
- PenContext.cs
- Color.cs
- BaseCodePageEncoding.cs
- WebPartConnectionsCancelVerb.cs
- Semaphore.cs
- WebServicesSection.cs
- ManipulationVelocities.cs
- HttpContext.cs
- Zone.cs
- DoubleSumAggregationOperator.cs
- PanelStyle.cs
- RealProxy.cs
- ProfileGroupSettings.cs
- DiagnosticStrings.cs
- FixedSOMPageElement.cs
- DbConnectionPoolOptions.cs
- LinqDataSourceHelper.cs
- UriScheme.cs
- FileController.cs
- DataGridViewTextBoxEditingControl.cs
- ChangeBlockUndoRecord.cs
- Overlapped.cs
- BitmapEffectCollection.cs
- Int16AnimationUsingKeyFrames.cs
- _SslState.cs
- NullReferenceException.cs
- EditorPart.cs
- TextControl.cs
- FixedDocumentSequencePaginator.cs
- Separator.cs
- AuthenticationException.cs
- Pair.cs
- AttachedAnnotation.cs
- XNameTypeConverter.cs
- MenuItem.cs
- DoubleLink.cs
- ExpressionEditorAttribute.cs
- MarkedHighlightComponent.cs
- ObjectSet.cs
- PKCS1MaskGenerationMethod.cs
- SmiXetterAccessMap.cs
- EntityCodeGenerator.cs
- BezierSegment.cs
- DataGridHelper.cs
- MulticastNotSupportedException.cs
- XhtmlMobileTextWriter.cs
- TypeLoadException.cs
- ScopelessEnumAttribute.cs
- HitTestResult.cs
- ListViewSortEventArgs.cs
- FontCacheUtil.cs
- SplitterEvent.cs
- Pair.cs
- DataSourceXmlSubItemAttribute.cs
- SynthesizerStateChangedEventArgs.cs
- GetPageCompletedEventArgs.cs
- serverconfig.cs
- BitmapData.cs
- ProgressBarHighlightConverter.cs
- ForeignKeyConstraint.cs
- SqlUdtInfo.cs
- Configuration.cs
- SuppressMergeCheckAttribute.cs
- ConsoleCancelEventArgs.cs
- CheckBoxRenderer.cs
- Int64KeyFrameCollection.cs
- AudienceUriMode.cs
- EnterpriseServicesHelper.cs
- ValueExpressions.cs
- HandleScope.cs
- NumericUpDownAccelerationCollection.cs
- RadioButton.cs
- StandardOleMarshalObject.cs
- FormattedTextSymbols.cs
- TextSerializer.cs
- SubqueryRules.cs
- ApplicationSecurityManager.cs
- DescendantBaseQuery.cs
- StronglyTypedResourceBuilder.cs
- QilList.cs
- Stylus.cs
- TextSegment.cs
- KeyValuePair.cs
- _ContextAwareResult.cs