Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CommonUI / System / Drawing / Advanced / PointF.cs / 1 / PointF.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /*************************************************************************\ * * Copyright (c) 1998-1999, Microsoft Corp. All Rights Reserved. * * Module Name: * * PointF.cs * * Abstract: * * Floating-point coordinate point class * * Revision History: * * 12/14/1998 davidx * Created it. * \**************************************************************************/ namespace System.Drawing { using System.Diagnostics; using System.Drawing; using System.ComponentModel; using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; /** * Represents a point in 2D coordinate space * (float precision floating-point coordinates) */ ////// /// Represents an ordered pair of x and y coordinates that /// define a point in a two-dimensional plane. /// [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public struct PointF { ////// /// public static readonly PointF Empty = new PointF(); private float x; private float y; /** * Create a new Point object at the given location */ ////// Creates a new instance of the ///class /// with member data left uninitialized. /// /// /// public PointF(float x, float y) { this.x = x; this.y = y; } ////// Initializes a new instance of the ///class /// with the specified coordinates. /// /// /// [Browsable(false)] public bool IsEmpty { get { return x == 0f && y == 0f; } } ////// Gets a value indicating whether this ///is empty. /// /// /// public float X { get { return x; } set { x = value; } } ////// Gets the x-coordinate of this ///. /// /// /// public float Y { get { return y; } set { y = value; } } ////// Gets the y-coordinate of this ///. /// /// /// public static PointF operator +(PointF pt, Size sz) { return Add(pt, sz); } ////// Translates a ///by a given . /// /// /// public static PointF operator -(PointF pt, Size sz) { return Subtract(pt, sz); } ////// Translates a ///by the negative of a given . /// /// public static PointF operator +(PointF pt, SizeF sz) { return Add(pt, sz); } ////// Translates a ///by a given . /// /// public static PointF operator -(PointF pt, SizeF sz) { return Subtract(pt, sz); } ////// Translates a ///by the negative of a given . /// /// /// public static bool operator ==(PointF left, PointF right) { return left.X == right.X && left.Y == right.Y; } ////// Compares two ///objects. The result specifies /// whether the values of the and properties of the two /// objects are equal. /// /// /// public static bool operator !=(PointF left, PointF right) { return !(left == right); } ////// Compares two ///objects. The result specifies whether the values /// of the or properties of the two /// /// objects are unequal. /// /// public static PointF Add(PointF pt, Size sz) { return new PointF(pt.X + sz.Width, pt.Y + sz.Height); } ////// Translates a ///by a given . /// /// public static PointF Subtract(PointF pt, Size sz) { return new PointF(pt.X - sz.Width, pt.Y - sz.Height); } ////// Translates a ///by the negative of a given . /// /// public static PointF Add(PointF pt, SizeF sz){ return new PointF(pt.X + sz.Width, pt.Y + sz.Height); } ////// Translates a ///by a given . /// /// public static PointF Subtract(PointF pt, SizeF sz){ return new PointF(pt.X - sz.Width, pt.Y - sz.Height); } ////// Translates a ///by the negative of a given . /// /// /// public override bool Equals(object obj) { if (!(obj is PointF)) return false; PointF comp = (PointF)obj; return comp.X == this.X && comp.Y == this.Y && comp.GetType().Equals(this.GetType()); } ///[To be supplied.] ////// /// public override int GetHashCode() { return base.GetHashCode(); } ///[To be supplied.] ///public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "{{X={0}, Y={1}}}", x, y); } } } // 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
- KeyboardInputProviderAcquireFocusEventArgs.cs
- BindValidator.cs
- DataControlExtensions.cs
- LocalizationParserHooks.cs
- OperationAbortedException.cs
- EmbeddedMailObject.cs
- HtmlButton.cs
- WebPartCatalogCloseVerb.cs
- MultiBinding.cs
- ToolStripOverflow.cs
- AspNetSynchronizationContext.cs
- CompressionTransform.cs
- VersionPair.cs
- FontDriver.cs
- recordstate.cs
- Popup.cs
- XmlNodeList.cs
- DoubleLinkListEnumerator.cs
- WeakReference.cs
- FontCacheUtil.cs
- XmlAtomicValue.cs
- ServiceInfo.cs
- ThreadLocal.cs
- InkCanvasSelection.cs
- RelationshipManager.cs
- ComponentCommands.cs
- WebConfigurationFileMap.cs
- PointAnimation.cs
- TaskScheduler.cs
- ImageCreator.cs
- ExpressionEditorAttribute.cs
- FunctionDefinition.cs
- XmlNamedNodeMap.cs
- Crc32.cs
- DataBinding.cs
- UnsafeNativeMethodsPenimc.cs
- JsonFormatReaderGenerator.cs
- ISFClipboardData.cs
- RelationshipDetailsCollection.cs
- FilterableData.cs
- FileStream.cs
- ClientUrlResolverWrapper.cs
- StyleReferenceConverter.cs
- CodeNamespaceImport.cs
- ReflectPropertyDescriptor.cs
- DataGridViewAdvancedBorderStyle.cs
- ThemeDictionaryExtension.cs
- ExpressionConverter.cs
- ToolStripDropDownItem.cs
- TypeDescriptionProvider.cs
- RegistryConfigurationProvider.cs
- DataGridViewMethods.cs
- InfoCardSymmetricCrypto.cs
- FormViewPagerRow.cs
- SqlDataSourceAdvancedOptionsForm.cs
- PageAsyncTaskManager.cs
- PropertyGridView.cs
- FormClosedEvent.cs
- IgnoreSectionHandler.cs
- RefType.cs
- ConnectionManagementElement.cs
- Tuple.cs
- WithStatement.cs
- HttpModuleAction.cs
- _RequestCacheProtocol.cs
- PersonalizationAdministration.cs
- XamlClipboardData.cs
- RtType.cs
- FlowPosition.cs
- SchemaElementDecl.cs
- DataGridRowsPresenter.cs
- ScrollBar.cs
- EdmProviderManifest.cs
- Quaternion.cs
- LiteralLink.cs
- _SslSessionsCache.cs
- PixelFormats.cs
- RequestCachePolicyConverter.cs
- TextOnlyOutput.cs
- ArrayElementGridEntry.cs
- MsiStyleLogWriter.cs
- TriggerAction.cs
- AspNetSynchronizationContext.cs
- GroupBox.cs
- CodeGroup.cs
- CultureMapper.cs
- ExpressionParser.cs
- SchemaMerger.cs
- SQLResource.cs
- Visual3D.cs
- TransactionManager.cs
- SerializationStore.cs
- ExternalException.cs
- X509CertificateStore.cs
- MessageBox.cs
- X509Certificate2Collection.cs
- GenericAuthenticationEventArgs.cs
- _HTTPDateParse.cs
- DropShadowEffect.cs
- StringBuilder.cs