Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / ToolboxSnapDragDropEventArgs.cs / 1 / ToolboxSnapDragDropEventArgs.cs
namespace System.Windows.Forms.Design.Behavior { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; using System.Diagnostics; using System.Drawing; using System.Windows.Forms.Design; ////// /// This class is created by the ToolboxItemSnapLineBehavior when the /// user clicks, drags, and drops a control from the toolbox. This class /// adds value to the standard DragEventArgs by holding information /// about how the user snapped a control when it was dropped. We'll /// use this information in ParentControlDesigner when this new control /// is created to properly position and size the new control. /// internal sealed class ToolboxSnapDragDropEventArgs : DragEventArgs { private SnapDirection snapDirections;//direction in which the user's cursor was snapped private Point offset;//offset from the cursor to our 'drag box' ////// /// Constructor that is called when the user drops - here, we'll essentially /// push the original drag event info down to the base class and store off /// our direction and offset. /// public ToolboxSnapDragDropEventArgs(SnapDirection snapDirections, Point offset, DragEventArgs origArgs) : base (origArgs.Data, origArgs.KeyState, origArgs.X, origArgs.Y, origArgs.AllowedEffect, origArgs.Effect) { this.snapDirections = snapDirections; this.offset = offset; } ////// /// This is the last direction that the user was snapped to directly before /// the drop happened... /// public SnapDirection SnapDirections { get { return snapDirections; } } ////// /// The offset in pixel between the mouse cursor (at time of drop) and the /// 'drag box' that is dancing around and snapping to other components. /// public Point Offset { get { return offset; } } ////// /// Flag enum used to define the different directions a 'drag box' could be /// snapped to. /// [Flags] public enum SnapDirection { None = 0x00, Top = 0x01, Bottom = 0x02, Right = 0x04, Left = 0x08 } } } // 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
- PointLight.cs
- SelectionEditingBehavior.cs
- InlineObject.cs
- TraceContextRecord.cs
- SkipStoryboardToFill.cs
- SerializerDescriptor.cs
- ScrollProviderWrapper.cs
- EnterpriseServicesHelper.cs
- StylusPlugInCollection.cs
- WmlValidatorAdapter.cs
- Geometry.cs
- DataKeyArray.cs
- XmlCompatibilityReader.cs
- RequestCachePolicyConverter.cs
- GorillaCodec.cs
- MethodBuilderInstantiation.cs
- DataGridViewCellPaintingEventArgs.cs
- LinearGradientBrush.cs
- LogRecordSequence.cs
- CodeAccessPermission.cs
- LicFileLicenseProvider.cs
- DSACryptoServiceProvider.cs
- ElementUtil.cs
- SslStream.cs
- ThrowHelper.cs
- SerialPinChanges.cs
- OleDbFactory.cs
- DataControlPagerLinkButton.cs
- RootBrowserWindow.cs
- TableItemProviderWrapper.cs
- CfgParser.cs
- SqlError.cs
- IISMapPath.cs
- PageThemeCodeDomTreeGenerator.cs
- Pair.cs
- SmiTypedGetterSetter.cs
- ShimAsPublicXamlType.cs
- UncommonField.cs
- VerificationAttribute.cs
- NavigatorOutput.cs
- XPathMultyIterator.cs
- BinaryQueryOperator.cs
- SafeNativeMethods.cs
- SafeRegistryHandle.cs
- TokenizerHelper.cs
- SiteMapDataSourceView.cs
- AnimationClockResource.cs
- FixedDocument.cs
- AssociationSetEnd.cs
- XMLUtil.cs
- XamlTreeBuilder.cs
- ArglessEventHandlerProxy.cs
- MergeLocalizationDirectives.cs
- ToolStripRenderer.cs
- EntityContainer.cs
- FileBasedResourceGroveler.cs
- VersionedStreamOwner.cs
- SmiContext.cs
- UnhandledExceptionEventArgs.cs
- odbcmetadatacolumnnames.cs
- HttpListenerRequest.cs
- WindowsFormsSynchronizationContext.cs
- RunClient.cs
- CorruptStoreException.cs
- WorkflowStateRollbackService.cs
- DynamicValidatorEventArgs.cs
- HttpSysSettings.cs
- ReliableMessagingVersionConverter.cs
- ConfigurationStrings.cs
- XPathArrayIterator.cs
- WSHttpBindingElement.cs
- MetadataArtifactLoader.cs
- XmlException.cs
- DataGridViewComboBoxColumn.cs
- ConfigurationProperty.cs
- ObjectQuery_EntitySqlExtensions.cs
- SharedUtils.cs
- LoginView.cs
- PropertyOrder.cs
- Monitor.cs
- InvalidOleVariantTypeException.cs
- TypeSource.cs
- ChannelSinkStacks.cs
- AssociationTypeEmitter.cs
- CLRBindingWorker.cs
- DataGridViewSortCompareEventArgs.cs
- ResourceReader.cs
- ColorAnimationUsingKeyFrames.cs
- IDReferencePropertyAttribute.cs
- ResourcesChangeInfo.cs
- SortKey.cs
- ArraySet.cs
- PathGradientBrush.cs
- LassoSelectionBehavior.cs
- XsdDateTime.cs
- XmlRawWriter.cs
- RelationshipConverter.cs
- COM2PropertyPageUITypeConverter.cs
- AssemblyBuilder.cs
- precedingsibling.cs