Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CommonUI / System / Drawing / Advanced / PointF.cs / 2 / 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. //------------------------------------------------------------------------------ // // 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
- BindingNavigator.cs
- Pointer.cs
- EmptyStringExpandableObjectConverter.cs
- PrintDialog.cs
- PLINQETWProvider.cs
- AssemblyName.cs
- XmlILOptimizerVisitor.cs
- BitmapImage.cs
- DispatchChannelSink.cs
- TextProperties.cs
- GridView.cs
- ConnectionPointCookie.cs
- InvalidComObjectException.cs
- DesignTimeValidationFeature.cs
- GeneralTransformGroup.cs
- CodeNamespace.cs
- WindowsTab.cs
- ComboBoxItem.cs
- PropertyMetadata.cs
- GridViewDeleteEventArgs.cs
- SequentialUshortCollection.cs
- BitmapEffectDrawing.cs
- DbDataRecord.cs
- CellTreeNode.cs
- TdsEnums.cs
- StateMachineExecutionState.cs
- BuildProviderAppliesToAttribute.cs
- TypedReference.cs
- IndentedWriter.cs
- UnmanagedMemoryStreamWrapper.cs
- MessageFilter.cs
- ISO2022Encoding.cs
- SerializationEventsCache.cs
- SetterBase.cs
- ArrayList.cs
- Profiler.cs
- CompilerScopeManager.cs
- NotImplementedException.cs
- SolidBrush.cs
- SwitchLevelAttribute.cs
- SQLCharsStorage.cs
- CorrelationRequestContext.cs
- FontFamily.cs
- XmlSerializableReader.cs
- StatementContext.cs
- SqlDataSourceCache.cs
- LocalTransaction.cs
- CodeMemberEvent.cs
- Configuration.cs
- BaseWebProxyFinder.cs
- PeerHelpers.cs
- AlternateViewCollection.cs
- SharedUtils.cs
- IEnumerable.cs
- AssemblyHash.cs
- ContainerTracking.cs
- AnimationTimeline.cs
- CompensatableTransactionScopeActivity.cs
- FixUpCollection.cs
- HostExecutionContextManager.cs
- CodeDirectoryCompiler.cs
- GeneralTransform3DGroup.cs
- Path.cs
- Binding.cs
- Literal.cs
- DataGridViewToolTip.cs
- TableLayoutStyleCollection.cs
- QueryOptionExpression.cs
- QilChoice.cs
- Properties.cs
- RelationalExpressions.cs
- ComponentChangingEvent.cs
- BitmapVisualManager.cs
- UIElement.cs
- WebEvents.cs
- UriScheme.cs
- ResourceSet.cs
- ContainerParagraph.cs
- Ref.cs
- RecognizerBase.cs
- RepeaterItemCollection.cs
- TransformGroup.cs
- TextParentUndoUnit.cs
- SessionEndingCancelEventArgs.cs
- HttpWriter.cs
- Scene3D.cs
- ProviderCommandInfoUtils.cs
- DiagnosticsConfiguration.cs
- UpdateRecord.cs
- DirectoryLocalQuery.cs
- Verify.cs
- DbExpressionVisitor.cs
- WebPartManager.cs
- ModelTypeConverter.cs
- StreamResourceInfo.cs
- XmlDictionary.cs
- DataListItemCollection.cs
- Grammar.cs
- EventRouteFactory.cs
- Win32MouseDevice.cs