Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- LowerCaseStringConverter.cs
- EnvironmentPermission.cs
- AutomationPropertyInfo.cs
- Stroke.cs
- DragDrop.cs
- XamlStyleSerializer.cs
- StringReader.cs
- ManipulationDevice.cs
- MessageFault.cs
- StringWriter.cs
- PropertyDescriptor.cs
- TypeResolvingOptions.cs
- DataPointer.cs
- DesignerActionMethodItem.cs
- SafeRightsManagementHandle.cs
- WebHeaderCollection.cs
- TemplateBindingExtensionConverter.cs
- RegexStringValidator.cs
- XsdBuildProvider.cs
- ConnectionInterfaceCollection.cs
- RadioButtonAutomationPeer.cs
- XmlNamespaceDeclarationsAttribute.cs
- SetIterators.cs
- ValidateNames.cs
- SafeNativeMethodsCLR.cs
- SqlFacetAttribute.cs
- TypedDatasetGenerator.cs
- TcpChannelHelper.cs
- ErrorRuntimeConfig.cs
- QueryInterceptorAttribute.cs
- PinnedBufferMemoryStream.cs
- SignedXml.cs
- Conditional.cs
- SQLInt32Storage.cs
- QilDataSource.cs
- MailAddressCollection.cs
- ServiceModelExtensionCollectionElement.cs
- StandardToolWindows.cs
- CustomLineCap.cs
- ReadOnlyObservableCollection.cs
- _CacheStreams.cs
- ArraySet.cs
- DocComment.cs
- EntityDescriptor.cs
- ImageList.cs
- FormCollection.cs
- RealizationDrawingContextWalker.cs
- MsmqIntegrationBindingElement.cs
- Cell.cs
- StateRuntime.cs
- SafeEventLogWriteHandle.cs
- HighContrastHelper.cs
- HttpInputStream.cs
- SoapProtocolReflector.cs
- SafeCryptoHandles.cs
- ActiveXSite.cs
- WebControl.cs
- SqlDataReader.cs
- InputLanguage.cs
- EncoderParameters.cs
- _CookieModule.cs
- _Events.cs
- ParagraphResult.cs
- SafeSystemMetrics.cs
- VolatileEnlistmentMultiplexing.cs
- CodeMethodReturnStatement.cs
- ControlBuilder.cs
- ChangeNode.cs
- TextServicesDisplayAttribute.cs
- XmlDocumentType.cs
- SoapObjectReader.cs
- QueryContinueDragEvent.cs
- CollectionDataContractAttribute.cs
- XamlPointCollectionSerializer.cs
- RuleDefinitions.cs
- ResXFileRef.cs
- OneOfTypeConst.cs
- MouseEvent.cs
- TransactionWaitAsyncResult.cs
- DataGridViewTextBoxColumn.cs
- GCHandleCookieTable.cs
- SHA512Managed.cs
- PropertyTabChangedEvent.cs
- Decorator.cs
- DelayedRegex.cs
- WSFederationHttpSecurityElement.cs
- PeerSecurityHelpers.cs
- SizeLimitedCache.cs
- ContextStaticAttribute.cs
- SelectionHighlightInfo.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- WindowsToolbarAsMenu.cs
- ImportContext.cs
- FrameworkElement.cs
- WindowInteractionStateTracker.cs
- HostProtectionPermission.cs
- BaseHashHelper.cs
- BitmapEffectDrawingContextState.cs
- SQLGuidStorage.cs
- CanonicalFontFamilyReference.cs