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
- GridViewColumnHeaderAutomationPeer.cs
- GridViewItemAutomationPeer.cs
- PackWebRequestFactory.cs
- FilterFactory.cs
- HtmlPhoneCallAdapter.cs
- WebPartConnectionsConfigureVerb.cs
- __Filters.cs
- HuffCodec.cs
- SkewTransform.cs
- XmlWrappingReader.cs
- WizardStepBase.cs
- RenderTargetBitmap.cs
- ChildrenQuery.cs
- StateMachine.cs
- SrgsSemanticInterpretationTag.cs
- ConstructorBuilder.cs
- AssemblyAttributes.cs
- PropertyChangedEventArgs.cs
- TypeConverter.cs
- ToolStripPanelCell.cs
- DbXmlEnabledProviderManifest.cs
- FullTextLine.cs
- processwaithandle.cs
- CurrencyManager.cs
- SqlNotificationRequest.cs
- ParameterDataSourceExpression.cs
- ComponentResourceKeyConverter.cs
- ComAwareEventInfo.cs
- ScrollableControlDesigner.cs
- WindowsFormsHelpers.cs
- XmlSerializationReader.cs
- QuaternionRotation3D.cs
- TargetInvocationException.cs
- Exceptions.cs
- MailHeaderInfo.cs
- Socket.cs
- ProtocolsConfigurationEntry.cs
- Polyline.cs
- DataGridViewCellStateChangedEventArgs.cs
- TimeSpanValidatorAttribute.cs
- LinearQuaternionKeyFrame.cs
- SymmetricSecurityProtocolFactory.cs
- ConfigXmlCDataSection.cs
- mediaeventargs.cs
- DataGridViewLayoutData.cs
- PersonalizationProviderHelper.cs
- ObjectAnimationBase.cs
- SourceElementsCollection.cs
- DrawingGroup.cs
- recordstatescratchpad.cs
- RequestCacheValidator.cs
- ColorBuilder.cs
- PenLineJoinValidation.cs
- DelegatedStream.cs
- PlainXmlDeserializer.cs
- MessageVersionConverter.cs
- ClearTypeHintValidation.cs
- HttpRequest.cs
- XsltLoader.cs
- DesignerAutoFormatCollection.cs
- GenericEnumConverter.cs
- Slider.cs
- HideDisabledControlAdapter.cs
- XmlSchemaNotation.cs
- ProfileSettingsCollection.cs
- StringStorage.cs
- RulePatternOps.cs
- ExpressionParser.cs
- ConsoleKeyInfo.cs
- XamlWrappingReader.cs
- WorkflowMessageEventHandler.cs
- ProxyFragment.cs
- ScriptServiceAttribute.cs
- WebBrowsableAttribute.cs
- PictureBox.cs
- AccessedThroughPropertyAttribute.cs
- CodeRemoveEventStatement.cs
- SurrogateSelector.cs
- WebPartEventArgs.cs
- LeaseManager.cs
- DataStreamFromComStream.cs
- ViewKeyConstraint.cs
- FormatConvertedBitmap.cs
- GridSplitterAutomationPeer.cs
- TimerElapsedEvenArgs.cs
- XmlIlGenerator.cs
- CachedPathData.cs
- ToolStripPanelCell.cs
- ControlEvent.cs
- SmiMetaData.cs
- WebServiceMethodData.cs
- PatternMatcher.cs
- FontFamily.cs
- DependencyPropertyChangedEventArgs.cs
- QueryStringConverter.cs
- WindowsAltTab.cs
- DataServiceProcessingPipelineEventArgs.cs
- ToolStripDropDownItem.cs
- ProfileProvider.cs
- VirtualizedItemProviderWrapper.cs