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
- DirectionalLight.cs
- PropertyCollection.cs
- XmlSchemaAnnotation.cs
- ToolStripItem.cs
- SourceFileInfo.cs
- EntityStoreSchemaFilterEntry.cs
- RowToParametersTransformer.cs
- GACMembershipCondition.cs
- FacetChecker.cs
- MapPathBasedVirtualPathProvider.cs
- UIPermission.cs
- HtmlSelect.cs
- TextTreeUndoUnit.cs
- StructuredProperty.cs
- UserControl.cs
- CompiledQuery.cs
- Expression.cs
- GenericRootAutomationPeer.cs
- TypeUsageBuilder.cs
- MetafileHeaderEmf.cs
- CodeObjectCreateExpression.cs
- VisualStyleElement.cs
- ReadOnlyPropertyMetadata.cs
- Rect.cs
- BatchStream.cs
- TextFormatterContext.cs
- PixelFormatConverter.cs
- PackagingUtilities.cs
- _ChunkParse.cs
- Animatable.cs
- SqlDataSourceCommandEventArgs.cs
- WebRequest.cs
- Light.cs
- NetworkInformationPermission.cs
- CompilationUtil.cs
- SqlFormatter.cs
- VirtualPathUtility.cs
- XhtmlTextWriter.cs
- BooleanExpr.cs
- SqlStatistics.cs
- TraceEventCache.cs
- ConfigurationStrings.cs
- ImageFormatConverter.cs
- QueryStringParameter.cs
- ObjectConverter.cs
- OleServicesContext.cs
- ObservableDictionary.cs
- ProxyManager.cs
- InkCanvasInnerCanvas.cs
- FileInfo.cs
- ContentElement.cs
- MatcherBuilder.cs
- FlowDocumentReaderAutomationPeer.cs
- ScriptRegistrationManager.cs
- AutomationPropertyInfo.cs
- TypeBrowserDialog.cs
- TouchPoint.cs
- QilGenerator.cs
- CheckedListBox.cs
- ButtonFieldBase.cs
- GreenMethods.cs
- ListSourceHelper.cs
- InvokeBase.cs
- HashHelper.cs
- SizeConverter.cs
- XmlDataSourceNodeDescriptor.cs
- DebugHandleTracker.cs
- DataSourceComponent.cs
- HttpClientCertificate.cs
- ActivityExecutorDelegateInfo.cs
- UnmanagedMemoryStreamWrapper.cs
- X509SecurityToken.cs
- InkCanvas.cs
- HwndSubclass.cs
- ToggleButtonAutomationPeer.cs
- MenuItemBinding.cs
- CellParaClient.cs
- Logging.cs
- TextBoxBase.cs
- NumericUpDown.cs
- AccessControlEntry.cs
- RegexRunnerFactory.cs
- ConfigPathUtility.cs
- DummyDataSource.cs
- DataMisalignedException.cs
- DataGridTableCollection.cs
- BuildProvidersCompiler.cs
- XmlElementElement.cs
- XmlPreloadedResolver.cs
- DbConnectionPoolIdentity.cs
- DivideByZeroException.cs
- CacheAxisQuery.cs
- EmbeddedObject.cs
- SystemNetworkInterface.cs
- X509SubjectKeyIdentifierClause.cs
- OLEDB_Util.cs
- PolicyException.cs
- DataControlField.cs
- DataObjectCopyingEventArgs.cs
- Transform.cs