GeneralTransform.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / Media / GeneralTransform.cs / 2 / GeneralTransform.cs

                            //---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) Microsoft Corporation.  All rights reserved.
//  
//
// 
// Description: Declaration of the GeneralTransform class. 
//
//--------------------------------------------------------------------------- 

using MS.Internal;
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.Security.Permissions;
using System.Windows; 
using System.Windows.Media.Animation;
using System.Windows.Media.Composition; 
using System.Windows.Markup; 
using MS.Internal.PresentationCore;
 
namespace System.Windows.Media
{
    /// 
    /// GeneralTransform class provides services to transform points and rects 
    /// 
    [Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] 
    public abstract partial class GeneralTransform : Animatable 
    {
        ///  
        /// Transform a point
        /// 
        /// Input point
        /// Output point 
        /// True if the point was transformed successfuly, false otherwise
        public abstract bool TryTransform(Point inPoint, out Point result); 
 
        /// 
        /// Transform a point 
        ///
        /// If the transformation does not succeed, this will throw an InvalidOperationException.
        /// If you don't want to try/catch, call TryTransform instead and check the boolean it
        /// returns. 
        ///
        /// Note that this method will always succeed when called on a subclass of Transform 
        ///  
        /// Input point
        /// The transformed point 
        public Point Transform(Point point)
        {
            Point transformedPoint;
 
            if (!TryTransform(point, out transformedPoint))
            { 
                throw new InvalidOperationException(SR.Get(SRID.GeneralTransform_TransformFailed, null)); 
            }
 
            return transformedPoint;
        }

        ///  
        /// Transforms the bounding box to the smallest axis aligned bounding box
        /// that contains all the points in the original bounding box 
        ///  
        /// Bounding box
        /// The transformed bounding box 
        public abstract Rect TransformBounds(Rect rect);


        ///  
        /// Returns the inverse transform if it has an inverse, null otherwise
        ///  
        public abstract GeneralTransform Inverse { get; } 

        ///  
        /// Returns a best effort affine transform
        /// 
        internal virtual Transform AffineTransform
        { 
            [FriendAccessAllowed] // Built into Core, also used by Framework.
            get { return null; } 
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) Microsoft Corporation.  All rights reserved.
//  
//
// 
// Description: Declaration of the GeneralTransform class. 
//
//--------------------------------------------------------------------------- 

using MS.Internal;
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.Security.Permissions;
using System.Windows; 
using System.Windows.Media.Animation;
using System.Windows.Media.Composition; 
using System.Windows.Markup; 
using MS.Internal.PresentationCore;
 
namespace System.Windows.Media
{
    /// 
    /// GeneralTransform class provides services to transform points and rects 
    /// 
    [Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] 
    public abstract partial class GeneralTransform : Animatable 
    {
        ///  
        /// Transform a point
        /// 
        /// Input point
        /// Output point 
        /// True if the point was transformed successfuly, false otherwise
        public abstract bool TryTransform(Point inPoint, out Point result); 
 
        /// 
        /// Transform a point 
        ///
        /// If the transformation does not succeed, this will throw an InvalidOperationException.
        /// If you don't want to try/catch, call TryTransform instead and check the boolean it
        /// returns. 
        ///
        /// Note that this method will always succeed when called on a subclass of Transform 
        ///  
        /// Input point
        /// The transformed point 
        public Point Transform(Point point)
        {
            Point transformedPoint;
 
            if (!TryTransform(point, out transformedPoint))
            { 
                throw new InvalidOperationException(SR.Get(SRID.GeneralTransform_TransformFailed, null)); 
            }
 
            return transformedPoint;
        }

        ///  
        /// Transforms the bounding box to the smallest axis aligned bounding box
        /// that contains all the points in the original bounding box 
        ///  
        /// Bounding box
        /// The transformed bounding box 
        public abstract Rect TransformBounds(Rect rect);


        ///  
        /// Returns the inverse transform if it has an inverse, null otherwise
        ///  
        public abstract GeneralTransform Inverse { get; } 

        ///  
        /// Returns a best effort affine transform
        /// 
        internal virtual Transform AffineTransform
        { 
            [FriendAccessAllowed] // Built into Core, also used by Framework.
            get { return null; } 
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK