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
- DesignSurface.cs
- SmtpFailedRecipientException.cs
- NotFiniteNumberException.cs
- ImpersonationContext.cs
- Vector3D.cs
- Decorator.cs
- RuleSetDialog.Designer.cs
- MatrixCamera.cs
- TransformDescriptor.cs
- ISFTagAndGuidCache.cs
- InvokeCompletedEventArgs.cs
- Listbox.cs
- Odbc32.cs
- connectionpool.cs
- Command.cs
- ListView.cs
- ActivityDesignerHighlighter.cs
- SqlConnectionHelper.cs
- WindowsButton.cs
- WindowsSolidBrush.cs
- DataGridViewCellLinkedList.cs
- Run.cs
- UidManager.cs
- Attributes.cs
- BaseAppDomainProtocolHandler.cs
- Condition.cs
- BasicExpandProvider.cs
- ConfigurationValidatorBase.cs
- CodeTypeParameterCollection.cs
- TextFormatterContext.cs
- ListSurrogate.cs
- DataBoundControlAdapter.cs
- SizeChangedInfo.cs
- ReferenceAssemblyAttribute.cs
- ColorBuilder.cs
- AuthenticationModulesSection.cs
- JsonSerializer.cs
- LayoutInformation.cs
- NGCSerializerAsync.cs
- SupportsEventValidationAttribute.cs
- UserThread.cs
- MarkupCompilePass1.cs
- BitVector32.cs
- MenuItem.cs
- MinimizableAttributeTypeConverter.cs
- NodeLabelEditEvent.cs
- X509CertificateCollection.cs
- ReflectionServiceProvider.cs
- DesignerActionService.cs
- _NegotiateClient.cs
- KoreanLunisolarCalendar.cs
- HttpListenerElement.cs
- BindingBase.cs
- InternalCache.cs
- XPathException.cs
- ProtocolsConfiguration.cs
- ReadOnlyDictionary.cs
- CompensateDesigner.cs
- Assert.cs
- CqlParser.cs
- XsdBuilder.cs
- ElementProxy.cs
- CollectionEditor.cs
- ValueQuery.cs
- SmtpClient.cs
- WebPartConnectionsEventArgs.cs
- EntityDataReader.cs
- BookmarkManager.cs
- DataContract.cs
- ElementNotEnabledException.cs
- SapiInterop.cs
- Timeline.cs
- PassportAuthenticationEventArgs.cs
- RuntimeConfigLKG.cs
- DockPanel.cs
- DataRelation.cs
- XPathNode.cs
- XmlChildNodes.cs
- Attribute.cs
- GridViewColumnHeader.cs
- KeyInterop.cs
- ExpressionVisitor.cs
- DataGridViewSortCompareEventArgs.cs
- FontEmbeddingManager.cs
- PresentationAppDomainManager.cs
- FrameSecurityDescriptor.cs
- XslUrlEditor.cs
- UnsafeMethods.cs
- DataBinding.cs
- CommandConverter.cs
- ProfilePropertySettings.cs
- ObjectDataSource.cs
- ChangeProcessor.cs
- SiteMapHierarchicalDataSourceView.cs
- smtpconnection.cs
- DataObjectSettingDataEventArgs.cs
- TaiwanLunisolarCalendar.cs
- NavigatorInput.cs
- FreezableOperations.cs
- GenericUriParser.cs