Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Currency.cs / 1 / Currency.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System { using System; using System.Globalization; using System.Runtime.CompilerServices; [Serializable] internal struct Currency { internal long m_value; // Constructs a Currency from a Decimal value. // public Currency(Decimal value) { m_value = Decimal.ToCurrency(value).m_value; } // Constructs a Currency from a long value without scaling. The // ignored parameter exists only to distinguish this constructor // from the constructor that takes a long. Used only in the System // package, especially in Variant. internal Currency(long value, int ignored) { m_value = value; } // Creates a Currency from an OLE Automation Currency. This method // applies no scaling to the Currency value, essentially doing a bitwise // copy. // public static Currency FromOACurrency(long cy){ return new Currency(cy, 0); } //Creates an OLE Automation Currency from a Currency instance. This // method applies no scaling to the Currency value, essentially doing // a bitwise copy. // public long ToOACurrency() { return m_value; } // Converts a Currency to a Decimal. // public static Decimal ToDecimal(Currency c) { Decimal result = new Decimal (); FCallToDecimal (ref result, c); return result; } [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void FCallToDecimal(ref Decimal result,Currency c); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System { using System; using System.Globalization; using System.Runtime.CompilerServices; [Serializable] internal struct Currency { internal long m_value; // Constructs a Currency from a Decimal value. // public Currency(Decimal value) { m_value = Decimal.ToCurrency(value).m_value; } // Constructs a Currency from a long value without scaling. The // ignored parameter exists only to distinguish this constructor // from the constructor that takes a long. Used only in the System // package, especially in Variant. internal Currency(long value, int ignored) { m_value = value; } // Creates a Currency from an OLE Automation Currency. This method // applies no scaling to the Currency value, essentially doing a bitwise // copy. // public static Currency FromOACurrency(long cy){ return new Currency(cy, 0); } //Creates an OLE Automation Currency from a Currency instance. This // method applies no scaling to the Currency value, essentially doing // a bitwise copy. // public long ToOACurrency() { return m_value; } // Converts a Currency to a Decimal. // public static Decimal ToDecimal(Currency c) { Decimal result = new Decimal (); FCallToDecimal (ref result, c); return result; } [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void FCallToDecimal(ref Decimal result,Currency c); } } // 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
- SQLBoolean.cs
- InkCanvasSelection.cs
- WebPartUtil.cs
- FontNamesConverter.cs
- UpdateProgress.cs
- TableLayoutColumnStyleCollection.cs
- Section.cs
- DataGridTable.cs
- RegistrySecurity.cs
- WeakRefEnumerator.cs
- JoinSymbol.cs
- GeneratedView.cs
- CssTextWriter.cs
- HttpResponseWrapper.cs
- EdmProperty.cs
- DateTimeSerializationSection.cs
- InheritanceContextHelper.cs
- CanonicalXml.cs
- XmlAggregates.cs
- ToolStripMenuItem.cs
- MailDefinition.cs
- _DomainName.cs
- DataGridViewCellParsingEventArgs.cs
- CachedPathData.cs
- CacheForPrimitiveTypes.cs
- Line.cs
- EmptyStringExpandableObjectConverter.cs
- BezierSegment.cs
- ExpressionWriter.cs
- BinHexDecoder.cs
- InternalUserCancelledException.cs
- WinFormsUtils.cs
- VisualBrush.cs
- Convert.cs
- Repeater.cs
- UserNameSecurityToken.cs
- SequentialActivityDesigner.cs
- ConfigurationValue.cs
- LinqToSqlWrapper.cs
- DataQuery.cs
- FixUpCollection.cs
- VolatileEnlistmentState.cs
- InkCanvas.cs
- SQLBinary.cs
- httpapplicationstate.cs
- AccessControlEntry.cs
- WebConfigurationHost.cs
- X509Certificate.cs
- SelectionGlyphBase.cs
- FixedSOMLineRanges.cs
- SendMailErrorEventArgs.cs
- ParserHooks.cs
- Pair.cs
- AuthenticatingEventArgs.cs
- LessThan.cs
- SerializationInfoEnumerator.cs
- MulticastIPAddressInformationCollection.cs
- clipboard.cs
- GestureRecognizer.cs
- ControlOperationBehavior.cs
- StrongNameUtility.cs
- KeyboardDevice.cs
- XhtmlTextWriter.cs
- CorrelationManager.cs
- TextDecorationCollection.cs
- TransformedBitmap.cs
- ComponentManagerBroker.cs
- ErrorProvider.cs
- ClientRolePrincipal.cs
- QueryCacheManager.cs
- DoubleUtil.cs
- AbandonedMutexException.cs
- WebBaseEventKeyComparer.cs
- ClusterUtils.cs
- WFItemsToSpacerVisibility.cs
- dsa.cs
- InputReport.cs
- WSFederationHttpSecurityElement.cs
- UIElement3D.cs
- SchemaImporter.cs
- TcpClientSocketManager.cs
- Certificate.cs
- DBNull.cs
- TextEvent.cs
- MdiWindowListStrip.cs
- XmlCustomFormatter.cs
- SyndicationDeserializer.cs
- OutputCacheSection.cs
- ElasticEase.cs
- ManagementEventArgs.cs
- ListViewItem.cs
- BindingList.cs
- MediaTimeline.cs
- Drawing.cs
- ProviderConnectionPointCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- AmbiguousMatchException.cs
- Char.cs
- CompareInfo.cs
- EraserBehavior.cs