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
- SymLanguageType.cs
- HistoryEventArgs.cs
- PixelShader.cs
- TableChangeProcessor.cs
- Command.cs
- HttpBrowserCapabilitiesBase.cs
- DebugView.cs
- OletxTransactionHeader.cs
- ListenUriMode.cs
- XPathNavigator.cs
- IdentityNotMappedException.cs
- GradientBrush.cs
- UnsupportedPolicyOptionsException.cs
- XsltOutput.cs
- XsltSettings.cs
- ConfigurationErrorsException.cs
- SessionStateItemCollection.cs
- FrameworkElementAutomationPeer.cs
- XPathException.cs
- CustomCredentialPolicy.cs
- QilPatternFactory.cs
- UniformGrid.cs
- ContravarianceAdapter.cs
- WindowsRegion.cs
- ProjectionPathBuilder.cs
- ExtendedPropertyCollection.cs
- EdmProperty.cs
- PropertyTabChangedEvent.cs
- SecureUICommand.cs
- TextDecorationCollection.cs
- AnnotationResourceCollection.cs
- ImagingCache.cs
- StatusBarItem.cs
- QueryOptionExpression.cs
- ObjectKeyFrameCollection.cs
- ResolveNameEventArgs.cs
- ThemeInfoAttribute.cs
- SymbolDocumentInfo.cs
- TrustLevelCollection.cs
- SimplePropertyEntry.cs
- ExtendedPropertyCollection.cs
- GAC.cs
- updatecommandorderer.cs
- CopyAction.cs
- FamilyCollection.cs
- UnsafeNativeMethods.cs
- Monitor.cs
- MemberDomainMap.cs
- BaseAsyncResult.cs
- WebDescriptionAttribute.cs
- PageAsyncTask.cs
- GetPageCompletedEventArgs.cs
- IMembershipProvider.cs
- WebPartCatalogCloseVerb.cs
- TemplateBaseAction.cs
- EFDataModelProvider.cs
- RecommendedAsConfigurableAttribute.cs
- GenerateScriptTypeAttribute.cs
- DataGridTextBoxColumn.cs
- SqlAliaser.cs
- ObjectQuery_EntitySqlExtensions.cs
- OdbcDataReader.cs
- figurelength.cs
- TypeLoadException.cs
- GPPOINTF.cs
- FormViewUpdatedEventArgs.cs
- DesignBindingConverter.cs
- SiteMembershipCondition.cs
- autovalidator.cs
- TreeViewDesigner.cs
- Graph.cs
- BaseContextMenu.cs
- GlobalizationAssembly.cs
- HtmlTable.cs
- ServiceOperationParameter.cs
- SymmetricAlgorithm.cs
- FloaterBaseParaClient.cs
- Int64Storage.cs
- MultipartIdentifier.cs
- MachineSettingsSection.cs
- CodeTypeConstructor.cs
- TypeSchema.cs
- ColumnResizeUndoUnit.cs
- PointAnimation.cs
- StateItem.cs
- UpdatePanelTriggerCollection.cs
- UpdateCommand.cs
- AnonymousIdentificationModule.cs
- AnchoredBlock.cs
- SafeTokenHandle.cs
- HtmlInputPassword.cs
- RuleInfoComparer.cs
- DocumentGridPage.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- HttpDebugHandler.cs
- NamespaceMapping.cs
- InlineCollection.cs
- SQLDecimal.cs
- HighContrastHelper.cs
- DataGridrowEditEndingEventArgs.cs