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
- ParameterModifier.cs
- ClientScriptManagerWrapper.cs
- MachineKeySection.cs
- FileFormatException.cs
- __TransparentProxy.cs
- DynamicResourceExtensionConverter.cs
- DesignerActionUIStateChangeEventArgs.cs
- QuadraticEase.cs
- HttpCookiesSection.cs
- Emitter.cs
- XamlPathDataSerializer.cs
- DateTime.cs
- ConcurrencyBehavior.cs
- WindowsListViewGroupHelper.cs
- ResourceBinder.cs
- RegexCompilationInfo.cs
- EntityKeyElement.cs
- ClientUtils.cs
- SAPICategories.cs
- ProcessHost.cs
- TypedOperationInfo.cs
- Point3DCollectionConverter.cs
- PropertyManager.cs
- __FastResourceComparer.cs
- Dispatcher.cs
- GridProviderWrapper.cs
- QueryResponse.cs
- Transform3DGroup.cs
- CodeLabeledStatement.cs
- TemplateXamlTreeBuilder.cs
- DefaultTraceListener.cs
- WebContext.cs
- SamlConstants.cs
- GeneralTransform3DGroup.cs
- Odbc32.cs
- RemoteWebConfigurationHostStream.cs
- CompatibleIComparer.cs
- SymLanguageVendor.cs
- HttpDebugHandler.cs
- CanExpandCollapseAllConverter.cs
- NavigationPropertySingletonExpression.cs
- DatatypeImplementation.cs
- SiteMapNode.cs
- WebPartConnectionsDisconnectVerb.cs
- ImportDesigner.xaml.cs
- TreeViewCancelEvent.cs
- Line.cs
- Matrix3DValueSerializer.cs
- MenuItem.cs
- ConstraintStruct.cs
- GorillaCodec.cs
- FixedDocumentPaginator.cs
- Function.cs
- Metadata.cs
- RSAProtectedConfigurationProvider.cs
- HeaderUtility.cs
- DrawListViewColumnHeaderEventArgs.cs
- FixedSOMGroup.cs
- DataListCommandEventArgs.cs
- FileLogRecordEnumerator.cs
- WindowsSecurityTokenAuthenticator.cs
- LinkGrep.cs
- FontNameEditor.cs
- LeaseManager.cs
- Interlocked.cs
- CalendarDataBindingHandler.cs
- SmtpFailedRecipientsException.cs
- MediaPlayer.cs
- DSASignatureFormatter.cs
- StrokeCollectionDefaultValueFactory.cs
- NonVisualControlAttribute.cs
- HMACMD5.cs
- ViewManager.cs
- _HelperAsyncResults.cs
- SchemaSetCompiler.cs
- ConstrainedGroup.cs
- shaperfactoryquerycacheentry.cs
- SQLChars.cs
- MouseActionValueSerializer.cs
- SqlConnection.cs
- RtfNavigator.cs
- TableLayoutStyleCollection.cs
- ReadOnlyCollection.cs
- DockingAttribute.cs
- ExtendedPropertiesHandler.cs
- UserNameSecurityTokenAuthenticator.cs
- TripleDES.cs
- SerializationException.cs
- OracleLob.cs
- DataGridColumnHeader.cs
- PageContent.cs
- DataContext.cs
- ListControlDesigner.cs
- SafeFileMapViewHandle.cs
- Style.cs
- SqlUserDefinedTypeAttribute.cs
- JumpList.cs
- SymDocumentType.cs
- COMException.cs
- SafeSystemMetrics.cs