Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SelectionProcessor.cs
- FixedTextBuilder.cs
- SqlCommandSet.cs
- QuaternionAnimation.cs
- XslUrlEditor.cs
- GenericArgumentsUpdater.cs
- Event.cs
- TimersDescriptionAttribute.cs
- TableLayoutColumnStyleCollection.cs
- StylusCollection.cs
- _TLSstream.cs
- SendMailErrorEventArgs.cs
- DataGridViewBand.cs
- FormatterConverter.cs
- DiscoveryDocumentSearchPattern.cs
- ToolboxComponentsCreatingEventArgs.cs
- XamlSerializerUtil.cs
- EntityDataSourceWrapperCollection.cs
- Choices.cs
- SafeCloseHandleCritical.cs
- SwitchElementsCollection.cs
- InstancePersistenceCommandException.cs
- Profiler.cs
- ChooseAction.cs
- FormatVersion.cs
- ResXResourceReader.cs
- ErrorWebPart.cs
- StringInfo.cs
- CompilerParameters.cs
- URLIdentityPermission.cs
- ParameterRetriever.cs
- CheckoutException.cs
- QuaternionAnimationBase.cs
- JapaneseCalendar.cs
- SingleResultAttribute.cs
- ListViewAutomationPeer.cs
- CreateParams.cs
- AnnotationResource.cs
- WebPartDisplayModeEventArgs.cs
- SendMailErrorEventArgs.cs
- NavigationCommands.cs
- CatalogPartChrome.cs
- PeerNodeTraceRecord.cs
- BaseValidator.cs
- ErrorHandler.cs
- EmptyStringExpandableObjectConverter.cs
- ImageSource.cs
- CredentialCache.cs
- ProcessingInstructionAction.cs
- FlowDocumentPageViewerAutomationPeer.cs
- SchemaElement.cs
- _NetworkingPerfCounters.cs
- PropertyRecord.cs
- XmlSerializableServices.cs
- PersonalizationAdministration.cs
- BasicExpressionVisitor.cs
- UdpDiscoveryEndpoint.cs
- DSACryptoServiceProvider.cs
- XmlFormatReaderGenerator.cs
- Point3D.cs
- ComEventsHelper.cs
- ConfigurationStrings.cs
- ReliabilityContractAttribute.cs
- TaskScheduler.cs
- Propagator.Evaluator.cs
- XmlCountingReader.cs
- ProviderConnectionPoint.cs
- WindowsTreeView.cs
- Item.cs
- VoiceSynthesis.cs
- MasterPageParser.cs
- BrowserTree.cs
- BindingBase.cs
- Grant.cs
- MetadataHelper.cs
- Cell.cs
- UtilityExtension.cs
- NativeMethods.cs
- FormViewPagerRow.cs
- ExpressionPrefixAttribute.cs
- ImageAttributes.cs
- TraceLog.cs
- XmlWriter.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- FileDialogCustomPlacesCollection.cs
- SiteMapNodeItem.cs
- ProjectionCamera.cs
- CodeExpressionCollection.cs
- DefaultClaimSet.cs
- Overlapped.cs
- PassportAuthenticationModule.cs
- StructuredType.cs
- GradientBrush.cs
- PathGeometry.cs
- NodeInfo.cs
- ResizeGrip.cs
- StylusPointCollection.cs
- OleDbDataAdapter.cs
- AttachedPropertyBrowsableAttribute.cs
- ButtonStandardAdapter.cs