Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / SourceItem.cs / 1305600 / 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
- StatusBarDrawItemEvent.cs
- XmlStringTable.cs
- TreeView.cs
- IntranetCredentialPolicy.cs
- CqlQuery.cs
- DataListCommandEventArgs.cs
- Mouse.cs
- HTMLTextWriter.cs
- ExecutionTracker.cs
- SplineKeyFrames.cs
- HttpContext.cs
- GlyphInfoList.cs
- SqlRowUpdatedEvent.cs
- DataContractSerializerOperationFormatter.cs
- WindowsListViewScroll.cs
- OleDbSchemaGuid.cs
- ProfileSettingsCollection.cs
- EnumerableRowCollectionExtensions.cs
- InkSerializer.cs
- ApplicationManager.cs
- HotSpot.cs
- TraceInternal.cs
- TableLayoutRowStyleCollection.cs
- WindowsGraphicsCacheManager.cs
- DataColumn.cs
- TranslateTransform3D.cs
- WebPartDescriptionCollection.cs
- IndexingContentUnit.cs
- StatusBarDrawItemEvent.cs
- CheckBoxFlatAdapter.cs
- ResourceSetExpression.cs
- OleDbPermission.cs
- HttpInputStream.cs
- ArrayMergeHelper.cs
- AuthenticationModulesSection.cs
- MatrixKeyFrameCollection.cs
- TextBox.cs
- ISO2022Encoding.cs
- DateTimePicker.cs
- StrokeIntersection.cs
- DataKey.cs
- ObjectDataSourceSelectingEventArgs.cs
- XmlHierarchicalEnumerable.cs
- DBSqlParserColumnCollection.cs
- BuildProvidersCompiler.cs
- ToolBar.cs
- ContainerUIElement3D.cs
- XPathDocument.cs
- XmlQueryOutput.cs
- translator.cs
- AuthenticationSection.cs
- HtmlInputText.cs
- RC2.cs
- DebugInfoGenerator.cs
- FtpCachePolicyElement.cs
- WorkflowQueue.cs
- NullRuntimeConfig.cs
- ChangeTracker.cs
- Converter.cs
- ServicePointManager.cs
- MenuItemCollection.cs
- PageFunction.cs
- DataTablePropertyDescriptor.cs
- ListView.cs
- AspNetSynchronizationContext.cs
- TraceContextEventArgs.cs
- GridToolTip.cs
- MemberMaps.cs
- ToolStripComboBox.cs
- ScaleTransform3D.cs
- FixedPageAutomationPeer.cs
- OpCellTreeNode.cs
- PolygonHotSpot.cs
- RSACryptoServiceProvider.cs
- Highlights.cs
- EmbeddedMailObjectCollectionEditor.cs
- DataGridItemCollection.cs
- WizardForm.cs
- InputDevice.cs
- CompositeFontFamily.cs
- TextTreeDeleteContentUndoUnit.cs
- SelectingProviderEventArgs.cs
- ConfigurationStrings.cs
- LayoutSettings.cs
- KeyMatchBuilder.cs
- ActivitySurrogateSelector.cs
- MonikerProxyAttribute.cs
- StoreAnnotationsMap.cs
- DataGridViewRow.cs
- DataGridCell.cs
- SequenceFullException.cs
- CachedFontFamily.cs
- x509utils.cs
- InheritanceContextHelper.cs
- DataGridRowClipboardEventArgs.cs
- Matrix3D.cs
- Condition.cs
- SortQuery.cs
- Stroke.cs
- SmtpMail.cs