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
- DetailsViewCommandEventArgs.cs
- ConnectionInterfaceCollection.cs
- ForeignKeyConstraint.cs
- Rotation3DAnimationUsingKeyFrames.cs
- OracleBoolean.cs
- prompt.cs
- VisualTarget.cs
- MetadataCollection.cs
- TabItemAutomationPeer.cs
- FileFormatException.cs
- CheckoutException.cs
- PointLight.cs
- NTAccount.cs
- XmlSchemaSimpleTypeList.cs
- XamlRtfConverter.cs
- ListSortDescription.cs
- PtsCache.cs
- ActivationProxy.cs
- documentation.cs
- CompositeDataBoundControl.cs
- EventLogEntryCollection.cs
- NumberAction.cs
- RelationshipEndCollection.cs
- RegistryConfigurationProvider.cs
- InputBinding.cs
- FocusWithinProperty.cs
- SelectionGlyph.cs
- FlowSwitchDesigner.xaml.cs
- ExpandSegmentCollection.cs
- RegisteredExpandoAttribute.cs
- RichTextBoxAutomationPeer.cs
- SQLMoney.cs
- WindowsFormsSynchronizationContext.cs
- DataGridViewControlCollection.cs
- SqlInfoMessageEvent.cs
- ReachFixedDocumentSerializer.cs
- MultipleViewPattern.cs
- DataGridViewControlCollection.cs
- AuthenticationModuleElementCollection.cs
- ErrorStyle.cs
- BrowserCapabilitiesCompiler.cs
- Expr.cs
- Form.cs
- ItemChangedEventArgs.cs
- MaterializeFromAtom.cs
- WebBaseEventKeyComparer.cs
- GlyphRunDrawing.cs
- XPathEmptyIterator.cs
- TreeViewImageGenerator.cs
- PaperSize.cs
- TouchesCapturedWithinProperty.cs
- DataTrigger.cs
- OpCellTreeNode.cs
- PresentationAppDomainManager.cs
- BasicViewGenerator.cs
- WhitespaceRuleLookup.cs
- NonVisualControlAttribute.cs
- DependencyPropertyHelper.cs
- ResourceDisplayNameAttribute.cs
- SoapExtension.cs
- ValueSerializerAttribute.cs
- ReverseComparer.cs
- XsdDataContractExporter.cs
- Tile.cs
- RightsManagementEncryptionTransform.cs
- ButtonChrome.cs
- SymbolMethod.cs
- RegexCharClass.cs
- ProgressBar.cs
- RoleBoolean.cs
- PolicyLevel.cs
- Rules.cs
- AsymmetricAlgorithm.cs
- StylusPointPropertyUnit.cs
- ListView.cs
- Pair.cs
- EntityContainerEmitter.cs
- DecoderFallbackWithFailureFlag.cs
- CompoundFileStorageReference.cs
- HttpResponseBase.cs
- XmlSchemaRedefine.cs
- WebPartCloseVerb.cs
- ContextMenuStrip.cs
- SqlFormatter.cs
- DrawingBrush.cs
- BrowserCapabilitiesFactory.cs
- GetParentChain.cs
- HttpContext.cs
- ExtractorMetadata.cs
- controlskin.cs
- EmissiveMaterial.cs
- TextBounds.cs
- adornercollection.cs
- ComboBoxItem.cs
- ObjectStateManagerMetadata.cs
- TargetPerspective.cs
- RangeValueProviderWrapper.cs
- RecipientInfo.cs
- CustomWebEventKey.cs
- HttpStreamMessageEncoderFactory.cs