DecimalConstantAttribute.cs 774 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // System.Runtime.CompilerServices.DecimalConstantAttribute.cs
  3. //
  4. // Author: Duncan Mak ([email protected])
  5. //
  6. // (C) Copyright, Ximian Inc.
  7. using System;
  8. namespace System.Runtime.CompilerServices {
  9. [Serializable] [CLSCompliant (false)]
  10. [AttributeUsage (AttributeTargets.Field | AttributeTargets.Parameter)]
  11. public sealed class DecimalConstantAttribute : Attribute
  12. {
  13. byte scale;
  14. bool sign;
  15. int hi;
  16. int mid;
  17. int low;
  18. public DecimalConstantAttribute (byte scale, byte sign, uint hi, uint mid, uint low)
  19. {
  20. this.scale = scale;
  21. this.sign = Convert.ToBoolean (sign);
  22. this.hi = (int) hi;
  23. this.mid = (int) mid;
  24. this.low = (int) low;
  25. }
  26. public Decimal Value {
  27. get { return new Decimal (low, mid, hi, sign, scale); }
  28. }
  29. }
  30. }