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
- PictureBoxDesigner.cs
- Point3DConverter.cs
- SendAgentStatusRequest.cs
- DefaultTraceListener.cs
- PointValueSerializer.cs
- TypeCodeDomSerializer.cs
- Decimal.cs
- InvalidOleVariantTypeException.cs
- DataFormats.cs
- MetaType.cs
- TemplateManager.cs
- _HelperAsyncResults.cs
- HttpCachePolicyElement.cs
- ReadOnlyDataSource.cs
- DataSourceConverter.cs
- XmlSchemaCompilationSettings.cs
- FileUpload.cs
- DrawingContextDrawingContextWalker.cs
- VersionedStream.cs
- OdbcDataReader.cs
- BaseValidator.cs
- FileDialogPermission.cs
- LinqDataSourceContextData.cs
- IgnoreFileBuildProvider.cs
- Collection.cs
- OutOfMemoryException.cs
- UIElement.cs
- EntitySqlQueryCacheKey.cs
- ImageAnimator.cs
- BuilderPropertyEntry.cs
- FormViewCommandEventArgs.cs
- OpenTypeCommon.cs
- MatrixAnimationBase.cs
- MimeObjectFactory.cs
- RenderDataDrawingContext.cs
- TimeoutException.cs
- SelectionBorderGlyph.cs
- MetadataAssemblyHelper.cs
- C14NUtil.cs
- WebBrowserNavigatedEventHandler.cs
- DocumentPage.cs
- DateTimeSerializationSection.cs
- XmlIterators.cs
- CounterSampleCalculator.cs
- Property.cs
- WMICapabilities.cs
- Package.cs
- FileUtil.cs
- SchemaNames.cs
- MemoryPressure.cs
- ManagementEventArgs.cs
- JapaneseLunisolarCalendar.cs
- LocalFileSettingsProvider.cs
- ArrayList.cs
- HatchBrush.cs
- UTF32Encoding.cs
- TraceLevelStore.cs
- AssemblyResourceLoader.cs
- XslAstAnalyzer.cs
- ConfigurationLockCollection.cs
- EdmFunction.cs
- DataServiceQueryProvider.cs
- PropertyConverter.cs
- EdgeModeValidation.cs
- Pair.cs
- ListViewTableCell.cs
- LinkedResourceCollection.cs
- SweepDirectionValidation.cs
- SystemIPGlobalStatistics.cs
- _TimerThread.cs
- HtmlEncodedRawTextWriter.cs
- ComEventsSink.cs
- XmlSchemaAnnotated.cs
- FindCriteriaElement.cs
- TextRange.cs
- AddressHeaderCollection.cs
- ObjectCloneHelper.cs
- XamlDesignerSerializationManager.cs
- DocumentXPathNavigator.cs
- XmlSiteMapProvider.cs
- EntryPointNotFoundException.cs
- AsymmetricSecurityProtocolFactory.cs
- X509ServiceCertificateAuthenticationElement.cs
- GeometryModel3D.cs
- ProfilePropertyNameValidator.cs
- DataSourceCollectionBase.cs
- M3DUtil.cs
- ClientTarget.cs
- HttpListenerException.cs
- MenuRendererStandards.cs
- RelatedImageListAttribute.cs
- ExpressionList.cs
- PropertyIDSet.cs
- LiteralControl.cs
- LinearGradientBrush.cs
- WCFModelStrings.Designer.cs
- PerfCounters.cs
- DirectoryRedirect.cs
- Comparer.cs
- ProtocolsConfiguration.cs