Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Advanced / PointF.cs / 1305376 / PointF.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CalendarAutoFormat.cs
- BuildTopDownAttribute.cs
- ZipIOExtraField.cs
- SupportsEventValidationAttribute.cs
- RuleSettings.cs
- AsymmetricKeyExchangeFormatter.cs
- StreamingContext.cs
- SchemaSetCompiler.cs
- XmlNodeList.cs
- SecUtil.cs
- IndentedTextWriter.cs
- _ChunkParse.cs
- SimpleWebHandlerParser.cs
- XmlSchemaException.cs
- OutputCacheModule.cs
- ApplicationActivator.cs
- MsmqInputMessage.cs
- SourceFilter.cs
- CharUnicodeInfo.cs
- KeyedCollection.cs
- CodeThrowExceptionStatement.cs
- NGCUIElementCollectionSerializerAsync.cs
- TableLayoutSettings.cs
- RawStylusInputCustomData.cs
- ViewStateException.cs
- BookmarkUndoUnit.cs
- MetadataItem_Static.cs
- ByteAnimationUsingKeyFrames.cs
- PreviewKeyDownEventArgs.cs
- KeyConstraint.cs
- PeerContact.cs
- DictionaryManager.cs
- Bold.cs
- MetaForeignKeyColumn.cs
- WindowsListView.cs
- TableNameAttribute.cs
- ProtectedUri.cs
- SchemaType.cs
- WorkflowClientDeliverMessageWrapper.cs
- DispatcherTimer.cs
- ViewManager.cs
- ProcessModelSection.cs
- ColorBlend.cs
- EpmSyndicationContentDeSerializer.cs
- NumberSubstitution.cs
- CodeParameterDeclarationExpression.cs
- ConfigurationStrings.cs
- TypeDescriptor.cs
- DESCryptoServiceProvider.cs
- SoapSchemaMember.cs
- FolderBrowserDialogDesigner.cs
- CharAnimationBase.cs
- RadioButtonPopupAdapter.cs
- TimerElapsedEvenArgs.cs
- TextServicesPropertyRanges.cs
- ListBoxAutomationPeer.cs
- Highlights.cs
- mda.cs
- SingleObjectCollection.cs
- ConfigurationLockCollection.cs
- AsyncResult.cs
- RelationshipConverter.cs
- JumpPath.cs
- RectKeyFrameCollection.cs
- wmiprovider.cs
- FixUpCollection.cs
- AstNode.cs
- SecurityRuntime.cs
- CommonRemoteMemoryBlock.cs
- ManagedIStream.cs
- PolyLineSegmentFigureLogic.cs
- XhtmlConformanceSection.cs
- SpellerHighlightLayer.cs
- TreeIterator.cs
- WebColorConverter.cs
- SqlError.cs
- DataServiceQueryProvider.cs
- StaticDataManager.cs
- InputLangChangeEvent.cs
- NoResizeHandleGlyph.cs
- PenContexts.cs
- BitmapDownload.cs
- QilStrConcat.cs
- JsonDeserializer.cs
- AVElementHelper.cs
- MailMessage.cs
- Helper.cs
- BaseValidator.cs
- RightNameExpirationInfoPair.cs
- DockProviderWrapper.cs
- ImageCodecInfo.cs
- UnSafeCharBuffer.cs
- Propagator.cs
- securitycriticaldataformultiplegetandset.cs
- ValueSerializer.cs
- DBConnectionString.cs
- WorkflowEventArgs.cs
- OrderedDictionaryStateHelper.cs
- TextStore.cs
- FormViewModeEventArgs.cs