Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- DynamicPropertyReader.cs
- DatatypeImplementation.cs
- AlignmentXValidation.cs
- SystemColors.cs
- PermissionSet.cs
- DiscoveryDocument.cs
- JsonQueryStringConverter.cs
- SqlStatistics.cs
- MenuCommand.cs
- XmlDataLoader.cs
- ResourceReferenceExpression.cs
- ProfileSettingsCollection.cs
- ListControlConvertEventArgs.cs
- BuildResult.cs
- UIElement3DAutomationPeer.cs
- WebExceptionStatus.cs
- RegexReplacement.cs
- DataGridPagerStyle.cs
- ListManagerBindingsCollection.cs
- WebPartHelpVerb.cs
- ReachFixedDocumentSerializer.cs
- DataGridViewComboBoxEditingControl.cs
- AnnotationResourceCollection.cs
- TargetControlTypeAttribute.cs
- CodePageEncoding.cs
- TypeDescriptor.cs
- DynamicValueConverter.cs
- WebResponse.cs
- Geometry.cs
- WindowsSysHeader.cs
- TrustLevelCollection.cs
- validation.cs
- SyndicationCategory.cs
- MatrixCamera.cs
- FastPropertyAccessor.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- QueryOutputWriter.cs
- HtmlElementErrorEventArgs.cs
- TreeNode.cs
- EntryWrittenEventArgs.cs
- EarlyBoundInfo.cs
- DataObjectFieldAttribute.cs
- Baml2006KeyRecord.cs
- TableLayoutPanelCellPosition.cs
- RegexCode.cs
- XmlSerializationReader.cs
- HtmlImage.cs
- ApplicationDirectoryMembershipCondition.cs
- COMException.cs
- UserControlAutomationPeer.cs
- SqlNodeAnnotation.cs
- TextFormatterImp.cs
- SolidBrush.cs
- ConditionValidator.cs
- SimpleColumnProvider.cs
- Collection.cs
- SessionState.cs
- FileInfo.cs
- ToolBarOverflowPanel.cs
- BoundPropertyEntry.cs
- CqlIdentifiers.cs
- GifBitmapEncoder.cs
- HttpListenerRequestUriBuilder.cs
- InteropTrackingRecord.cs
- DataGridViewTextBoxEditingControl.cs
- InfoCardService.cs
- ClientTargetSection.cs
- HandleCollector.cs
- UserControlBuildProvider.cs
- TdsParser.cs
- VirtualDirectoryMappingCollection.cs
- FastEncoderStatics.cs
- ContainerControlDesigner.cs
- SelectionWordBreaker.cs
- TemplateAction.cs
- ToolStripDropDownItem.cs
- Collection.cs
- ObjectNotFoundException.cs
- PartialArray.cs
- NullableDoubleAverageAggregationOperator.cs
- RegexCaptureCollection.cs
- Point3DAnimationBase.cs
- EqualityComparer.cs
- TableLayoutCellPaintEventArgs.cs
- PtsPage.cs
- XmlStringTable.cs
- LoadedOrUnloadedOperation.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- TypeNameConverter.cs
- Blend.cs
- TextEditorParagraphs.cs
- TableCell.cs
- SpeechRecognitionEngine.cs
- DisableDpiAwarenessAttribute.cs
- EventLogEntryCollection.cs
- mansign.cs
- DrawingCollection.cs
- LinqDataSourceView.cs
- SamlDoNotCacheCondition.cs
- ImageListImage.cs