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
- StsCommunicationException.cs
- ListViewCommandEventArgs.cs
- SemaphoreFullException.cs
- DetailsViewUpdatedEventArgs.cs
- xml.cs
- StorageConditionPropertyMapping.cs
- RewritingSimplifier.cs
- GetUserPreferenceRequest.cs
- CodeCompiler.cs
- ClientSettingsProvider.cs
- RegexGroupCollection.cs
- CalendarDay.cs
- XmlnsCompatibleWithAttribute.cs
- ReceiveDesigner.xaml.cs
- GenericArgumentsUpdater.cs
- CharAnimationUsingKeyFrames.cs
- ProviderSettingsCollection.cs
- AssemblyAttributesGoHere.cs
- _NegoStream.cs
- ConnectionPoolManager.cs
- SharedStatics.cs
- ExpandoClass.cs
- XmlRootAttribute.cs
- Axis.cs
- ExchangeUtilities.cs
- NameValueFileSectionHandler.cs
- StylusCaptureWithinProperty.cs
- FormViewInsertEventArgs.cs
- OdbcConnectionPoolProviderInfo.cs
- ParentUndoUnit.cs
- ExtendedTransformFactory.cs
- UDPClient.cs
- SystemIcmpV4Statistics.cs
- MeshGeometry3D.cs
- HashMembershipCondition.cs
- ClassDataContract.cs
- CustomAttribute.cs
- SchemeSettingElementCollection.cs
- PathStreamGeometryContext.cs
- SelectedDatesCollection.cs
- CompensatableTransactionScopeActivityDesigner.cs
- Simplifier.cs
- UpdatePanelControlTrigger.cs
- DataGridViewLinkCell.cs
- Bits.cs
- ColumnClickEvent.cs
- CustomErrorsSection.cs
- GridViewDeletedEventArgs.cs
- Convert.cs
- ConnectionStringsExpressionBuilder.cs
- IInstanceTable.cs
- XmlAnyElementAttribute.cs
- MetafileEditor.cs
- JsonDeserializer.cs
- BinaryConverter.cs
- BoundField.cs
- IdentityModelDictionary.cs
- UnicodeEncoding.cs
- ModelUIElement3D.cs
- WebSysDescriptionAttribute.cs
- Bitmap.cs
- UIElementAutomationPeer.cs
- ValidatorAttribute.cs
- Walker.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- TextSyndicationContent.cs
- GeneralTransform3DGroup.cs
- SchemaHelper.cs
- RightNameExpirationInfoPair.cs
- GeneralTransform.cs
- DesignDataSource.cs
- SqlDataSourceParameterParser.cs
- DiscoveryClientChannelFactory.cs
- DefaultMemberAttribute.cs
- AnimatedTypeHelpers.cs
- EventsTab.cs
- ProcessProtocolHandler.cs
- ActiveXHelper.cs
- XPathNodeInfoAtom.cs
- _ListenerAsyncResult.cs
- pingexception.cs
- ClientBuildManagerCallback.cs
- ErrorFormatterPage.cs
- RelationshipWrapper.cs
- FixedPageStructure.cs
- UserControl.cs
- CodeGen.cs
- ClientData.cs
- EventHandlerService.cs
- ComponentResourceManager.cs
- UserNameSecurityTokenAuthenticator.cs
- PrincipalPermission.cs
- Item.cs
- MessageDecoder.cs
- QuaternionAnimation.cs
- ShutDownListener.cs
- NativeMethods.cs
- SubMenuStyleCollectionEditor.cs
- WindowsPen.cs
- TextBoxRenderer.cs