Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / DataGridClipboardCellContent.cs / 1305600 / DataGridClipboardCellContent.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; namespace System.Windows.Controls { ////// This structure encapsulate the cell information necessary when clipboard content is prepared /// public struct DataGridClipboardCellContent { ////// Creates a new DataGridClipboardCellValue structure containing information about DataGrid cell /// /// DataGrid row item containing the cell /// DataGridColumn containing the cell /// DataGrid cell value public DataGridClipboardCellContent(object item, DataGridColumn column, object content) { _item = item; _column = column; _content = content; } ////// DataGrid row item containing the cell /// public object Item { get { return _item; } } ////// DataGridColumn containing the cell /// public DataGridColumn Column { get { return _column; } } ////// Cell content /// public object Content { get { return _content; } } ////// Field-by-field comparison to avoid reflection-based ValueType.Equals /// /// ///True iff this and data are equal public override bool Equals(object data) { DataGridClipboardCellContent clipboardCellContent; if (data is DataGridClipboardCellContent) { clipboardCellContent = (DataGridClipboardCellContent)data; return (_column == clipboardCellContent._column) && (_content == clipboardCellContent._content) && (_item == clipboardCellContent._item); } return false; } ////// Return a deterministic hash code /// ///Hash value public override int GetHashCode() { return ((_column == null ? 0 : _column.GetHashCode()) ^ (_content == null ? 0 : _content.GetHashCode()) ^ (_item == null ? 0 : _item.GetHashCode())); } ////// Field-by-field comparison to avoid reflection-based ValueType.Equals /// /// /// ///True iff clipboardCellContent1 and clipboardCellContent2 are equal public static bool operator ==( DataGridClipboardCellContent clipboardCellContent1, DataGridClipboardCellContent clipboardCellContent2) { return (clipboardCellContent1._column == clipboardCellContent2._column) && (clipboardCellContent1._content == clipboardCellContent2._content) && (clipboardCellContent1._item == clipboardCellContent2._item); } ////// Field-by-field comparison to avoid reflection-based ValueType.Equals /// /// /// ///True iff clipboardCellContent1 and clipboardCellContent2 are NOT equal public static bool operator !=( DataGridClipboardCellContent clipboardCellContent1, DataGridClipboardCellContent clipboardCellContent2) { return (clipboardCellContent1._column != clipboardCellContent2._column) || (clipboardCellContent1._content != clipboardCellContent2._content) || (clipboardCellContent1._item != clipboardCellContent2._item); } private object _item; private DataGridColumn _column; private object _content; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; namespace System.Windows.Controls { ////// This structure encapsulate the cell information necessary when clipboard content is prepared /// public struct DataGridClipboardCellContent { ////// Creates a new DataGridClipboardCellValue structure containing information about DataGrid cell /// /// DataGrid row item containing the cell /// DataGridColumn containing the cell /// DataGrid cell value public DataGridClipboardCellContent(object item, DataGridColumn column, object content) { _item = item; _column = column; _content = content; } ////// DataGrid row item containing the cell /// public object Item { get { return _item; } } ////// DataGridColumn containing the cell /// public DataGridColumn Column { get { return _column; } } ////// Cell content /// public object Content { get { return _content; } } ////// Field-by-field comparison to avoid reflection-based ValueType.Equals /// /// ///True iff this and data are equal public override bool Equals(object data) { DataGridClipboardCellContent clipboardCellContent; if (data is DataGridClipboardCellContent) { clipboardCellContent = (DataGridClipboardCellContent)data; return (_column == clipboardCellContent._column) && (_content == clipboardCellContent._content) && (_item == clipboardCellContent._item); } return false; } ////// Return a deterministic hash code /// ///Hash value public override int GetHashCode() { return ((_column == null ? 0 : _column.GetHashCode()) ^ (_content == null ? 0 : _content.GetHashCode()) ^ (_item == null ? 0 : _item.GetHashCode())); } ////// Field-by-field comparison to avoid reflection-based ValueType.Equals /// /// /// ///True iff clipboardCellContent1 and clipboardCellContent2 are equal public static bool operator ==( DataGridClipboardCellContent clipboardCellContent1, DataGridClipboardCellContent clipboardCellContent2) { return (clipboardCellContent1._column == clipboardCellContent2._column) && (clipboardCellContent1._content == clipboardCellContent2._content) && (clipboardCellContent1._item == clipboardCellContent2._item); } ////// Field-by-field comparison to avoid reflection-based ValueType.Equals /// /// /// ///True iff clipboardCellContent1 and clipboardCellContent2 are NOT equal public static bool operator !=( DataGridClipboardCellContent clipboardCellContent1, DataGridClipboardCellContent clipboardCellContent2) { return (clipboardCellContent1._column != clipboardCellContent2._column) || (clipboardCellContent1._content != clipboardCellContent2._content) || (clipboardCellContent1._item != clipboardCellContent2._item); } private object _item; private DataGridColumn _column; private object _content; } } // 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
- MatrixTransform.cs
- MemberCollection.cs
- WebCodeGenerator.cs
- TableSectionStyle.cs
- BamlLocalizationDictionary.cs
- ReflectTypeDescriptionProvider.cs
- Thickness.cs
- SplineKeyFrames.cs
- TreeNodeEventArgs.cs
- CompModHelpers.cs
- SHA1Managed.cs
- TrackingRecord.cs
- StandardRuntimeEnumValidator.cs
- NonBatchDirectoryCompiler.cs
- TrackingValidationObjectDictionary.cs
- XamlParser.cs
- NamedPipeChannelListener.cs
- BitArray.cs
- Button.cs
- SchemaImporterExtensionElementCollection.cs
- ComponentDispatcherThread.cs
- WmlPageAdapter.cs
- StopStoryboard.cs
- XmlWriterTraceListener.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- XsdSchemaFileEditor.cs
- CultureMapper.cs
- AssertUtility.cs
- ConfigXmlWhitespace.cs
- PasswordPropertyTextAttribute.cs
- SchemaContext.cs
- HtmlTableCellCollection.cs
- SafeRegistryHandle.cs
- GeneratedCodeAttribute.cs
- Animatable.cs
- Triplet.cs
- WebPartEditorApplyVerb.cs
- DataRelationCollection.cs
- SecurityContextSecurityToken.cs
- SoapClientMessage.cs
- ArithmeticException.cs
- SerializerDescriptor.cs
- ParameterInfo.cs
- HttpCookiesSection.cs
- AnimationLayer.cs
- DockingAttribute.cs
- IPHostEntry.cs
- CustomPopupPlacement.cs
- SQLMoneyStorage.cs
- ZoneIdentityPermission.cs
- XmlExtensionFunction.cs
- MDIClient.cs
- ExpressionPrefixAttribute.cs
- PropertyChangedEventManager.cs
- ContainerParaClient.cs
- TreeViewDataItemAutomationPeer.cs
- QueryGeneratorBase.cs
- MetricEntry.cs
- DataGridViewCellStateChangedEventArgs.cs
- StorageAssociationTypeMapping.cs
- XmlDataImplementation.cs
- MultipleViewProviderWrapper.cs
- NameSpaceExtractor.cs
- DesignerVerbToolStripMenuItem.cs
- BaseUriHelper.cs
- XmlUtf8RawTextWriter.cs
- MatrixCamera.cs
- SimplePropertyEntry.cs
- CallInfo.cs
- RegexBoyerMoore.cs
- MetadataHelper.cs
- ObfuscationAttribute.cs
- VectorKeyFrameCollection.cs
- DictionaryItemsCollection.cs
- TriggerBase.cs
- ListViewGroupConverter.cs
- DynamicILGenerator.cs
- ItemMap.cs
- CategoryGridEntry.cs
- ResourceManager.cs
- ProfilePropertySettingsCollection.cs
- HWStack.cs
- EncoderReplacementFallback.cs
- MsmqAuthenticationMode.cs
- XmlReflectionImporter.cs
- SimpleNameService.cs
- SignHashRequest.cs
- DesignerActionListCollection.cs
- ResetableIterator.cs
- InteropAutomationProvider.cs
- OdbcRowUpdatingEvent.cs
- bidPrivateBase.cs
- EventMappingSettingsCollection.cs
- CompoundFileIOPermission.cs
- FieldNameLookup.cs
- ApplicationFileCodeDomTreeGenerator.cs
- NativeMethods.cs
- BaseTemplateCodeDomTreeGenerator.cs
- ScalarType.cs
- ConnectionProviderAttribute.cs