SqlUserDefinedAggregateAttribute.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //
  2. // Microsoft.SqlServer.Server.SqlUserDefinedAggregateAttribute
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Umadevi S ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2003
  9. //
  10. //
  11. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  12. //
  13. // Permission is hereby granted, free of charge, to any person obtaining
  14. // a copy of this software and associated documentation files (the
  15. // "Software"), to deal in the Software without restriction, including
  16. // without limitation the rights to use, copy, modify, merge, publish,
  17. // distribute, sublicense, and/or sell copies of the Software, and to
  18. // permit persons to whom the Software is furnished to do so, subject to
  19. // the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be
  22. // included in all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  28. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  29. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  30. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  31. //
  32. #if NET_2_0
  33. using System;
  34. namespace Microsoft.SqlServer.Server {
  35. [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
  36. public sealed class SqlUserDefinedAggregateAttribute : Attribute
  37. {
  38. #region Fields
  39. public const int MaxByteSizeValue = 8000;
  40. Format format;
  41. bool isInvariantToDuplicates;
  42. bool isInvariantToNulls;
  43. bool isInvariantToOrder;
  44. bool isNullIfEmpty;
  45. int maxByteSize;
  46. #endregion // Fields
  47. #region Constructors
  48. public SqlUserDefinedAggregateAttribute (Format f)
  49. {
  50. Format = f;
  51. IsInvariantToDuplicates = false;
  52. IsInvariantToNulls = false;
  53. IsInvariantToOrder = false;
  54. IsNullIfEmpty = false;
  55. MaxByteSize = MaxByteSizeValue;
  56. }
  57. #endregion // Constructors
  58. #region Properties
  59. public Format Format {
  60. get { return format; }
  61. set { format = value; }
  62. }
  63. public bool IsInvariantToDuplicates {
  64. get { return isInvariantToDuplicates; }
  65. set { isInvariantToDuplicates = value; }
  66. }
  67. public bool IsInvariantToNulls {
  68. get { return isInvariantToNulls; }
  69. set { isInvariantToNulls = value; }
  70. }
  71. public bool IsInvariantToOrder {
  72. get { return isInvariantToOrder; }
  73. set { isInvariantToOrder = value; }
  74. }
  75. public bool IsNullIfEmpty {
  76. get { return isNullIfEmpty; }
  77. set { isNullIfEmpty = value; }
  78. }
  79. public int MaxByteSize {
  80. get { return maxByteSize; }
  81. set { maxByteSize = value; }
  82. }
  83. #endregion // Properties
  84. }
  85. }
  86. #endif