Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContextMarshalException.cs
- SiteMapNode.cs
- QueueProcessor.cs
- SimplePropertyEntry.cs
- Guid.cs
- BitmapEffectRenderDataResource.cs
- DiffuseMaterial.cs
- LateBoundChannelParameterCollection.cs
- AdRotator.cs
- BuildTopDownAttribute.cs
- RadioButtonPopupAdapter.cs
- remotingproxy.cs
- DataServiceQuery.cs
- MetadataPropertyvalue.cs
- Configuration.cs
- FontSource.cs
- InvalidProgramException.cs
- TraceData.cs
- BindingGroup.cs
- TypeToken.cs
- __ComObject.cs
- AppSettingsExpressionBuilder.cs
- PeerNameRecordCollection.cs
- ListViewDeletedEventArgs.cs
- WebPartConnectionsCancelEventArgs.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- RIPEMD160.cs
- XsdDuration.cs
- UnsafePeerToPeerMethods.cs
- ColorIndependentAnimationStorage.cs
- StrongName.cs
- ChildDocumentBlock.cs
- Table.cs
- CacheEntry.cs
- EnumMemberAttribute.cs
- _FtpDataStream.cs
- SiteMapPath.cs
- DynamicResourceExtension.cs
- WarningException.cs
- BaseProcessor.cs
- NeutralResourcesLanguageAttribute.cs
- ColorMatrix.cs
- UpWmlMobileTextWriter.cs
- TreeNodeBindingCollection.cs
- DesignerObjectListAdapter.cs
- ThemeableAttribute.cs
- HotSpotCollection.cs
- XmlSchemaSimpleContentRestriction.cs
- TagPrefixCollection.cs
- BuildTopDownAttribute.cs
- WebPartConnectionCollection.cs
- XmlTextEncoder.cs
- UrlMappingsSection.cs
- EdmConstants.cs
- HtmlImage.cs
- SafeLibraryHandle.cs
- WindowsFormsSectionHandler.cs
- TypeElement.cs
- SafeCoTaskMem.cs
- InvalidCommandTreeException.cs
- RegexCode.cs
- InternalBase.cs
- SqlCommandSet.cs
- handlecollector.cs
- XmlDictionaryReaderQuotas.cs
- SrgsOneOf.cs
- SelectiveScrollingGrid.cs
- DiscriminatorMap.cs
- OdbcRowUpdatingEvent.cs
- connectionpool.cs
- BrowserCapabilitiesCodeGenerator.cs
- SecurityPermission.cs
- HybridWebProxyFinder.cs
- ToolStripActionList.cs
- SimpleBitVector32.cs
- SqlFunctionAttribute.cs
- SignedPkcs7.cs
- SoapIgnoreAttribute.cs
- FakeModelPropertyImpl.cs
- GetUserPreferenceRequest.cs
- ControlPaint.cs
- XmlSchemaIdentityConstraint.cs
- EncryptedKey.cs
- BaseTreeIterator.cs
- PriorityItem.cs
- ControlPersister.cs
- Empty.cs
- MessagePropertyVariants.cs
- AccessDataSourceView.cs
- BinaryMethodMessage.cs
- ActionFrame.cs
- CriticalExceptions.cs
- SiteOfOriginPart.cs
- DateTimeValueSerializerContext.cs
- Span.cs
- InvalidEnumArgumentException.cs
- LogSwitch.cs
- XmlMapping.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- PathGeometry.cs