Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / TranslateTransform.cs / 1 / TranslateTransform.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: TranslateTransform.cs //----------------------------------------------------------------------------- using MS.Internal; using MS.Internal.PresentationCore; using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { #region TranslateTransform ////// Create a translation transformation. /// public sealed partial class TranslateTransform : Transform { ////// /// public TranslateTransform() { } ////// Create a translation transformation. /// ///Displacement amount in x direction. ///Displacement amount in y direction. public TranslateTransform( double offsetX, double offsetY ) { X = offsetX; Y = offsetY; } ////// Return the current transformation value. /// public override Matrix Value { get { ReadPreamble(); Matrix matrix = Matrix.Identity; matrix.Translate(X, Y); return matrix; } } ////// Returns true if transformation matches the identity transform. /// internal override bool IsIdentity { get { return X == 0 && Y == 0 && CanFreeze; } } #region Internal Methods internal override void TransformRect(ref Rect rect) { if (!rect.IsEmpty) { rect.Offset(X, Y); } } ////// MultiplyValueByMatrix - result is set equal to "this" * matrixToMultiplyBy. /// /// The result is stored here. /// The multiplicand. internal override void MultiplyValueByMatrix(ref Matrix result, ref Matrix matrixToMultiplyBy) { result = Matrix.Identity; // Set the translate + type result._offsetX = X; result._offsetY = Y; result._type = MatrixTypes.TRANSFORM_IS_TRANSLATION; MatrixUtil.MultiplyMatrix(ref result, ref matrixToMultiplyBy); } #endregion Internal Methods } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: TranslateTransform.cs //----------------------------------------------------------------------------- using MS.Internal; using MS.Internal.PresentationCore; using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { #region TranslateTransform ////// Create a translation transformation. /// public sealed partial class TranslateTransform : Transform { ////// /// public TranslateTransform() { } ////// Create a translation transformation. /// ///Displacement amount in x direction. ///Displacement amount in y direction. public TranslateTransform( double offsetX, double offsetY ) { X = offsetX; Y = offsetY; } ////// Return the current transformation value. /// public override Matrix Value { get { ReadPreamble(); Matrix matrix = Matrix.Identity; matrix.Translate(X, Y); return matrix; } } ////// Returns true if transformation matches the identity transform. /// internal override bool IsIdentity { get { return X == 0 && Y == 0 && CanFreeze; } } #region Internal Methods internal override void TransformRect(ref Rect rect) { if (!rect.IsEmpty) { rect.Offset(X, Y); } } ////// MultiplyValueByMatrix - result is set equal to "this" * matrixToMultiplyBy. /// /// The result is stored here. /// The multiplicand. internal override void MultiplyValueByMatrix(ref Matrix result, ref Matrix matrixToMultiplyBy) { result = Matrix.Identity; // Set the translate + type result._offsetX = X; result._offsetY = Y; result._type = MatrixTypes.TRANSFORM_IS_TRANSLATION; MatrixUtil.MultiplyMatrix(ref result, ref matrixToMultiplyBy); } #endregion Internal Methods } #endregion } // 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
- ClientSettingsSection.cs
- ProviderManager.cs
- TableLayoutPanel.cs
- PseudoWebRequest.cs
- WebPartEventArgs.cs
- CustomValidator.cs
- OpenFileDialog.cs
- BigInt.cs
- ListViewAutomationPeer.cs
- DSASignatureFormatter.cs
- translator.cs
- FontStyle.cs
- ButtonBaseAutomationPeer.cs
- TextTreeInsertUndoUnit.cs
- TraceContext.cs
- CachingHintValidation.cs
- MatrixTransform.cs
- XmlAttributeCollection.cs
- DataSourceCacheDurationConverter.cs
- UserInitiatedNavigationPermission.cs
- VirtualPath.cs
- WebPartRestoreVerb.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- _IPv4Address.cs
- AspCompat.cs
- _NestedSingleAsyncResult.cs
- FastEncoder.cs
- EnumCodeDomSerializer.cs
- SimpleWorkerRequest.cs
- TickBar.cs
- UserControlBuildProvider.cs
- SQLCharsStorage.cs
- TableItemProviderWrapper.cs
- SQLResource.cs
- MatrixIndependentAnimationStorage.cs
- TreeView.cs
- NeedSkipTokenVisitor.cs
- NumberFunctions.cs
- MediaScriptCommandRoutedEventArgs.cs
- AnnotationDocumentPaginator.cs
- BuildProviderCollection.cs
- ProviderMetadataCachedInformation.cs
- Freezable.cs
- UIInitializationException.cs
- RoutedEventValueSerializer.cs
- PropertyGridDesigner.cs
- ScriptResourceAttribute.cs
- PartialTrustValidationBehavior.cs
- HtmlShim.cs
- MissingMemberException.cs
- odbcmetadatafactory.cs
- Point3DAnimationBase.cs
- UnsafeNativeMethods.cs
- Baml2006KnownTypes.cs
- XmlSortKey.cs
- ServiceBuildProvider.cs
- GraphicsState.cs
- CompiledXpathExpr.cs
- DrawingState.cs
- Crc32.cs
- UpdateExpressionVisitor.cs
- LinkedList.cs
- FieldToken.cs
- TargetConverter.cs
- AuthenticationModuleElementCollection.cs
- ILGenerator.cs
- TextTreeTextBlock.cs
- Rule.cs
- PersistNameAttribute.cs
- VSDExceptions.cs
- ConnectionPointConverter.cs
- ADMembershipProvider.cs
- ListManagerBindingsCollection.cs
- HotSpotCollectionEditor.cs
- ListViewEditEventArgs.cs
- HandlerFactoryWrapper.cs
- TimeSpanStorage.cs
- FreezableCollection.cs
- TraceLevelHelper.cs
- PersistenceTask.cs
- FontDriver.cs
- UIntPtr.cs
- TextInfo.cs
- TextRange.cs
- PageContent.cs
- ObjRef.cs
- EnlistmentState.cs
- AppDomainFactory.cs
- StringCollection.cs
- XPathSelfQuery.cs
- DocumentPage.cs
- HtmlString.cs
- IntSumAggregationOperator.cs
- ScriptControlDescriptor.cs
- MemberProjectionIndex.cs
- WebPartEditVerb.cs
- RepeaterItemEventArgs.cs
- ShaperBuffers.cs
- CheckBoxList.cs
- ModulesEntry.cs