Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ErrorHandler.cs
- SharedPerformanceCounter.cs
- AttributeEmitter.cs
- LinearGradientBrush.cs
- SslStream.cs
- PrinterUnitConvert.cs
- TTSEngineTypes.cs
- UDPClient.cs
- MonthCalendar.cs
- OdbcParameterCollection.cs
- brushes.cs
- CanonicalXml.cs
- XmlSchemaSubstitutionGroup.cs
- HostedHttpContext.cs
- BridgeDataRecord.cs
- InputLanguageSource.cs
- ExpandCollapsePattern.cs
- User.cs
- DataGridViewEditingControlShowingEventArgs.cs
- DefaultBinder.cs
- Shared.cs
- InternalBufferManager.cs
- CleanUpVirtualizedItemEventArgs.cs
- LabelDesigner.cs
- TrackBarRenderer.cs
- WindowsTab.cs
- HebrewCalendar.cs
- ContentTextAutomationPeer.cs
- SettingsSection.cs
- ResourceKey.cs
- TemplateKeyConverter.cs
- WebPartConnectionsCloseVerb.cs
- DataViewSetting.cs
- ContainerVisual.cs
- _LazyAsyncResult.cs
- ConstantProjectedSlot.cs
- CreateUserWizard.cs
- CodeAccessPermission.cs
- XPathPatternParser.cs
- DrawingImage.cs
- DiffuseMaterial.cs
- Int32Storage.cs
- LassoHelper.cs
- ConfigXmlWhitespace.cs
- CompositeCollection.cs
- DocumentApplication.cs
- LocalizationParserHooks.cs
- TableHeaderCell.cs
- DynamicMetaObject.cs
- TextBox.cs
- BaseCodePageEncoding.cs
- X509Utils.cs
- SliderAutomationPeer.cs
- ListViewUpdateEventArgs.cs
- DrawToolTipEventArgs.cs
- ObjectStateManagerMetadata.cs
- TraceUtility.cs
- EdmItemCollection.cs
- WindowsToolbar.cs
- OptimisticConcurrencyException.cs
- ExpandSegment.cs
- XmlTypeAttribute.cs
- NameValueConfigurationCollection.cs
- ObjectNavigationPropertyMapping.cs
- ProgressChangedEventArgs.cs
- ConstructorArgumentAttribute.cs
- DoubleLink.cs
- EventSourceCreationData.cs
- Helper.cs
- FlowDocumentReaderAutomationPeer.cs
- XmlSchemaIdentityConstraint.cs
- NullableDecimalMinMaxAggregationOperator.cs
- ExplicitDiscriminatorMap.cs
- PhysicalAddress.cs
- EdmPropertyAttribute.cs
- XmlCharType.cs
- DataGridViewCellStateChangedEventArgs.cs
- DefaultEventAttribute.cs
- FileDialogCustomPlacesCollection.cs
- NativeWindow.cs
- ErrorItem.cs
- FreezableCollection.cs
- ellipse.cs
- DataGridViewSelectedColumnCollection.cs
- CatalogPart.cs
- DbgUtil.cs
- AccessDataSourceView.cs
- SqlNodeTypeOperators.cs
- RightsManagementProvider.cs
- CircleHotSpot.cs
- FormViewCommandEventArgs.cs
- InteropAutomationProvider.cs
- AlgoModule.cs
- BrowserCapabilitiesCompiler.cs
- ModifierKeysValueSerializer.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- CodeLinePragma.cs
- ToolboxControl.cs
- Object.cs
- HighContrastHelper.cs