Code:
/ FX-1434 / FX-1434 / 1.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
- UrlMappingsSection.cs
- XsltContext.cs
- _ChunkParse.cs
- Int32Rect.cs
- PropertyGridView.cs
- TextTreeTextElementNode.cs
- VoiceInfo.cs
- RSAOAEPKeyExchangeDeformatter.cs
- OracleBinary.cs
- StringAnimationUsingKeyFrames.cs
- ISFClipboardData.cs
- PassportAuthenticationEventArgs.cs
- IsolatedStorageFilePermission.cs
- PermissionToken.cs
- OutputCacheSettingsSection.cs
- DesignerGenericWebPart.cs
- BindingSourceDesigner.cs
- SiteMapPathDesigner.cs
- TypeUtil.cs
- BaseAddressElement.cs
- ImageMap.cs
- AdvancedBindingEditor.cs
- Parser.cs
- MonitorWrapper.cs
- XmlNavigatorFilter.cs
- ChangeNode.cs
- Perspective.cs
- CalendarSelectionChangedEventArgs.cs
- SqlTypeConverter.cs
- HGlobalSafeHandle.cs
- Permission.cs
- CanonicalFontFamilyReference.cs
- BoundsDrawingContextWalker.cs
- IsolatedStorageException.cs
- GeneralTransformGroup.cs
- _OSSOCK.cs
- CombinedGeometry.cs
- Quad.cs
- ReflectTypeDescriptionProvider.cs
- RawMouseInputReport.cs
- DesignerVerbCollection.cs
- DataSourceComponent.cs
- FieldValue.cs
- HashJoinQueryOperatorEnumerator.cs
- WebPartMovingEventArgs.cs
- DataServiceOperationContext.cs
- WsdlBuildProvider.cs
- UInt16.cs
- ScaleTransform.cs
- PropertyValueChangedEvent.cs
- WindowsRichEditRange.cs
- DbProviderFactory.cs
- StringToken.cs
- SqlFormatter.cs
- NetPeerTcpBindingElement.cs
- HttpResponseInternalWrapper.cs
- StringDictionary.cs
- AdapterDictionary.cs
- EditorAttribute.cs
- TextTreeTextNode.cs
- SqlVersion.cs
- Expression.cs
- SpAudioStreamWrapper.cs
- MediaElementAutomationPeer.cs
- TextSegment.cs
- EndPoint.cs
- ResourceReader.cs
- SafeRightsManagementEnvironmentHandle.cs
- BindingExpression.cs
- SecurityAlgorithmSuiteConverter.cs
- AsymmetricSignatureDeformatter.cs
- elementinformation.cs
- TakeOrSkipQueryOperator.cs
- Tuple.cs
- dataprotectionpermission.cs
- TableRowCollection.cs
- InitializeCorrelation.cs
- ApplyTemplatesAction.cs
- AutoCompleteStringCollection.cs
- EditingScopeUndoUnit.cs
- CheckBox.cs
- HttpCookieCollection.cs
- ChannelRequirements.cs
- SafeMarshalContext.cs
- DrawingDrawingContext.cs
- CompiledWorkflowDefinitionContext.cs
- NewExpression.cs
- TextAutomationPeer.cs
- OptimalTextSource.cs
- RangeValidator.cs
- RectAnimation.cs
- SoapSchemaImporter.cs
- NamespaceMapping.cs
- QueuedDeliveryRequirementsMode.cs
- PagerSettings.cs
- SiteMapSection.cs
- ServiceCredentialsSecurityTokenManager.cs
- CroppedBitmap.cs
- ListContractAdapter.cs
- WebBrowsableAttribute.cs