Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlUserDefinedTypeAttribute.cs
- Variant.cs
- CallSiteOps.cs
- TransactedBatchContext.cs
- MarshalDirectiveException.cs
- TypeUtils.cs
- _FixedSizeReader.cs
- RequestCachingSection.cs
- DocumentAutomationPeer.cs
- CDSCollectionETWBCLProvider.cs
- HelpProvider.cs
- TextBox.cs
- TypeRefElement.cs
- XPathSingletonIterator.cs
- NativeCppClassAttribute.cs
- DocumentOrderComparer.cs
- SizeChangedEventArgs.cs
- ErrorFormatter.cs
- XPathAxisIterator.cs
- DetailsViewPagerRow.cs
- COM2PictureConverter.cs
- OptimizedTemplateContentHelper.cs
- TableChangeProcessor.cs
- GridViewCancelEditEventArgs.cs
- TraceInternal.cs
- XmlNodeComparer.cs
- ApplicationProxyInternal.cs
- MsmqTransportBindingElement.cs
- LabelLiteral.cs
- MemberBinding.cs
- ContainerControl.cs
- GridViewHeaderRowPresenter.cs
- BasicExpressionVisitor.cs
- DocumentSchemaValidator.cs
- DataGridRowDetailsEventArgs.cs
- MapPathBasedVirtualPathProvider.cs
- BamlStream.cs
- WithParamAction.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- GenericPrincipal.cs
- DesignerOptionService.cs
- StateMachineExecutionState.cs
- XmlHierarchicalDataSourceView.cs
- XmlArrayItemAttribute.cs
- ScrollViewer.cs
- TabControl.cs
- XamlSerializer.cs
- SerialPort.cs
- Drawing.cs
- DataGridItem.cs
- PerformanceCounterPermissionAttribute.cs
- DataStorage.cs
- TextSimpleMarkerProperties.cs
- FileEnumerator.cs
- CodeNamespaceCollection.cs
- SoapIncludeAttribute.cs
- HttpServerVarsCollection.cs
- HttpDictionary.cs
- CompositeControl.cs
- ListControl.cs
- DataConnectionHelper.cs
- ResolveNameEventArgs.cs
- Authorization.cs
- CharacterMetrics.cs
- WebPartCloseVerb.cs
- DesignTimeData.cs
- ProgressBar.cs
- DesignerActionUIService.cs
- ButtonBaseDesigner.cs
- CachedTypeface.cs
- selecteditemcollection.cs
- Win32SafeHandles.cs
- ExtenderControl.cs
- StringTraceRecord.cs
- EqualityComparer.cs
- SingleConverter.cs
- ClickablePoint.cs
- UIElementCollection.cs
- HierarchicalDataSourceIDConverter.cs
- DataGridViewColumnEventArgs.cs
- MSHTMLHost.cs
- HMACSHA512.cs
- BitmapEffectDrawing.cs
- QueryCacheKey.cs
- DNS.cs
- PolyBezierSegment.cs
- ExplicitDiscriminatorMap.cs
- CursorConverter.cs
- SoapInteropTypes.cs
- SessionStateItemCollection.cs
- BindingMAnagerBase.cs
- RadioButtonList.cs
- CodeSnippetTypeMember.cs
- LocationUpdates.cs
- ResourceFallbackManager.cs
- WebCategoryAttribute.cs
- RegistryDataKey.cs
- Regex.cs
- Marshal.cs
- CommentAction.cs