WebPartVerb.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. //
  2. // System.Web.UI.WebControls.WebParts.WebPartVerb.cs
  3. //
  4. // Authors:
  5. // Sanjay Gupta ([email protected])
  6. //
  7. // (C) 2004 Novell, Inc (http://www.novell.com)
  8. //
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. //
  29. #if NET_2_0
  30. using System.Web.UI;
  31. namespace System.Web.UI.WebControls.WebParts
  32. {
  33. public class WebPartVerb : IStateManager
  34. {
  35. private string clientClickHandler;
  36. private WebPartEventHandler serverClickHandler;
  37. private StateBag stateBag;
  38. private bool isChecked = false;
  39. private string description = string.Empty;
  40. private bool enabled = true;
  41. private string imageUrl = string.Empty;
  42. private string text = string.Empty;
  43. private bool visible = true;
  44. public WebPartVerb (string clientHandler)
  45. {
  46. this.clientClickHandler = clientHandler;
  47. stateBag = new StateBag ();
  48. stateBag.Add ("clientClickHandler", clientHandler);
  49. }
  50. public WebPartVerb (WebPartEventHandler serverHandler)
  51. {
  52. this.serverClickHandler = serverHandler;
  53. stateBag = new StateBag ();
  54. stateBag.Add ("serverClickHandler", serverHandler);
  55. }
  56. public WebPartVerb (WebPartEventHandler serverHandler, string clientHandler)
  57. {
  58. this.serverClickHandler = serverHandler;
  59. this.clientClickHandler = clientHandler;
  60. stateBag = new StateBag ();
  61. stateBag.Add ("serverClickHandler", serverHandler);
  62. stateBag.Add ("clientClickHandler", clientHandler);
  63. }
  64. [MonoTODO]
  65. protected virtual void LoadViewState (object savedState)
  66. {
  67. throw new NotImplementedException ();
  68. }
  69. [MonoTODO]
  70. protected virtual object SaveViewState()
  71. {
  72. throw new NotImplementedException ();
  73. }
  74. [MonoTODO]
  75. protected virtual void TrackViewState()
  76. {
  77. throw new NotImplementedException();
  78. }
  79. [MonoTODO]
  80. void IStateManager.LoadViewState (object savedState)
  81. {
  82. throw new NotImplementedException ();
  83. }
  84. [MonoTODO]
  85. object IStateManager.SaveViewState ()
  86. {
  87. throw new NotImplementedException ();
  88. }
  89. [MonoTODO]
  90. void IStateManager.TrackViewState ()
  91. {
  92. throw new NotImplementedException ();
  93. }
  94. [MonoTODO]
  95. bool IStateManager.get_IsTrackingViewState ()
  96. {
  97. throw new NotImplementedException ();
  98. }
  99. public virtual bool Checked {
  100. get { return isChecked; }
  101. set { isChecked = value; }
  102. }
  103. public string ClientClickHandler {
  104. get { return clientClickHandler; }
  105. }
  106. public virtual string Description {
  107. get { return description; }
  108. set { description = value; }
  109. }
  110. public virtual bool Enabled {
  111. get { return enabled; }
  112. set { enabled = value; }
  113. }
  114. public string ImageUrl {
  115. get { return imageUrl; }
  116. set { imageUrl = value; }
  117. }
  118. protected virtual bool IsTrackingViewState {
  119. get { throw new NotImplementedException (); }
  120. }
  121. public WebPartEventHandler ServerClickHandler {
  122. get { return serverClickHandler; }
  123. }
  124. public virtual string Text {
  125. get { return text; }
  126. set { text = value; }
  127. }
  128. protected StateBag ViewState {
  129. get { return stateBag; }
  130. }
  131. public bool Visible {
  132. get { return visible; }
  133. set { visible = value; }
  134. }
  135. }
  136. }
  137. #endif