Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Core.Presentation / System / Activities / Core / Presentation / ConnectionPointConverter.cs / 1305376 / ConnectionPointConverter.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Core.Presentation { using System.Collections.Generic; using System.Windows; using System.Windows.Data; class ConnectionPointConverter : IMultiValueConverter { //This converter returns the actual location of the connection point on the panel. //values[0] is the Size of the shape, values[1] is the Locatio nof the shape. //Parameters define at what width/height fraction of the shape, should the connectionpoint be located. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Size shapeSize = (Size)values[0]; double width = shapeSize.Width; double height = shapeSize.Height; Point origin = (Point)values[1]; double widthFraction = (double)((List < object >)parameter)[0]; double heightFraction = (double)((List < object >)parameter)[1]; Thickness margin = (Thickness)((List < object >)parameter)[2]; origin.X += margin.Left; origin.Y += margin.Top; width = width - margin.Left - margin.Right; height = height - margin.Top - margin.Bottom; Point connectionPointLocation = new Point(width * widthFraction + origin.X, height * heightFraction + origin.Y); return connectionPointLocation; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw FxTrace.Exception.AsError(new NotImplementedException()); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IOThreadTimer.cs
- AnimationClockResource.cs
- ObjectSet.cs
- XmlSchemaGroupRef.cs
- TemplateBindingExpression.cs
- SpeechSeg.cs
- FileSecurity.cs
- NamespaceQuery.cs
- ResourceContainer.cs
- JulianCalendar.cs
- SystemWebSectionGroup.cs
- ThicknessKeyFrameCollection.cs
- DesignerCategoryAttribute.cs
- ProgressBar.cs
- ConnectionPoint.cs
- GeometryHitTestParameters.cs
- QilExpression.cs
- SecurityResources.cs
- FileDialogPermission.cs
- Style.cs
- CDSCollectionETWBCLProvider.cs
- BorderSidesEditor.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- EditorZone.cs
- SqlClientWrapperSmiStream.cs
- FormViewCommandEventArgs.cs
- Point4D.cs
- CodeDirectionExpression.cs
- UnicastIPAddressInformationCollection.cs
- UnsafeNativeMethodsMilCoreApi.cs
- SqlDataSourceCommandEventArgs.cs
- ServiceModelTimeSpanValidator.cs
- XmlChoiceIdentifierAttribute.cs
- Ticks.cs
- ImageField.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- CodeMemberMethod.cs
- WebResponse.cs
- ModuleBuilder.cs
- PageContentAsyncResult.cs
- BrowserCapabilitiesCodeGenerator.cs
- ToolTipService.cs
- CopyAttributesAction.cs
- LinqDataSourceDisposeEventArgs.cs
- EventWaitHandle.cs
- GlobalProxySelection.cs
- SerializationObjectManager.cs
- Substitution.cs
- DispatchWrapper.cs
- WorkflowApplicationCompletedEventArgs.cs
- ListParagraph.cs
- PassportAuthenticationEventArgs.cs
- MobileControlsSectionHandler.cs
- HttpModuleActionCollection.cs
- ContextStaticAttribute.cs
- CodeCatchClause.cs
- ModuleBuilderData.cs
- DataGridViewCellCancelEventArgs.cs
- BindingContext.cs
- Rotation3D.cs
- Propagator.Evaluator.cs
- CheckBoxList.cs
- PaintEvent.cs
- TextEditorTyping.cs
- SerializerProvider.cs
- StatusBarDrawItemEvent.cs
- UIPermission.cs
- TextPointerBase.cs
- HttpHandlersSection.cs
- HttpPostClientProtocol.cs
- TdsParserHelperClasses.cs
- QueryableDataSourceView.cs
- EdmPropertyAttribute.cs
- BitmapInitialize.cs
- ByteAnimationUsingKeyFrames.cs
- FrugalMap.cs
- ToolBarButtonClickEvent.cs
- TraceContextEventArgs.cs
- IsolationInterop.cs
- TreeNode.cs
- QuaternionKeyFrameCollection.cs
- LassoSelectionBehavior.cs
- ToolBarButton.cs
- RoutingExtensionElement.cs
- DataGridCommandEventArgs.cs
- EdmEntityTypeAttribute.cs
- XmlCDATASection.cs
- XmlNotation.cs
- Dispatcher.cs
- DataGridColumn.cs
- XmlnsCompatibleWithAttribute.cs
- XmlAtomicValue.cs
- ThicknessAnimationBase.cs
- Delegate.cs
- MimeTypePropertyAttribute.cs
- LZCodec.cs
- NameSpaceExtractor.cs
- ChannelServices.cs
- CryptoApi.cs
- ObfuscationAttribute.cs