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
- XmlException.cs
- XslAstAnalyzer.cs
- LineBreak.cs
- ResourceDictionaryCollection.cs
- MenuItemBindingCollection.cs
- FileLoadException.cs
- ErrorFormatterPage.cs
- UriGenerator.cs
- AffineTransform3D.cs
- ProfileSettingsCollection.cs
- Hashtable.cs
- WindowsComboBox.cs
- DynamicRenderer.cs
- Win32.cs
- WebBrowserNavigatedEventHandler.cs
- PresentationTraceSources.cs
- Stopwatch.cs
- OutKeywords.cs
- Permission.cs
- PrintDocument.cs
- QuaternionRotation3D.cs
- DataTableReaderListener.cs
- XmlUtil.cs
- IndexedString.cs
- Rect.cs
- XComponentModel.cs
- DataGridClipboardHelper.cs
- BitmapInitialize.cs
- StringUtil.cs
- EntityConnectionStringBuilder.cs
- RuleSettingsCollection.cs
- StringUtil.cs
- FrameworkElementAutomationPeer.cs
- XmlValueConverter.cs
- EventLogEntry.cs
- HtmlToClrEventProxy.cs
- XmlSchemaSet.cs
- RoutedCommand.cs
- BrowsableAttribute.cs
- PolygonHotSpot.cs
- ResourceProperty.cs
- TextBlock.cs
- EnumerationRangeValidationUtil.cs
- SerialPort.cs
- XmlUnspecifiedAttribute.cs
- HttpResponseHeader.cs
- SendActivityDesigner.cs
- UpDownEvent.cs
- PreDigestedSignedInfo.cs
- DetailsViewDeletedEventArgs.cs
- FormattedText.cs
- TextAdaptor.cs
- GeometryConverter.cs
- MaterialGroup.cs
- SafeNativeMethods.cs
- FamilyMapCollection.cs
- DataGridViewRowEventArgs.cs
- DeflateEmulationStream.cs
- DefaultTraceListener.cs
- ConnectionManager.cs
- Main.cs
- AspProxy.cs
- MemoryStream.cs
- LineSegment.cs
- LoginViewDesigner.cs
- SqlNodeAnnotation.cs
- SpecialFolderEnumConverter.cs
- ContainerParaClient.cs
- EdmItemError.cs
- EnvironmentPermission.cs
- IIS7WorkerRequest.cs
- MD5CryptoServiceProvider.cs
- xdrvalidator.cs
- ContextStaticAttribute.cs
- Native.cs
- InkCanvasFeedbackAdorner.cs
- WmlPageAdapter.cs
- ProcessHostConfigUtils.cs
- CacheMode.cs
- Brush.cs
- XmlBinaryReader.cs
- HashCodeCombiner.cs
- DrawingContext.cs
- XmlNotation.cs
- PagesSection.cs
- IListConverters.cs
- Configuration.cs
- Help.cs
- DbProviderFactoriesConfigurationHandler.cs
- CodeSnippetStatement.cs
- ApplicationDirectoryMembershipCondition.cs
- ConnectionManagementSection.cs
- IconConverter.cs
- PerformanceCountersBase.cs
- X509Chain.cs
- InfoCardPolicy.cs
- SecurityUtils.cs
- CompilerInfo.cs
- TextElement.cs
- GridView.cs