Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CombinedGeometry.cs
- PackWebResponse.cs
- ServiceOperationParameter.cs
- StylusButtonCollection.cs
- ReadOnlyNameValueCollection.cs
- FormViewDeleteEventArgs.cs
- MsmqProcessProtocolHandler.cs
- TemplatedWizardStep.cs
- EmptyElement.cs
- BitmapMetadataBlob.cs
- SharedStatics.cs
- ClientTargetSection.cs
- CompiledELinqQueryState.cs
- SByteConverter.cs
- LinkArea.cs
- Menu.cs
- FileDetails.cs
- InstanceData.cs
- URL.cs
- ObjectConverter.cs
- ParagraphResult.cs
- ParenthesizePropertyNameAttribute.cs
- SystemWebCachingSectionGroup.cs
- GatewayDefinition.cs
- FacetEnabledSchemaElement.cs
- DbParameterCollectionHelper.cs
- UserControlAutomationPeer.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- PersistenceTask.cs
- UserControlParser.cs
- Page.cs
- ProcessModule.cs
- TextTreeObjectNode.cs
- wgx_sdk_version.cs
- ChtmlPhoneCallAdapter.cs
- BooleanAnimationUsingKeyFrames.cs
- SafeNativeMethods.cs
- RootNamespaceAttribute.cs
- HierarchicalDataSourceDesigner.cs
- ThemeInfoAttribute.cs
- EventlogProvider.cs
- TableLayoutPanel.cs
- EditingScopeUndoUnit.cs
- RequestQueue.cs
- ZipIORawDataFileBlock.cs
- ControlCollection.cs
- PathParser.cs
- MutexSecurity.cs
- ImageList.cs
- SequentialActivityDesigner.cs
- ColorConvertedBitmapExtension.cs
- CacheEntry.cs
- Types.cs
- ListCollectionView.cs
- RootBrowserWindowAutomationPeer.cs
- TimeSpanOrInfiniteValidator.cs
- XmlQualifiedNameTest.cs
- Crc32Helper.cs
- LambdaCompiler.Address.cs
- ListControl.cs
- HandlerBase.cs
- UserCancellationException.cs
- AdvancedBindingPropertyDescriptor.cs
- ThreadLocal.cs
- TransformGroup.cs
- DbConnectionPoolOptions.cs
- ImageAttributes.cs
- SafeProcessHandle.cs
- ContentPathSegment.cs
- ParentQuery.cs
- DataGridViewTextBoxCell.cs
- RectValueSerializer.cs
- Mapping.cs
- PeerChannelFactory.cs
- DoubleAnimationUsingPath.cs
- HostingPreferredMapPath.cs
- PartialClassGenerationTaskInternal.cs
- GifBitmapEncoder.cs
- TextEditorTables.cs
- PasswordDeriveBytes.cs
- DbgUtil.cs
- PortCache.cs
- TableDetailsRow.cs
- SerializationSectionGroup.cs
- WmfPlaceableFileHeader.cs
- ListViewPagedDataSource.cs
- TreeNodeStyleCollectionEditor.cs
- SecurityTokenRequirement.cs
- XPathDescendantIterator.cs
- WebConvert.cs
- ChildDocumentBlock.cs
- loginstatus.cs
- HttpModuleAction.cs
- AudioFormatConverter.cs
- ColumnCollectionEditor.cs
- SafeFileMappingHandle.cs
- TypedServiceChannelBuilder.cs
- ErrorFormatterPage.cs
- _FixedSizeReader.cs
- hresults.cs