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
- ListenerElementsCollection.cs
- DataGridViewCellLinkedList.cs
- _Rfc2616CacheValidators.cs
- WindowAutomationPeer.cs
- SpecialFolderEnumConverter.cs
- SplitContainerDesigner.cs
- TextAction.cs
- XmlSchemaParticle.cs
- XmlNodeChangedEventManager.cs
- GridItem.cs
- ToolboxItemAttribute.cs
- HttpHandlerAction.cs
- Error.cs
- TextEditorSpelling.cs
- NullableFloatSumAggregationOperator.cs
- OutputCacheModule.cs
- FontUnit.cs
- EntityConnectionStringBuilder.cs
- ObsoleteAttribute.cs
- StreamSecurityUpgradeAcceptorBase.cs
- RenderCapability.cs
- CommandField.cs
- UnsafeNativeMethodsTablet.cs
- SqlConnection.cs
- DirtyTextRange.cs
- MergeLocalizationDirectives.cs
- TabPanel.cs
- WebReferencesBuildProvider.cs
- PasswordRecovery.cs
- SetIterators.cs
- TrailingSpaceComparer.cs
- Canvas.cs
- OpenFileDialog.cs
- PropertyChangedEventArgs.cs
- TypeContext.cs
- ExecutionEngineException.cs
- MultiPartWriter.cs
- KeyBinding.cs
- ActivationArguments.cs
- AddInAdapter.cs
- HttpModuleCollection.cs
- TableLayoutColumnStyleCollection.cs
- ConfigXmlSignificantWhitespace.cs
- DuplicateWaitObjectException.cs
- DoubleAnimationUsingPath.cs
- SystemGatewayIPAddressInformation.cs
- OletxDependentTransaction.cs
- DataGridLengthConverter.cs
- HostingPreferredMapPath.cs
- ItemsChangedEventArgs.cs
- ProviderConnectionPointCollection.cs
- IgnorePropertiesAttribute.cs
- DrawingDrawingContext.cs
- ValueQuery.cs
- FlowDocumentFormatter.cs
- SqlDependencyUtils.cs
- HwndMouseInputProvider.cs
- FactoryGenerator.cs
- ToolStripContainer.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- OpacityConverter.cs
- DataGridViewButtonColumn.cs
- ScriptingProfileServiceSection.cs
- CodeTypeConstructor.cs
- RectangleConverter.cs
- Executor.cs
- XmlCharCheckingWriter.cs
- WorkflowTerminatedException.cs
- OLEDB_Util.cs
- ProcessModelSection.cs
- StrokeCollection.cs
- AspNetHostingPermission.cs
- PolicyStatement.cs
- LoginName.cs
- CodeMemberEvent.cs
- ConditionalBranch.cs
- EventRouteFactory.cs
- FormatPage.cs
- StateWorkerRequest.cs
- HandlerBase.cs
- XmlObjectSerializerReadContextComplex.cs
- UrlSyndicationContent.cs
- WebPartTransformerCollection.cs
- DependencyObjectType.cs
- IDQuery.cs
- StylusPointPropertyInfo.cs
- SortQuery.cs
- InkCanvasSelection.cs
- SQLDecimalStorage.cs
- SoundPlayer.cs
- KeyConverter.cs
- ControlParser.cs
- RsaSecurityKey.cs
- FieldMetadata.cs
- GestureRecognizer.cs
- PassportPrincipal.cs
- KeyGestureConverter.cs
- ResXBuildProvider.cs
- TextModifierScope.cs
- Size.cs