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
- cache.cs
- XpsResourcePolicy.cs
- TableItemProviderWrapper.cs
- TypeGeneratedEventArgs.cs
- PromptStyle.cs
- NavigationPropertyEmitter.cs
- Dynamic.cs
- ETagAttribute.cs
- _AuthenticationState.cs
- TablePattern.cs
- ToolBarOverflowPanel.cs
- AuthenticationConfig.cs
- IntPtr.cs
- ClientFormsIdentity.cs
- HttpConfigurationSystem.cs
- MessageProtectionOrder.cs
- UTF8Encoding.cs
- PreservationFileWriter.cs
- Size.cs
- validationstate.cs
- NumericExpr.cs
- ServiceBusyException.cs
- WorkflowStateRollbackService.cs
- TrackingParameters.cs
- CommonDialog.cs
- UnmanagedHandle.cs
- XmlBinaryReaderSession.cs
- UnhandledExceptionEventArgs.cs
- DynamicMetaObject.cs
- BoundPropertyEntry.cs
- PathData.cs
- CapabilitiesUse.cs
- DelegateBodyWriter.cs
- CreateParams.cs
- Variant.cs
- processwaithandle.cs
- XmlAttributeCache.cs
- JournalEntry.cs
- HttpGetClientProtocol.cs
- HitTestFilterBehavior.cs
- ObjectItemAssemblyLoader.cs
- ZipPackage.cs
- DataGridHeaderBorder.cs
- X509CertificateEndpointIdentity.cs
- DataBoundLiteralControl.cs
- _DynamicWinsockMethods.cs
- TypedTableGenerator.cs
- TypeResolver.cs
- RadioButton.cs
- PenLineCapValidation.cs
- XPathSelfQuery.cs
- SafeNativeMemoryHandle.cs
- NativeMethodsCLR.cs
- Vector3DIndependentAnimationStorage.cs
- SqlCachedBuffer.cs
- TemplateControl.cs
- CapabilitiesSection.cs
- StringInfo.cs
- PersonalizableAttribute.cs
- RangeEnumerable.cs
- ChainOfResponsibility.cs
- XamlGridLengthSerializer.cs
- XPathLexer.cs
- RadioButton.cs
- ClientSponsor.cs
- StorageFunctionMapping.cs
- XamlTreeBuilder.cs
- FillErrorEventArgs.cs
- DeviceFiltersSection.cs
- RegisteredDisposeScript.cs
- DataViewListener.cs
- UnsafeNativeMethods.cs
- HttpSessionStateBase.cs
- TransformDescriptor.cs
- XmlSchemaAttributeGroup.cs
- NativeRightsManagementAPIsStructures.cs
- XmlSchemaSimpleContentRestriction.cs
- ActionMessageFilterTable.cs
- InstancePersistenceContext.cs
- GridViewItemAutomationPeer.cs
- SqlDataSourceEnumerator.cs
- GatewayDefinition.cs
- DbSetClause.cs
- EventItfInfo.cs
- PropertyGroupDescription.cs
- TreeView.cs
- XmlCharType.cs
- DbSourceParameterCollection.cs
- ResourceCodeDomSerializer.cs
- MetabaseSettingsIis7.cs
- Converter.cs
- BitmapEffectGroup.cs
- PolicyManager.cs
- CallbackException.cs
- PriorityBinding.cs
- RawMouseInputReport.cs
- EditorPartChrome.cs
- MsmqHostedTransportConfiguration.cs
- UniqueConstraint.cs
- WinInet.cs