DbDataPermissionAttribute.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // System.Data.Common.DbDataPermissionAttribute.cs
  3. //
  4. // Authors:
  5. // Rodrigo Moya ([email protected])
  6. // Tim Coleman ([email protected])
  7. //
  8. // (C) Ximian, Inc
  9. // Copyright (C) Tim Coleman, 2002
  10. //
  11. using System;
  12. using System.Security.Permissions;
  13. namespace System.Data.Common {
  14. [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method)]
  15. [Serializable]
  16. public abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute
  17. {
  18. #region Fields
  19. SecurityAction securityAction;
  20. bool allowBlankPassword;
  21. #if NET_1_1
  22. KeyRestrictionBehavior keyRestrictionBehavior;
  23. String connectionString;
  24. #endif
  25. #endregion // Fields
  26. #region Constructors
  27. protected DBDataPermissionAttribute (SecurityAction action)
  28. : base (action)
  29. {
  30. securityAction = action;
  31. allowBlankPassword = false;
  32. }
  33. #endregion // Constructors
  34. #region Properties
  35. public bool AllowBlankPassword {
  36. get { return allowBlankPassword; }
  37. set { allowBlankPassword = value; }
  38. }
  39. #if NET_1_1
  40. public String ConnectionString {
  41. get { return connectionString; }
  42. set { connectionString = value; }
  43. }
  44. public KeyRestrictionBehavior KeyRestrictionBehavior {
  45. get { return keyRestrictionBehavior; }
  46. set { keyRestrictionBehavior = value; }
  47. }
  48. #endif
  49. #endregion // Properties
  50. #region // Methods
  51. #if NET_1_2
  52. [MonoTODO]
  53. public bool ShouldSerializeConnectionString ()
  54. {
  55. throw new NotImplementedException ();
  56. }
  57. [MonoTODO]
  58. public bool ShouldSerializeKeyRestrictions ()
  59. {
  60. throw new NotImplementedException ();
  61. }
  62. #endif
  63. #endregion // Methods
  64. }
  65. }