Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / DataObjectSettingDataEventArgs.cs / 1 / DataObjectSettingDataEventArgs.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description: DataObjectSettingData event arguments
//
//---------------------------------------------------------------------------
using System;
namespace System.Windows
{
///
/// Arguments for the DataObject.SettingData event.
/// The DataObject.SettingData event is raised during
/// Copy (or Drag start) command when an editor
/// is going to start data conversion for some
/// of data formats. By handling this event an application
/// can prevent from editon doing that thus making
/// Copy performance better.
///
public sealed class DataObjectSettingDataEventArgs : DataObjectEventArgs
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
///
/// Creates a DataObjectSettingDataEventArgs.
///
///
/// DataObject to which a new data format is going to be added.
///
///
/// Format which is going to be added to the DataObject.
///
public DataObjectSettingDataEventArgs(IDataObject dataObject, string format) //
: base(System.Windows.DataObject.SettingDataEvent, /*isDragDrop:*/false)
{
if (dataObject == null)
{
throw new ArgumentNullException("dataObject");
}
if (format == null)
{
throw new ArgumentNullException("format");
}
_dataObject = dataObject;
_format = format;
}
#endregion Constructors
//------------------------------------------------------
//
// Public Properties
//
//-----------------------------------------------------
#region Public Properties
///
/// DataObject to which a new data format is going to be added.
///
public IDataObject DataObject
{
get { return _dataObject; }
}
///
/// Format which is going to be added to the DataObject.
///
public string Format
{
get { return _format; }
}
#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)
{
DataObjectSettingDataEventHandler handler = (DataObjectSettingDataEventHandler)genericHandler;
handler(genericTarget, this);
}
#endregion Protected Methods
//-----------------------------------------------------
//
// Private Fields
//
//------------------------------------------------------
#region Private Fields
private IDataObject _dataObject;
private string _format;
#endregion Private Fields
}
///
/// The delegate to use for handlers that receive the DataObject.QueryingCopy/QueryingPaste events.
///
///
/// A handler for a DataObject.SettingData event.
/// Te event is fired as part of Copy (or Drag) command
/// once for each of data formats added to a DataObject.
/// The purpose of this handler is mostly copy command
/// optimization. With the help of it application
/// can filter some formats from being added to DataObject.
/// The other opportunity of doing that exists in
/// DataObject.Copying event, which could set all undesirable
/// formats to null, but in this case the work for data
/// conversion is already done, which may be too expensive.
/// By handling DataObject.SettingData event an application
/// can prevent from each particular data format conversion.
/// By calling DataObjectSettingDataEventArgs.CancelCommand
/// method the handler tells an editor to skip one particular
/// data format (identified by DataObjectSettingDataEventArgs.Format
/// property). Note that calling CancelCommand method
/// for this event does not cancel the whole Copy or Drag
/// command.
///
public delegate void DataObjectSettingDataEventHandler(object sender, DataObjectSettingDataEventArgs 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: DataObjectSettingData event arguments
//
//---------------------------------------------------------------------------
using System;
namespace System.Windows
{
///
/// Arguments for the DataObject.SettingData event.
/// The DataObject.SettingData event is raised during
/// Copy (or Drag start) command when an editor
/// is going to start data conversion for some
/// of data formats. By handling this event an application
/// can prevent from editon doing that thus making
/// Copy performance better.
///
public sealed class DataObjectSettingDataEventArgs : DataObjectEventArgs
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
///
/// Creates a DataObjectSettingDataEventArgs.
///
///
/// DataObject to which a new data format is going to be added.
///
///
/// Format which is going to be added to the DataObject.
///
public DataObjectSettingDataEventArgs(IDataObject dataObject, string format) //
: base(System.Windows.DataObject.SettingDataEvent, /*isDragDrop:*/false)
{
if (dataObject == null)
{
throw new ArgumentNullException("dataObject");
}
if (format == null)
{
throw new ArgumentNullException("format");
}
_dataObject = dataObject;
_format = format;
}
#endregion Constructors
//------------------------------------------------------
//
// Public Properties
//
//-----------------------------------------------------
#region Public Properties
///
/// DataObject to which a new data format is going to be added.
///
public IDataObject DataObject
{
get { return _dataObject; }
}
///
/// Format which is going to be added to the DataObject.
///
public string Format
{
get { return _format; }
}
#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)
{
DataObjectSettingDataEventHandler handler = (DataObjectSettingDataEventHandler)genericHandler;
handler(genericTarget, this);
}
#endregion Protected Methods
//-----------------------------------------------------
//
// Private Fields
//
//------------------------------------------------------
#region Private Fields
private IDataObject _dataObject;
private string _format;
#endregion Private Fields
}
///
/// The delegate to use for handlers that receive the DataObject.QueryingCopy/QueryingPaste events.
///
///
/// A handler for a DataObject.SettingData event.
/// Te event is fired as part of Copy (or Drag) command
/// once for each of data formats added to a DataObject.
/// The purpose of this handler is mostly copy command
/// optimization. With the help of it application
/// can filter some formats from being added to DataObject.
/// The other opportunity of doing that exists in
/// DataObject.Copying event, which could set all undesirable
/// formats to null, but in this case the work for data
/// conversion is already done, which may be too expensive.
/// By handling DataObject.SettingData event an application
/// can prevent from each particular data format conversion.
/// By calling DataObjectSettingDataEventArgs.CancelCommand
/// method the handler tells an editor to skip one particular
/// data format (identified by DataObjectSettingDataEventArgs.Format
/// property). Note that calling CancelCommand method
/// for this event does not cancel the whole Copy or Drag
/// command.
///
public delegate void DataObjectSettingDataEventHandler(object sender, DataObjectSettingDataEventArgs 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
- SchemaSetCompiler.cs
- WebScriptEnablingBehavior.cs
- MasterPageCodeDomTreeGenerator.cs
- HiddenFieldPageStatePersister.cs
- StoreItemCollection.Loader.cs
- ControlCachePolicy.cs
- AnnouncementSendsAsyncResult.cs
- PropertyChangingEventArgs.cs
- IListConverters.cs
- MultiTouchSystemGestureLogic.cs
- ConcurrentBag.cs
- __TransparentProxy.cs
- CodeSnippetCompileUnit.cs
- GlyphingCache.cs
- IssuedTokenServiceCredential.cs
- OdbcParameterCollection.cs
- ApplicationSecurityInfo.cs
- SignatureConfirmationElement.cs
- XmlEntity.cs
- XmlUnspecifiedAttribute.cs
- ObjectStateFormatter.cs
- PropertyManager.cs
- CuspData.cs
- RuleSettings.cs
- SqlClientWrapperSmiStream.cs
- MessageEncoderFactory.cs
- ProvideValueServiceProvider.cs
- ETagAttribute.cs
- CodeMethodInvokeExpression.cs
- FormattedText.cs
- SqlWriter.cs
- OperationResponse.cs
- TimeSpanParse.cs
- IndexerNameAttribute.cs
- FieldDescriptor.cs
- CaseInsensitiveHashCodeProvider.cs
- XmlDataFileEditor.cs
- ObjectAssociationEndMapping.cs
- DictionaryGlobals.cs
- FrameworkObject.cs
- WindowsUserNameCachingSecurityTokenAuthenticator.cs
- TripleDES.cs
- LogWriteRestartAreaAsyncResult.cs
- Claim.cs
- SqlBulkCopyColumnMappingCollection.cs
- EventsTab.cs
- BitmapEffectDrawing.cs
- ArrangedElementCollection.cs
- ScriptingSectionGroup.cs
- TrackBarDesigner.cs
- BezierSegment.cs
- XPathAncestorIterator.cs
- TokenFactoryCredential.cs
- BamlLocalizationDictionary.cs
- ToolStripActionList.cs
- TypeListConverter.cs
- ButtonFieldBase.cs
- PersonalizablePropertyEntry.cs
- RowUpdatingEventArgs.cs
- SHA384Cng.cs
- CatalogPartCollection.cs
- PlatformCulture.cs
- X509CertificateStore.cs
- DaylightTime.cs
- CodeDOMProvider.cs
- RouteItem.cs
- MenuItemCollection.cs
- ObjectReaderCompiler.cs
- ComPlusDiagnosticTraceSchemas.cs
- MimeBasePart.cs
- TableColumn.cs
- EditorResources.cs
- ToolStripLocationCancelEventArgs.cs
- RegisteredHiddenField.cs
- SqlUserDefinedTypeAttribute.cs
- SslStream.cs
- FrameworkContentElement.cs
- Freezable.cs
- WrapperSecurityCommunicationObject.cs
- StyleCollectionEditor.cs
- DesignerTextBoxAdapter.cs
- LabelAutomationPeer.cs
- Dynamic.cs
- ObjectDataSourceChooseMethodsPanel.cs
- ArrangedElementCollection.cs
- TreeNodeCollectionEditor.cs
- RelationshipEndCollection.cs
- ByteStack.cs
- SQLDouble.cs
- DefaultBindingPropertyAttribute.cs
- SafeTimerHandle.cs
- SortDescriptionCollection.cs
- MsdtcClusterUtils.cs
- OracleConnectionStringBuilder.cs
- BrowserCapabilitiesCompiler.cs
- EnumerableRowCollectionExtensions.cs
- ExternalException.cs
- PropVariant.cs
- NoClickablePointException.cs
- RenderingEventArgs.cs