Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- SwitchAttribute.cs
- WebPartPersonalization.cs
- ImageUrlEditor.cs
- filewebrequest.cs
- Win32Native.cs
- TitleStyle.cs
- AddInActivator.cs
- RIPEMD160Managed.cs
- CapabilitiesState.cs
- AutoResetEvent.cs
- AncestorChangedEventArgs.cs
- BrowserCapabilitiesCompiler.cs
- FileResponseElement.cs
- Symbol.cs
- ExternalException.cs
- ElementMarkupObject.cs
- ConfigurationCollectionAttribute.cs
- Wildcard.cs
- Transactions.cs
- StreamInfo.cs
- WebPartEditorApplyVerb.cs
- FrameworkElementAutomationPeer.cs
- EntityDataSourceWizardForm.cs
- SmtpMail.cs
- recordstatefactory.cs
- IgnoreSectionHandler.cs
- graph.cs
- Parser.cs
- ComponentEditorForm.cs
- SqlTypeSystemProvider.cs
- dsa.cs
- DictionaryTraceRecord.cs
- SHA512Cng.cs
- ServiceOperationParameter.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- TabItem.cs
- SecurityContext.cs
- RequestContext.cs
- ExcCanonicalXml.cs
- SelectManyQueryOperator.cs
- X509AsymmetricSecurityKey.cs
- SecurityCriticalDataForSet.cs
- GridEntry.cs
- SqlTransaction.cs
- AffineTransform3D.cs
- InternalPermissions.cs
- RuleSettings.cs
- SelectionPatternIdentifiers.cs
- TreeNodeStyleCollection.cs
- InstallerTypeAttribute.cs
- BitStack.cs
- ByteStack.cs
- Decimal.cs
- XmlAggregates.cs
- SqlUtil.cs
- IPEndPointCollection.cs
- ModifierKeysValueSerializer.cs
- SplitContainerDesigner.cs
- XmlElementElement.cs
- KeyValueConfigurationCollection.cs
- DiscoveryServiceExtension.cs
- BinaryReader.cs
- TableItemProviderWrapper.cs
- BuildProvider.cs
- WinEventWrap.cs
- XmlSchemaInfo.cs
- WebBrowserBase.cs
- Simplifier.cs
- RunWorkerCompletedEventArgs.cs
- PersonalizationProvider.cs
- SchemaCollectionPreprocessor.cs
- BinaryObjectInfo.cs
- OpCodes.cs
- TypefaceCollection.cs
- CheckBoxRenderer.cs
- ISCIIEncoding.cs
- DateTime.cs
- PreservationFileWriter.cs
- HTTPNotFoundHandler.cs
- DataReaderContainer.cs
- XmlQueryRuntime.cs
- SizeF.cs
- XPathNodeIterator.cs
- WebZone.cs
- ListViewGroup.cs
- AnchorEditor.cs
- CustomCredentialPolicy.cs
- FontEmbeddingManager.cs
- TemplateBindingExpressionConverter.cs
- Object.cs
- NamedPipeTransportSecurity.cs
- errorpatternmatcher.cs
- DetailsViewDeletedEventArgs.cs
- AbsoluteQuery.cs
- DesignerWidgets.cs
- WeakHashtable.cs
- VectorConverter.cs
- CodeDomConfigurationHandler.cs
- AudioFileOut.cs
- CompilerHelpers.cs