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
- KnownTypesProvider.cs
- PagesChangedEventArgs.cs
- Pair.cs
- LocalizationParserHooks.cs
- BitVector32.cs
- KeyInstance.cs
- EntitySetBaseCollection.cs
- XmlEncodedRawTextWriter.cs
- SimpleType.cs
- ResourceSetExpression.cs
- SmiMetaData.cs
- DataMisalignedException.cs
- designeractionbehavior.cs
- XmlSerializerOperationFormatter.cs
- GeneralTransform3D.cs
- TextPenaltyModule.cs
- Lasso.cs
- TlsnegoTokenAuthenticator.cs
- XmlChildNodes.cs
- ConfigXmlCDataSection.cs
- CodeAttributeArgument.cs
- Part.cs
- FloaterBaseParaClient.cs
- ResourcePool.cs
- XmlIgnoreAttribute.cs
- BaseHashHelper.cs
- HebrewNumber.cs
- RegexTree.cs
- TypedDataSourceCodeGenerator.cs
- ListSortDescription.cs
- DataRowView.cs
- PopupControlService.cs
- ScrollContentPresenter.cs
- SignatureHelper.cs
- RSACryptoServiceProvider.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- PriorityQueue.cs
- SoapAttributes.cs
- JsonFormatGeneratorStatics.cs
- Html32TextWriter.cs
- AccessDataSource.cs
- MobilePage.cs
- CustomAttribute.cs
- QuaternionAnimation.cs
- TextEffect.cs
- TheQuery.cs
- DataGrid.cs
- PrintPreviewGraphics.cs
- RenderData.cs
- StorageComplexPropertyMapping.cs
- RepeatBehaviorConverter.cs
- DrawingAttributesDefaultValueFactory.cs
- SessionStateItemCollection.cs
- formatstringdialog.cs
- StandardToolWindows.cs
- TextParaLineResult.cs
- ProcessingInstructionAction.cs
- Transform3DGroup.cs
- Pts.cs
- BuilderInfo.cs
- MetadataArtifactLoaderResource.cs
- TreeViewImageIndexConverter.cs
- ErrorStyle.cs
- NameSpaceExtractor.cs
- TimersDescriptionAttribute.cs
- CompilationRelaxations.cs
- DefaultObjectMappingItemCollection.cs
- SecureStringHasher.cs
- shaperfactoryquerycachekey.cs
- XmlComplianceUtil.cs
- HostExecutionContextManager.cs
- ContainerParaClient.cs
- ToolStripItemImageRenderEventArgs.cs
- TextFormatterContext.cs
- TableLayoutColumnStyleCollection.cs
- CustomExpression.cs
- PrimitiveType.cs
- WMIInterop.cs
- ImageListStreamer.cs
- DrawingBrush.cs
- WebPartTracker.cs
- GenericRootAutomationPeer.cs
- BindingSource.cs
- BoolExpressionVisitors.cs
- ContainerSelectorGlyph.cs
- RawKeyboardInputReport.cs
- ReadOnlyDictionary.cs
- ParameterModifier.cs
- _DynamicWinsockMethods.cs
- ReflectionPermission.cs
- GeneralTransform3DTo2D.cs
- SelectionHighlightInfo.cs
- ToggleButtonAutomationPeer.cs
- SqlWebEventProvider.cs
- WebPartTracker.cs
- StringSorter.cs
- DesignerLinkAdapter.cs
- Screen.cs
- BaseDataBoundControl.cs
- TemplatePagerField.cs