Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / DataObjectCopyingEventArgs.cs / 1 / DataObjectCopyingEventArgs.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description: DataObject.Copying event arguments
//
//---------------------------------------------------------------------------
using System;
namespace System.Windows
{
///
/// Arguments for the DataObject.Copying event.
///
/// The DataObject.Copying event is raised when an editor
/// has converted a content of selection into all appropriate
/// clipboard data formats, collected them all in DataObject
/// and is ready to put the objet onto the Clipboard.
/// An application can inspect DataObject, change, remove or
/// add some data formats into it and decide whether to proceed
/// with the copying or cancel it.
///
public sealed class DataObjectCopyingEventArgs : DataObjectEventArgs
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
///
/// Creates an arguments for a DataObject.Copying event.
/// This object created by editors executing a Copy and Drag.
///
///
/// DataObject filled in with all appropriate data formats
/// and ready for putting into the Clipboard
/// or to used in dragging gesture.
///
///
/// A flag indicating if this operation is part of drag/drop.
/// Copying event is fired on drag start.
///
public DataObjectCopyingEventArgs(IDataObject dataObject, bool isDragDrop) //
: base(System.Windows.DataObject.CopyingEvent, isDragDrop)
{
if (dataObject == null)
{
throw new ArgumentNullException("dataObject");
}
_dataObject = dataObject;
}
#endregion Constructors
//------------------------------------------------------
//
// Public Properties
//
//-----------------------------------------------------
#region Public Properties
///
/// DataObject filled in with all appropriate data formats
/// and ready for putting into the Clipboard.
///
public IDataObject DataObject
{
get { return _dataObject; }
}
#endregion Public Properties
#region Protected Methods
//------------------------------------------------------
//
// Protected Methods
//
//------------------------------------------------------
///
/// The mechanism used to call the type-specific handler on the target.
///
///
/// The generic handler to call in a type-specific way.
///
///
/// The target to call the handler on.
///
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
DataObjectCopyingEventHandler handler = (DataObjectCopyingEventHandler)genericHandler;
handler(genericTarget, this);
}
#endregion Protected Methods
//-----------------------------------------------------
//
// Private Fields
//
//------------------------------------------------------
#region Private Fields
private IDataObject _dataObject;
#endregion Private Fields
}
///
/// The delegate to use for handlers that receive the DataObject.Copying event.
///
///
/// A handler for DataObject.Copying event.
/// The handler is expected to inspect the content of a data object
/// passed via event arguments (DataObjectCopyingEventArgs.DataObject)
/// and add additional (custom) data format to it.
/// It's also possible for the handler to change
/// the contents of other data formats already put on DataObject
/// or even remove some of those formats.
/// All this happens before DataObject is put on
/// the Clipboard (in copy operation) or before DragDrop
/// process starts.
/// The handler can cancel the whole copying event
/// by calling DataObjectCopyingEventArgs.CancelCommand method.
/// For the case of Copy a command will be cancelled,
/// for the case of DragDrop a dragdrop process will be
/// terminated in the beginning.
///
public delegate void DataObjectCopyingEventHandler(object sender, DataObjectCopyingEventArgs e);
}
// 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.
//
//
// Description: DataObject.Copying event arguments
//
//---------------------------------------------------------------------------
using System;
namespace System.Windows
{
///
/// Arguments for the DataObject.Copying event.
///
/// The DataObject.Copying event is raised when an editor
/// has converted a content of selection into all appropriate
/// clipboard data formats, collected them all in DataObject
/// and is ready to put the objet onto the Clipboard.
/// An application can inspect DataObject, change, remove or
/// add some data formats into it and decide whether to proceed
/// with the copying or cancel it.
///
public sealed class DataObjectCopyingEventArgs : DataObjectEventArgs
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
///
/// Creates an arguments for a DataObject.Copying event.
/// This object created by editors executing a Copy and Drag.
///
///
/// DataObject filled in with all appropriate data formats
/// and ready for putting into the Clipboard
/// or to used in dragging gesture.
///
///
/// A flag indicating if this operation is part of drag/drop.
/// Copying event is fired on drag start.
///
public DataObjectCopyingEventArgs(IDataObject dataObject, bool isDragDrop) //
: base(System.Windows.DataObject.CopyingEvent, isDragDrop)
{
if (dataObject == null)
{
throw new ArgumentNullException("dataObject");
}
_dataObject = dataObject;
}
#endregion Constructors
//------------------------------------------------------
//
// Public Properties
//
//-----------------------------------------------------
#region Public Properties
///
/// DataObject filled in with all appropriate data formats
/// and ready for putting into the Clipboard.
///
public IDataObject DataObject
{
get { return _dataObject; }
}
#endregion Public Properties
#region Protected Methods
//------------------------------------------------------
//
// Protected Methods
//
//------------------------------------------------------
///
/// The mechanism used to call the type-specific handler on the target.
///
///
/// The generic handler to call in a type-specific way.
///
///
/// The target to call the handler on.
///
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
DataObjectCopyingEventHandler handler = (DataObjectCopyingEventHandler)genericHandler;
handler(genericTarget, this);
}
#endregion Protected Methods
//-----------------------------------------------------
//
// Private Fields
//
//------------------------------------------------------
#region Private Fields
private IDataObject _dataObject;
#endregion Private Fields
}
///
/// The delegate to use for handlers that receive the DataObject.Copying event.
///
///
/// A handler for DataObject.Copying event.
/// The handler is expected to inspect the content of a data object
/// passed via event arguments (DataObjectCopyingEventArgs.DataObject)
/// and add additional (custom) data format to it.
/// It's also possible for the handler to change
/// the contents of other data formats already put on DataObject
/// or even remove some of those formats.
/// All this happens before DataObject is put on
/// the Clipboard (in copy operation) or before DragDrop
/// process starts.
/// The handler can cancel the whole copying event
/// by calling DataObjectCopyingEventArgs.CancelCommand method.
/// For the case of Copy a command will be cancelled,
/// for the case of DragDrop a dragdrop process will be
/// terminated in the beginning.
///
public delegate void DataObjectCopyingEventHandler(object sender, DataObjectCopyingEventArgs e);
}
// 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
- DefaultPropertiesToSend.cs
- CatalogPart.cs
- XpsStructure.cs
- EmbeddedMailObjectCollectionEditor.cs
- QilBinary.cs
- PEFileReader.cs
- ToolboxBitmapAttribute.cs
- DecoderExceptionFallback.cs
- MimeXmlReflector.cs
- KeyValueSerializer.cs
- DependencyObjectProvider.cs
- CorrelationManager.cs
- ContentElement.cs
- SystemKeyConverter.cs
- EntityClassGenerator.cs
- FunctionUpdateCommand.cs
- XmlSchemaSimpleContent.cs
- MembershipUser.cs
- WebPartConnectionsCancelVerb.cs
- ImageMap.cs
- VectorAnimationUsingKeyFrames.cs
- TypeRestriction.cs
- CipherData.cs
- AlphabeticalEnumConverter.cs
- SuppressIldasmAttribute.cs
- initElementDictionary.cs
- XmlSchemaSet.cs
- GeneralTransform2DTo3D.cs
- MetadataPropertyCollection.cs
- SystemIcmpV6Statistics.cs
- DataBindingCollection.cs
- HyperLink.cs
- SwitchDesigner.xaml.cs
- MsmqHostedTransportManager.cs
- hwndwrapper.cs
- Brushes.cs
- BinaryFormatter.cs
- XmlSchemaIdentityConstraint.cs
- ConfigXmlComment.cs
- ConfigurationSectionGroup.cs
- HttpRequest.cs
- PartManifestEntry.cs
- SiteMapPath.cs
- FormViewCommandEventArgs.cs
- WindowsListView.cs
- MouseDevice.cs
- InfoCardProofToken.cs
- __Filters.cs
- RemotingServices.cs
- JournalEntry.cs
- SmiEventStream.cs
- XmlNamespaceDeclarationsAttribute.cs
- WebPartManagerDesigner.cs
- ObsoleteAttribute.cs
- ParallelActivityDesigner.cs
- AspNetCacheProfileAttribute.cs
- TripleDES.cs
- SqlError.cs
- ReliabilityContractAttribute.cs
- SurrogateSelector.cs
- ApplicationServiceManager.cs
- WindowsClaimSet.cs
- DataGridViewBand.cs
- HttpFileCollectionBase.cs
- MultilineStringConverter.cs
- GridViewItemAutomationPeer.cs
- SamlAuthorityBinding.cs
- XmlDataSource.cs
- FixedPageProcessor.cs
- BinaryObjectWriter.cs
- DbDataAdapter.cs
- LayoutUtils.cs
- BlobPersonalizationState.cs
- InitializerFacet.cs
- SqlDataSourceCommandEventArgs.cs
- BasicHttpSecurity.cs
- ErrorHandler.cs
- PropertyTabAttribute.cs
- AbstractSvcMapFileLoader.cs
- AsymmetricCryptoHandle.cs
- ListViewInsertedEventArgs.cs
- HtmlElementErrorEventArgs.cs
- ProfileProvider.cs
- DeobfuscatingStream.cs
- OdbcException.cs
- WebPermission.cs
- DataGridCellsPanel.cs
- HashCodeCombiner.cs
- SystemMulticastIPAddressInformation.cs
- ExtendedProtectionPolicyElement.cs
- SpellerError.cs
- ImageListImage.cs
- EtwTrace.cs
- ReferentialConstraintRoleElement.cs
- MenuItemAutomationPeer.cs
- mactripleDES.cs
- TextElementEnumerator.cs
- VScrollProperties.cs
- TextChangedEventArgs.cs
- ServiceChannelProxy.cs