Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / DataGridRowClipboardEventArgs.cs / 1305600 / DataGridRowClipboardEventArgs.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; namespace System.Windows.Controls { ////// This class encapsulates a selected row information necessary for CopyingRowClipboardContent event /// public class DataGridRowClipboardEventArgs : EventArgs { ////// Creates DataGridRowClipboardEventArgs object initializing the properties. /// /// /// /// /// public DataGridRowClipboardEventArgs(object item, int startColumnDisplayIndex, int endColumnDisplayIndex, bool isColumnHeadersRow) { _item = item; _startColumnDisplayIndex = startColumnDisplayIndex; _endColumnDisplayIndex = endColumnDisplayIndex; _isColumnHeadersRow = isColumnHeadersRow; } internal DataGridRowClipboardEventArgs(object item, int startColumnDisplayIndex, int endColumnDisplayIndex, bool isColumnHeadersRow, int rowIndexHint) : this(item, startColumnDisplayIndex, endColumnDisplayIndex, isColumnHeadersRow) { _rowIndexHint = rowIndexHint; } ////// DataGrid row item for which we prepare ClipboardRowContent /// public object Item { get { return _item; } } ////// This list should be used to modify, add ot remove a cell content before it gets stored into the clipboard. /// public ListClipboardRowContent { get { if (_clipboardRowContent == null) { _clipboardRowContent = new List (); } return _clipboardRowContent; } } /// /// This method serialize ClipboardRowContent list into string using the specified format. /// /// ///public string FormatClipboardCellValues(string format) { StringBuilder sb = new StringBuilder(); int count = ClipboardRowContent.Count; for (int i = 0; i < count; i++) { DataGridClipboardHelper.FormatCell(ClipboardRowContent[i].Content, i == 0 /* firstCell */, i == count - 1 /* lastCell */, sb, format); } return sb.ToString(); } /// /// Represents the DisplayIndex of the first selected column /// public int StartColumnDisplayIndex { get { return _startColumnDisplayIndex; } } ////// Represents the DisplayIndex of the last selected column /// public int EndColumnDisplayIndex { get { return _endColumnDisplayIndex; } } ////// This property is true when the ClipboardRowContent represents column headers. In this case Item is null. /// public bool IsColumnHeadersRow { get { return _isColumnHeadersRow; } } ////// If the row index was known at creation time, this will be non-negative. /// internal int RowIndexHint { get { return _rowIndexHint; } } private int _startColumnDisplayIndex; private int _endColumnDisplayIndex; private object _item; private bool _isColumnHeadersRow; private List_clipboardRowContent; private int _rowIndexHint = -1; } } // 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.Collections.ObjectModel; using System.Text; namespace System.Windows.Controls { /// /// This class encapsulates a selected row information necessary for CopyingRowClipboardContent event /// public class DataGridRowClipboardEventArgs : EventArgs { ////// Creates DataGridRowClipboardEventArgs object initializing the properties. /// /// /// /// /// public DataGridRowClipboardEventArgs(object item, int startColumnDisplayIndex, int endColumnDisplayIndex, bool isColumnHeadersRow) { _item = item; _startColumnDisplayIndex = startColumnDisplayIndex; _endColumnDisplayIndex = endColumnDisplayIndex; _isColumnHeadersRow = isColumnHeadersRow; } internal DataGridRowClipboardEventArgs(object item, int startColumnDisplayIndex, int endColumnDisplayIndex, bool isColumnHeadersRow, int rowIndexHint) : this(item, startColumnDisplayIndex, endColumnDisplayIndex, isColumnHeadersRow) { _rowIndexHint = rowIndexHint; } ////// DataGrid row item for which we prepare ClipboardRowContent /// public object Item { get { return _item; } } ////// This list should be used to modify, add ot remove a cell content before it gets stored into the clipboard. /// public ListClipboardRowContent { get { if (_clipboardRowContent == null) { _clipboardRowContent = new List (); } return _clipboardRowContent; } } /// /// This method serialize ClipboardRowContent list into string using the specified format. /// /// ///public string FormatClipboardCellValues(string format) { StringBuilder sb = new StringBuilder(); int count = ClipboardRowContent.Count; for (int i = 0; i < count; i++) { DataGridClipboardHelper.FormatCell(ClipboardRowContent[i].Content, i == 0 /* firstCell */, i == count - 1 /* lastCell */, sb, format); } return sb.ToString(); } /// /// Represents the DisplayIndex of the first selected column /// public int StartColumnDisplayIndex { get { return _startColumnDisplayIndex; } } ////// Represents the DisplayIndex of the last selected column /// public int EndColumnDisplayIndex { get { return _endColumnDisplayIndex; } } ////// This property is true when the ClipboardRowContent represents column headers. In this case Item is null. /// public bool IsColumnHeadersRow { get { return _isColumnHeadersRow; } } ////// If the row index was known at creation time, this will be non-negative. /// internal int RowIndexHint { get { return _rowIndexHint; } } private int _startColumnDisplayIndex; private int _endColumnDisplayIndex; private object _item; private bool _isColumnHeadersRow; private List_clipboardRowContent; private int _rowIndexHint = -1; } } // 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
- UserControl.cs
- BrowserCapabilitiesFactory.cs
- ValidationEventArgs.cs
- ApplicationProxyInternal.cs
- ProgressBarAutomationPeer.cs
- ImageFormat.cs
- HtmlElementErrorEventArgs.cs
- FormViewDeleteEventArgs.cs
- UrlAuthFailedErrorFormatter.cs
- ListViewSelectEventArgs.cs
- WindowsFont.cs
- _UncName.cs
- ToolboxItemFilterAttribute.cs
- XmlElement.cs
- BitmapEffectOutputConnector.cs
- DigestComparer.cs
- StylusPlugin.cs
- DefaultTraceListener.cs
- ContextStaticAttribute.cs
- Inline.cs
- KeyedCollection.cs
- DESCryptoServiceProvider.cs
- DotExpr.cs
- ObjectDataSourceDisposingEventArgs.cs
- CollectionsUtil.cs
- LayoutEditorPart.cs
- XPathSelectionIterator.cs
- RegistrationServices.cs
- GAC.cs
- XmlSchemaSet.cs
- AnimationException.cs
- ImageField.cs
- StopStoryboard.cs
- IOException.cs
- XmlDocumentType.cs
- EventRecordWrittenEventArgs.cs
- UserControlParser.cs
- UICuesEvent.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ApplicationTrust.cs
- CompositionDesigner.cs
- SiteMapPath.cs
- PixelFormatConverter.cs
- WebContext.cs
- TransformCollection.cs
- GraphicsContainer.cs
- UnmanagedHandle.cs
- PkcsMisc.cs
- SqlResolver.cs
- InkCanvasAutomationPeer.cs
- AtomEntry.cs
- Popup.cs
- DesignerTextViewAdapter.cs
- SqlCommand.cs
- EntityEntry.cs
- CodeExporter.cs
- IIS7WorkerRequest.cs
- InteropEnvironment.cs
- Profiler.cs
- ProtocolsConfigurationEntry.cs
- SchemaManager.cs
- RelatedImageListAttribute.cs
- Action.cs
- ChangesetResponse.cs
- Decorator.cs
- RouteItem.cs
- DocumentViewerAutomationPeer.cs
- ElementHostPropertyMap.cs
- WebHttpDispatchOperationSelectorData.cs
- HMACSHA512.cs
- StringCollectionMarkupSerializer.cs
- AspNetSynchronizationContext.cs
- SessionStateSection.cs
- Tuple.cs
- ConfigurationSection.cs
- CommandSet.cs
- PlainXmlWriter.cs
- ArgumentsParser.cs
- VirtualDirectoryMappingCollection.cs
- SamlAuthorityBinding.cs
- CrossSiteScriptingValidation.cs
- BufferedGraphicsContext.cs
- ScrollBar.cs
- GenericIdentity.cs
- ShaperBuffers.cs
- AtomMaterializer.cs
- DataKeyPropertyAttribute.cs
- Panel.cs
- PasswordRecovery.cs
- ConsoleCancelEventArgs.cs
- CollectionChange.cs
- SqlDependencyUtils.cs
- EntityDataSourceViewSchema.cs
- _StreamFramer.cs
- SessionStateSection.cs
- BaseCodeDomTreeGenerator.cs
- ColorContext.cs
- hebrewshape.cs
- ConnectionConsumerAttribute.cs
- NodeInfo.cs