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 / DataObjectEventArgs.cs / 1 / DataObjectEventArgs.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Base class for DataObject events arguments // //--------------------------------------------------------------------------- using System; namespace System.Windows { ////// Base class for DataObject.Copying/Pasting events. /// These events are raised when an editor deals with /// a data object before putting it to clipboard on copy /// and before starting drag operation; /// or before Pasting its content into a selection /// on Paste/Drop operations. /// /// This class is abstract - it provides only common /// members for the events. Particular commands /// must use more specific event arguments - /// DataObjectCopyingEventArgs or DataObjectPastingEventArgs. /// public abstract class DataObjectEventArgs : RoutedEventArgs { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Creates a DataObjectCopyEvent. /// This object created by editors executing a Copy/Paste /// and Drag/Drop comands. /// /// /// An event id. One of: CopyingEvent or PastingEvent /// /// /// A flag indicating if this operation is part of drag/drop. /// Copying event fired on drag start, Pasting - on drop. /// Cancelling the command stops drag/drop process in /// an appropriate moment. /// internal DataObjectEventArgs(RoutedEvent routedEvent, bool isDragDrop) : base() { if (routedEvent != DataObject.CopyingEvent && routedEvent != DataObject.PastingEvent && routedEvent != DataObject.SettingDataEvent) { throw new ArgumentOutOfRangeException("routedEvent"); } RoutedEvent = routedEvent; _isDragDrop = isDragDrop; _commandCancelled = false; } #endregion Constructors //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- #region Public Properties ////// A flag indicating if this operation is part of drag/drop. /// Copying event fired on drag start, Pasting - on drop. /// Cancelling the command stops drag/drop process in /// an appropriate moment. /// public bool IsDragDrop { get { return _isDragDrop; } } ////// A current cancellation status of the event. /// When set to true, copy command is going to be cancelled. /// public bool CommandCancelled { get { return _commandCancelled; } } #endregion Public Properties //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ #region Public Methods ////// Sets cancelled status of a command to true. /// After calling this method the command will be /// stopped from calling. /// Applied to Drag (event="Copying", isDragDrop="true") /// this would stop the whole dragdrop process. /// ////// After an event has been cancelled it's impossible /// to re-enable it. /// public void CancelCommand() { _commandCancelled = true; } #endregion Public Methods //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private bool _isDragDrop; private bool _commandCancelled; #endregion Private Fields } } // 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: Base class for DataObject events arguments // //--------------------------------------------------------------------------- using System; namespace System.Windows { ////// Base class for DataObject.Copying/Pasting events. /// These events are raised when an editor deals with /// a data object before putting it to clipboard on copy /// and before starting drag operation; /// or before Pasting its content into a selection /// on Paste/Drop operations. /// /// This class is abstract - it provides only common /// members for the events. Particular commands /// must use more specific event arguments - /// DataObjectCopyingEventArgs or DataObjectPastingEventArgs. /// public abstract class DataObjectEventArgs : RoutedEventArgs { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Creates a DataObjectCopyEvent. /// This object created by editors executing a Copy/Paste /// and Drag/Drop comands. /// /// /// An event id. One of: CopyingEvent or PastingEvent /// /// /// A flag indicating if this operation is part of drag/drop. /// Copying event fired on drag start, Pasting - on drop. /// Cancelling the command stops drag/drop process in /// an appropriate moment. /// internal DataObjectEventArgs(RoutedEvent routedEvent, bool isDragDrop) : base() { if (routedEvent != DataObject.CopyingEvent && routedEvent != DataObject.PastingEvent && routedEvent != DataObject.SettingDataEvent) { throw new ArgumentOutOfRangeException("routedEvent"); } RoutedEvent = routedEvent; _isDragDrop = isDragDrop; _commandCancelled = false; } #endregion Constructors //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- #region Public Properties ////// A flag indicating if this operation is part of drag/drop. /// Copying event fired on drag start, Pasting - on drop. /// Cancelling the command stops drag/drop process in /// an appropriate moment. /// public bool IsDragDrop { get { return _isDragDrop; } } ////// A current cancellation status of the event. /// When set to true, copy command is going to be cancelled. /// public bool CommandCancelled { get { return _commandCancelled; } } #endregion Public Properties //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ #region Public Methods ////// Sets cancelled status of a command to true. /// After calling this method the command will be /// stopped from calling. /// Applied to Drag (event="Copying", isDragDrop="true") /// this would stop the whole dragdrop process. /// ////// After an event has been cancelled it's impossible /// to re-enable it. /// public void CancelCommand() { _commandCancelled = true; } #endregion Public Methods //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private bool _isDragDrop; private bool _commandCancelled; #endregion Private Fields } } // 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
- RelativeSource.cs
- HttpContext.cs
- ListItemCollection.cs
- CharacterBuffer.cs
- DataConnectionHelper.cs
- MemberHolder.cs
- hebrewshape.cs
- ContentType.cs
- AsynchronousChannel.cs
- versioninfo.cs
- InvalidAsynchronousStateException.cs
- OracleParameter.cs
- SHA1Managed.cs
- Brush.cs
- SiteOfOriginPart.cs
- DeploymentExceptionMapper.cs
- HTMLTextWriter.cs
- TaiwanLunisolarCalendar.cs
- ObjectKeyFrameCollection.cs
- PageRanges.cs
- ApplicationFileCodeDomTreeGenerator.cs
- UpdateProgress.cs
- Main.cs
- AdapterUtil.cs
- CompositeCollection.cs
- SQLBytes.cs
- ListSortDescriptionCollection.cs
- EmptyStringExpandableObjectConverter.cs
- FunctionImportMapping.cs
- AssertSection.cs
- LogArchiveSnapshot.cs
- OutOfProcStateClientManager.cs
- TypeForwardedToAttribute.cs
- ValidationErrorEventArgs.cs
- CaseStatementSlot.cs
- TypeDescriptionProvider.cs
- SoapElementAttribute.cs
- XmlAttribute.cs
- PeerInvitationResponse.cs
- RegistryExceptionHelper.cs
- MetaModel.cs
- ArgumentException.cs
- KeyGestureValueSerializer.cs
- SecurityKeyIdentifier.cs
- RequestCacheManager.cs
- MinimizableAttributeTypeConverter.cs
- ReadOnlyPropertyMetadata.cs
- HttpCachePolicy.cs
- TextBlockAutomationPeer.cs
- GroupBoxDesigner.cs
- Version.cs
- VariableQuery.cs
- Pair.cs
- TextParagraphCache.cs
- KeyGesture.cs
- ComponentEvent.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ObjectKeyFrameCollection.cs
- Window.cs
- DataListItemCollection.cs
- BreakRecordTable.cs
- Function.cs
- MailDefinition.cs
- XmlSerializer.cs
- Soap11ServerProtocol.cs
- TypeReference.cs
- FileCodeGroup.cs
- OdbcConnectionFactory.cs
- counter.cs
- QueryCacheManager.cs
- StringInfo.cs
- XamlStyleSerializer.cs
- ThousandthOfEmRealPoints.cs
- Application.cs
- SettingsSavedEventArgs.cs
- Guid.cs
- PropertyConverter.cs
- StyleTypedPropertyAttribute.cs
- WebPartMenuStyle.cs
- MetadataUtil.cs
- WindowsGraphics.cs
- DetailsViewRow.cs
- ExpandCollapseProviderWrapper.cs
- ViewBox.cs
- HtmlTable.cs
- TableLayoutPanel.cs
- StrokeDescriptor.cs
- SecureStringHasher.cs
- SmiRecordBuffer.cs
- Task.cs
- ThrowHelper.cs
- WindowHideOrCloseTracker.cs
- Char.cs
- QilParameter.cs
- LowerCaseStringConverter.cs
- DashStyles.cs
- FormClosingEvent.cs
- SpecialTypeDataContract.cs
- SourceElementsCollection.cs
- ObjectConverter.cs