Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Core.Presentation / System / Activities / Core / Presentation / WorkflowShape.cs / 1305376 / WorkflowShape.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Controls; using System.Windows; using System.Windows.Input; namespace System.Activities.Core.Presentation { //Deriving from label to avoid implementing automation peer. class WorkflowShape : Label { bool isMouseDown = false; Point lastMouseDownPoint; public const double dragStartThreshold = 5; public const string WorkflowShapeFormat = "WorkflowShapeFormat"; protected override void OnMouseDown(System.Windows.Input.MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { isMouseDown = true; lastMouseDownPoint = e.GetPosition(this); e.Handled = true; } base.OnMouseDown(e); } protected override void OnMouseUp(System.Windows.Input.MouseButtonEventArgs e) { isMouseDown = false; e.Handled = true; base.OnMouseUp(e); } protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed && isMouseDown) { Point newPosition = e.GetPosition(this); Vector difference = newPosition - lastMouseDownPoint; if (difference.Length >= dragStartThreshold) { //DoDragDrop; DataObject dataObject = new DataObject(WorkflowShapeFormat, this); DragDrop.DoDragDrop(this, dataObject, DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Scroll | DragDropEffects.Link); isMouseDown = false; e.Handled = true; } } base.OnMouseMove(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
- DataRow.cs
- DefaultEventAttribute.cs
- BitStream.cs
- CompilerScope.Storage.cs
- UnionCodeGroup.cs
- IsolatedStorageException.cs
- FileAuthorizationModule.cs
- PerformanceCounterCategory.cs
- SqlMetaData.cs
- CryptoApi.cs
- ProgramNode.cs
- TransactedBatchingBehavior.cs
- FixedStringLookup.cs
- DataGridViewCellPaintingEventArgs.cs
- InstanceCreationEditor.cs
- SimplePropertyEntry.cs
- UrlPath.cs
- XamlDesignerSerializationManager.cs
- Journal.cs
- SafeCancelMibChangeNotify.cs
- Attribute.cs
- OleDbPermission.cs
- Storyboard.cs
- ActivityCodeDomSerializer.cs
- TimeSpanFormat.cs
- SafeLocalMemHandle.cs
- SqlBulkCopyColumnMapping.cs
- WebEventTraceProvider.cs
- PersianCalendar.cs
- TableLayoutSettings.cs
- AnimatedTypeHelpers.cs
- ParallelLoopState.cs
- EventWaitHandle.cs
- MatrixTransform3D.cs
- DataException.cs
- Int32AnimationUsingKeyFrames.cs
- ListViewGroup.cs
- ProxyWebPartManager.cs
- MetadataCacheItem.cs
- VolatileEnlistmentState.cs
- DrawTreeNodeEventArgs.cs
- XmlArrayAttribute.cs
- SqlParameter.cs
- SoapInteropTypes.cs
- GuidelineCollection.cs
- SrgsRule.cs
- PostBackOptions.cs
- BinaryWriter.cs
- CellParagraph.cs
- BuildManager.cs
- QueryCacheEntry.cs
- TrackBarRenderer.cs
- FullTextBreakpoint.cs
- EntityProviderFactory.cs
- TextFormatter.cs
- WebPartDescriptionCollection.cs
- CompilerLocalReference.cs
- CacheManager.cs
- ClientRuntime.cs
- FontFamilyConverter.cs
- FormatControl.cs
- BooleanToVisibilityConverter.cs
- ScrollChangedEventArgs.cs
- ProgressBarBrushConverter.cs
- RouteUrlExpressionBuilder.cs
- ImpersonateTokenRef.cs
- ThreadExceptionEvent.cs
- UnionCodeGroup.cs
- UidManager.cs
- sqlpipe.cs
- ExpiredSecurityTokenException.cs
- EntityTemplateUserControl.cs
- TextBoxView.cs
- ArrangedElementCollection.cs
- DefaultTextStore.cs
- UrlMappingsModule.cs
- WebPartConnectionsEventArgs.cs
- Attributes.cs
- SqlDuplicator.cs
- SystemParameters.cs
- TimerElapsedEvenArgs.cs
- TopClause.cs
- SqlRowUpdatedEvent.cs
- PauseStoryboard.cs
- FirstMatchCodeGroup.cs
- PersonalizationProviderCollection.cs
- SettingsPropertyValue.cs
- HashHelpers.cs
- SQLGuid.cs
- oledbmetadatacollectionnames.cs
- StorageFunctionMapping.cs
- WebPartRestoreVerb.cs
- DataSourceControlBuilder.cs
- SchemaMapping.cs
- basenumberconverter.cs
- ContextMarshalException.cs
- HtmlTernaryTree.cs
- WSSecureConversationFeb2005.cs
- ReflectTypeDescriptionProvider.cs
- BindingGroup.cs