Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / SourceItem.cs / 1 / SourceItem.cs
using System; namespace System.Windows { // An item in the source context internal struct SourceItem { #region Construction // Constructor for SourceItem internal SourceItem(int startIndex, object source) { _startIndex = startIndex; _source = source; } #endregion Construction #region Operations // Gettor for StartIndex internal int StartIndex { get { return _startIndex; } } // Gettor for Source internal object Source { get { return _source; } } /* Commented out to avoid "uncalled private code" fxcop violation ////// Cleanup all the references within the data /// internal void Clear() { _startIndex = -1; _source = null; } */ ////// Is the given object equals the current /// public override bool Equals(object o) { return Equals((SourceItem)o); } ////// Is the given SourceItem equals the current /// public bool Equals(SourceItem sourceItem) { return ( sourceItem._startIndex == this._startIndex && sourceItem._source == this._source); } ////// Serves as a hash function for a particular type, suitable for use in /// hashing algorithms and data structures like a hash table /// public override int GetHashCode() { return base.GetHashCode(); } ////// Equals operator overload /// public static bool operator== (SourceItem sourceItem1, SourceItem sourceItem2) { return sourceItem1.Equals(sourceItem2); } ////// NotEquals operator overload /// public static bool operator!= (SourceItem sourceItem1, SourceItem sourceItem2) { return !sourceItem1.Equals(sourceItem2); } #endregion Operations #region Data private int _startIndex; private object _source; #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; namespace System.Windows { // An item in the source context internal struct SourceItem { #region Construction // Constructor for SourceItem internal SourceItem(int startIndex, object source) { _startIndex = startIndex; _source = source; } #endregion Construction #region Operations // Gettor for StartIndex internal int StartIndex { get { return _startIndex; } } // Gettor for Source internal object Source { get { return _source; } } /* Commented out to avoid "uncalled private code" fxcop violation ////// Cleanup all the references within the data /// internal void Clear() { _startIndex = -1; _source = null; } */ ////// Is the given object equals the current /// public override bool Equals(object o) { return Equals((SourceItem)o); } ////// Is the given SourceItem equals the current /// public bool Equals(SourceItem sourceItem) { return ( sourceItem._startIndex == this._startIndex && sourceItem._source == this._source); } ////// Serves as a hash function for a particular type, suitable for use in /// hashing algorithms and data structures like a hash table /// public override int GetHashCode() { return base.GetHashCode(); } ////// Equals operator overload /// public static bool operator== (SourceItem sourceItem1, SourceItem sourceItem2) { return sourceItem1.Equals(sourceItem2); } ////// NotEquals operator overload /// public static bool operator!= (SourceItem sourceItem1, SourceItem sourceItem2) { return !sourceItem1.Equals(sourceItem2); } #endregion Operations #region Data private int _startIndex; private object _source; #endregion Data } } // 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
- __FastResourceComparer.cs
- MulticastDelegate.cs
- Point3D.cs
- EventProperty.cs
- QuotedPairReader.cs
- ExceptionValidationRule.cs
- Binding.cs
- NameObjectCollectionBase.cs
- TabletDeviceInfo.cs
- ConfigXmlComment.cs
- StrongNameIdentityPermission.cs
- EmbeddedMailObjectsCollection.cs
- Icon.cs
- MergePropertyDescriptor.cs
- LineSegment.cs
- ObjectStateEntry.cs
- SocketException.cs
- DataAdapter.cs
- srgsitem.cs
- ZipIOExtraFieldPaddingElement.cs
- UnitySerializationHolder.cs
- PromptStyle.cs
- ReachPrintTicketSerializer.cs
- COM2ExtendedBrowsingHandler.cs
- NamespaceEmitter.cs
- FactoryGenerator.cs
- MatrixUtil.cs
- WebPageTraceListener.cs
- UdpSocket.cs
- RequestStatusBarUpdateEventArgs.cs
- PropertyNames.cs
- wgx_commands.cs
- ResourceContainer.cs
- DBNull.cs
- PtsCache.cs
- SystemIcmpV6Statistics.cs
- StringDictionary.cs
- DocumentPaginator.cs
- ConfigurationManagerInternal.cs
- MonitorWrapper.cs
- DefaultTextStore.cs
- SchemaMerger.cs
- OletxEnlistment.cs
- TableRowCollection.cs
- CreateUserErrorEventArgs.cs
- ListCollectionView.cs
- CodeCompiler.cs
- NonClientArea.cs
- XmlSchemaSubstitutionGroup.cs
- ConsoleKeyInfo.cs
- QuaternionIndependentAnimationStorage.cs
- PointAnimationUsingPath.cs
- XmlSerializer.cs
- Int32Collection.cs
- ListDesigner.cs
- AttributeXamlType.cs
- ReadOnlyDictionary.cs
- Missing.cs
- hresults.cs
- InputMethodStateChangeEventArgs.cs
- CompareValidator.cs
- LocalFileSettingsProvider.cs
- CopyOfAction.cs
- RequestTimeoutManager.cs
- InheritanceAttribute.cs
- ExtensionQuery.cs
- DomainUpDown.cs
- NamespaceMapping.cs
- WebServiceParameterData.cs
- Image.cs
- Enum.cs
- EvidenceTypeDescriptor.cs
- TextContainer.cs
- ObjectStorage.cs
- MethodRental.cs
- DataGridTable.cs
- EntityViewGenerationAttribute.cs
- ServerValidateEventArgs.cs
- TransactionOptions.cs
- Rotation3D.cs
- Double.cs
- ProfileGroupSettingsCollection.cs
- UrlMappingsSection.cs
- IndicFontClient.cs
- HttpModuleCollection.cs
- HtmlDocument.cs
- ExceptionRoutedEventArgs.cs
- PolicyValidator.cs
- GlyphInfoList.cs
- HeaderElement.cs
- SlipBehavior.cs
- WebServiceTypeData.cs
- DateTimeAutomationPeer.cs
- BamlReader.cs
- AndCondition.cs
- Query.cs
- PointCollection.cs
- TaskbarItemInfo.cs
- Helpers.cs
- Parameter.cs