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
- PropertyDescriptorGridEntry.cs
- XMLSyntaxException.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- RequestUriProcessor.cs
- HttpFileCollectionBase.cs
- XmlBaseReader.cs
- InstanceCreationEditor.cs
- DispatcherFrame.cs
- StsCommunicationException.cs
- EmptyCollection.cs
- CacheDict.cs
- DesignerDeviceConfig.cs
- MemberProjectedSlot.cs
- XPathNodePointer.cs
- RegexEditorDialog.cs
- DoWorkEventArgs.cs
- EditorResources.cs
- MenuAdapter.cs
- SQLBytesStorage.cs
- EventProxy.cs
- Helpers.cs
- RelationshipFixer.cs
- RowToParametersTransformer.cs
- RequestBringIntoViewEventArgs.cs
- RijndaelManaged.cs
- PropertyStore.cs
- XmlDownloadManager.cs
- ReaderWriterLockWrapper.cs
- ScrollChangedEventArgs.cs
- RightsManagementEncryptedStream.cs
- _Rfc2616CacheValidators.cs
- ClientType.cs
- UidPropertyAttribute.cs
- MailAddressParser.cs
- RuntimeArgumentHandle.cs
- ConsumerConnectionPoint.cs
- DataGridViewBindingCompleteEventArgs.cs
- SurrogateSelector.cs
- MachineSettingsSection.cs
- TableCellsCollectionEditor.cs
- Renderer.cs
- DataSourceCacheDurationConverter.cs
- UnmanagedMarshal.cs
- ImageField.cs
- StringReader.cs
- XmlLanguage.cs
- SessionStateModule.cs
- ManifestResourceInfo.cs
- SerializationSectionGroup.cs
- StickyNote.cs
- XPathException.cs
- GlyphRunDrawing.cs
- TextServicesContext.cs
- LogicalExpr.cs
- RepeaterCommandEventArgs.cs
- SmtpFailedRecipientException.cs
- DropShadowEffect.cs
- SecurityBindingElementImporter.cs
- TCPClient.cs
- PartDesigner.cs
- BadImageFormatException.cs
- TimeSpanFormat.cs
- SubpageParagraph.cs
- FlowDocumentPage.cs
- EnumerationRangeValidationUtil.cs
- StreamingContext.cs
- SqlEnums.cs
- QilLoop.cs
- SecureEnvironment.cs
- DialogWindow.cs
- LicenseProviderAttribute.cs
- VScrollProperties.cs
- CodeRegionDirective.cs
- PointLightBase.cs
- ProcessProtocolHandler.cs
- DataServiceHostFactory.cs
- PersonalizationStateInfoCollection.cs
- RMEnrollmentPage2.cs
- DataBindingExpressionBuilder.cs
- InfoCardRSACryptoProvider.cs
- Stylesheet.cs
- EncoderReplacementFallback.cs
- ObfuscateAssemblyAttribute.cs
- XmlNamespaceMapping.cs
- ExtendedPropertyCollection.cs
- PropertyBuilder.cs
- XmlRawWriterWrapper.cs
- DllNotFoundException.cs
- Vector3DAnimationUsingKeyFrames.cs
- FunctionMappingTranslator.cs
- HMACMD5.cs
- SelectionListComponentEditor.cs
- CompositeFontFamily.cs
- Item.cs
- SpellerStatusTable.cs
- InputScopeNameConverter.cs
- UserValidatedEventArgs.cs
- ActivityXRefPropertyEditor.cs
- TextTreeTextBlock.cs
- XmlNamespaceMapping.cs