Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Currency.cs / 1305376 / Currency.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System { using System; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.Versioning; #if !FEATURE_CORECLR [System.Runtime.ForceTokenStabilization] #endif //!FEATURE_CORECLR [Serializable] internal struct Currency { internal long m_value; // Constructs a Currency from a Decimal value. // #if !FEATURE_CORECLR [System.Runtime.ForceTokenStabilization] #endif //!FEATURE_CORECLR 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. // [System.Security.SecuritySafeCritical] // auto-generated public static Decimal ToDecimal(Currency c) { Decimal result = new Decimal (); FCallToDecimal (ref result, c); return result; } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [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; using System.Runtime.Versioning; #if !FEATURE_CORECLR [System.Runtime.ForceTokenStabilization] #endif //!FEATURE_CORECLR [Serializable] internal struct Currency { internal long m_value; // Constructs a Currency from a Decimal value. // #if !FEATURE_CORECLR [System.Runtime.ForceTokenStabilization] #endif //!FEATURE_CORECLR 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. // [System.Security.SecuritySafeCritical] // auto-generated public static Decimal ToDecimal(Currency c) { Decimal result = new Decimal (); FCallToDecimal (ref result, c); return result; } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [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
- DashStyle.cs
- AbstractDataSvcMapFileLoader.cs
- __ConsoleStream.cs
- OleDbConnectionFactory.cs
- TemplateNameScope.cs
- WindowVisualStateTracker.cs
- EntityTypeEmitter.cs
- ExpressionBindingCollection.cs
- GetLastErrorDetailsRequest.cs
- UnitControl.cs
- XamlDesignerSerializationManager.cs
- InvokeGenerator.cs
- ReversePositionQuery.cs
- Color.cs
- SmiGettersStream.cs
- WebMethodAttribute.cs
- XmlWrappingReader.cs
- CubicEase.cs
- PointLight.cs
- PolicyException.cs
- ImportOptions.cs
- NamedElement.cs
- StringDictionary.cs
- SectionUpdates.cs
- DataBoundControlAdapter.cs
- OpenFileDialog.cs
- ExpressionConverter.cs
- ServiceAppDomainAssociationProvider.cs
- DynamicScriptObject.cs
- DataGridCommandEventArgs.cs
- VariableValue.cs
- InvokeCompletedEventArgs.cs
- ServiceDescriptionSerializer.cs
- WebPartMovingEventArgs.cs
- SafeBuffer.cs
- SqlConnectionStringBuilder.cs
- EntityExpressionVisitor.cs
- DebugView.cs
- EmbeddedMailObject.cs
- DynamicArgumentDialog.cs
- GridViewPageEventArgs.cs
- GeneralTransform3D.cs
- DataGridPagingPage.cs
- SettingsPropertyNotFoundException.cs
- GeometryCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- LogLogRecordHeader.cs
- EdmToObjectNamespaceMap.cs
- ReturnValue.cs
- LinearGradientBrush.cs
- LinqDataSourceUpdateEventArgs.cs
- MsmqProcessProtocolHandler.cs
- HttpContextServiceHost.cs
- StrokeNodeEnumerator.cs
- CompilationSection.cs
- NoClickablePointException.cs
- DataGridBeginningEditEventArgs.cs
- RtfNavigator.cs
- WebZone.cs
- TransactionState.cs
- SafeArrayRankMismatchException.cs
- SemanticResultValue.cs
- HttpWriter.cs
- Storyboard.cs
- ComponentChangedEvent.cs
- StylusButtonEventArgs.cs
- WS2007HttpBindingElement.cs
- TreeNode.cs
- _SSPISessionCache.cs
- Ref.cs
- ChannelDispatcherCollection.cs
- BitmapEffectGroup.cs
- TraceRecords.cs
- DecoderBestFitFallback.cs
- EntityDataSourceWrapper.cs
- ScrollChrome.cs
- InternalConfigEventArgs.cs
- InternalMappingException.cs
- TdsEnums.cs
- WebPartConnectionsCloseVerb.cs
- RuntimeCompatibilityAttribute.cs
- TcpAppDomainProtocolHandler.cs
- BasicViewGenerator.cs
- FilteredXmlReader.cs
- StatusBar.cs
- _Events.cs
- TextTreeNode.cs
- CollectionsUtil.cs
- XmlDataSourceNodeDescriptor.cs
- WinEventHandler.cs
- SamlAction.cs
- _SSPIWrapper.cs
- RegionInfo.cs
- LinkButton.cs
- CanonicalFontFamilyReference.cs
- ConstNode.cs
- BulletedListEventArgs.cs
- XomlCompiler.cs
- String.cs
- DataRowIndexBuffer.cs