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
- CodeObjectCreateExpression.cs
- BaseDataBoundControl.cs
- ConfigViewGenerator.cs
- DbParameterHelper.cs
- CommonObjectSecurity.cs
- PermissionSetTriple.cs
- InfoCardClaimCollection.cs
- SystemIPInterfaceProperties.cs
- ResourceContainer.cs
- MemberAssignmentAnalysis.cs
- TreeNode.cs
- smtppermission.cs
- FakeModelItemImpl.cs
- TTSEngineProxy.cs
- SRGSCompiler.cs
- XmlILStorageConverter.cs
- ControlBuilderAttribute.cs
- DbSource.cs
- PopupControlService.cs
- FileResponseElement.cs
- DataSourceComponent.cs
- ColumnPropertiesGroup.cs
- DataService.cs
- Soap11ServerProtocol.cs
- ServiceNameCollection.cs
- EncryptedXml.cs
- SignatureHelper.cs
- CompilerCollection.cs
- XmlSchemaComplexContent.cs
- ApplicationContext.cs
- TokenizerHelper.cs
- Atom10FeedFormatter.cs
- Substitution.cs
- HttpProfileGroupBase.cs
- RouteParameter.cs
- PermissionAttributes.cs
- DataGridViewComboBoxColumn.cs
- RemotingServices.cs
- IIS7WorkerRequest.cs
- TextModifierScope.cs
- UxThemeWrapper.cs
- sortedlist.cs
- XmlWriterDelegator.cs
- ObjectDataSourceStatusEventArgs.cs
- DispatcherOperation.cs
- View.cs
- SendContent.cs
- IUnknownConstantAttribute.cs
- FileDialogCustomPlacesCollection.cs
- Point3DCollection.cs
- Bind.cs
- UIElement3D.cs
- EventSourceCreationData.cs
- ProfileModule.cs
- BindingExpressionBase.cs
- DrawingServices.cs
- CustomLineCap.cs
- DynamicActivityTypeDescriptor.cs
- FormatPage.cs
- UInt32.cs
- UIInitializationException.cs
- DSASignatureDeformatter.cs
- FileChangesMonitor.cs
- DurableInstanceManager.cs
- MouseButtonEventArgs.cs
- MonthChangedEventArgs.cs
- PerformanceCounterPermissionEntry.cs
- Int64AnimationBase.cs
- DetailsViewAutoFormat.cs
- WorkflowLayouts.cs
- EDesignUtil.cs
- MetadataHelper.cs
- basemetadatamappingvisitor.cs
- ArrayHelper.cs
- assemblycache.cs
- UIElement.cs
- PersonalizationProvider.cs
- WmfPlaceableFileHeader.cs
- MemberDescriptor.cs
- KeyConverter.cs
- Application.cs
- codemethodreferenceexpression.cs
- ToolStripDesignerAvailabilityAttribute.cs
- HtmlContainerControl.cs
- DefaultPropertyAttribute.cs
- ListenerSessionConnectionReader.cs
- FixUp.cs
- ClassicBorderDecorator.cs
- TextEditorLists.cs
- XamlWriter.cs
- CqlErrorHelper.cs
- UIPermission.cs
- EdmFunction.cs
- DataControlFieldHeaderCell.cs
- DashStyle.cs
- OwnerDrawPropertyBag.cs
- XmlSchema.cs
- ControlBuilder.cs
- EventDescriptor.cs
- AccessedThroughPropertyAttribute.cs