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
- LogReserveAndAppendState.cs
- TogglePattern.cs
- CodeCompiler.cs
- ToolboxItemFilterAttribute.cs
- TrackingConditionCollection.cs
- ConfigXmlComment.cs
- TargetParameterCountException.cs
- InkCanvasAutomationPeer.cs
- WebPartDeleteVerb.cs
- documentation.cs
- SystemIcmpV4Statistics.cs
- EndpointConfigContainer.cs
- IdentityModelStringsVersion1.cs
- TextElement.cs
- StylusPointPropertyInfo.cs
- StatusBarPanelClickEvent.cs
- Types.cs
- FtpRequestCacheValidator.cs
- CodeBlockBuilder.cs
- DocumentApplicationJournalEntry.cs
- CodeDomSerializerException.cs
- RepeatInfo.cs
- LocalizedNameDescriptionPair.cs
- SolidColorBrush.cs
- InputLangChangeRequestEvent.cs
- CryptoConfig.cs
- AdornerLayer.cs
- ContravarianceAdapter.cs
- BuildManagerHost.cs
- DataBinder.cs
- TypeDescriptionProviderAttribute.cs
- RadioButton.cs
- SiteMapHierarchicalDataSourceView.cs
- ConfigurationStrings.cs
- adornercollection.cs
- PagerSettings.cs
- CodeAttributeDeclaration.cs
- XamlInt32CollectionSerializer.cs
- Error.cs
- _HelperAsyncResults.cs
- DataStorage.cs
- BackStopAuthenticationModule.cs
- ProfileModule.cs
- CheckableControlBaseAdapter.cs
- DesigntimeLicenseContextSerializer.cs
- TouchDevice.cs
- QuaternionKeyFrameCollection.cs
- cookiecontainer.cs
- IProvider.cs
- CryptoHelper.cs
- infer.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- TerminateDesigner.cs
- EnumerableRowCollection.cs
- DataGridViewCellStyleConverter.cs
- CharAnimationBase.cs
- FindCompletedEventArgs.cs
- DataColumnPropertyDescriptor.cs
- Cloud.cs
- DrawingGroup.cs
- Rectangle.cs
- CustomExpressionEventArgs.cs
- RadialGradientBrush.cs
- ExtendedPropertyCollection.cs
- ClientCultureInfo.cs
- DataServiceException.cs
- SyntaxCheck.cs
- CodeTypeOfExpression.cs
- TokenBasedSet.cs
- DrawingBrush.cs
- CustomAttributeBuilder.cs
- PreservationFileReader.cs
- ForeignConstraint.cs
- StagingAreaInputItem.cs
- PreviewPrintController.cs
- Timer.cs
- EventProviderBase.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- SmiXetterAccessMap.cs
- DoubleSumAggregationOperator.cs
- FixedNode.cs
- QueryOutputWriter.cs
- InternalBufferOverflowException.cs
- SecurityTokenException.cs
- RuleDefinitions.cs
- ObjectPropertyMapping.cs
- UInt64Converter.cs
- DocumentPageTextView.cs
- configsystem.cs
- MailWebEventProvider.cs
- DesignTimeDataBinding.cs
- JpegBitmapEncoder.cs
- Latin1Encoding.cs
- XmlIgnoreAttribute.cs
- AdjustableArrowCap.cs
- AssemblyAttributesGoHere.cs
- ContractMapping.cs
- InvokeProviderWrapper.cs
- DataGridViewUtilities.cs
- OptimalTextSource.cs