TemplatedControlDesigner.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //
  2. // System.Web.UI.Design.TemplatedControlDesigner
  3. //
  4. // Authors:
  5. // Gert Driesen ([email protected])
  6. //
  7. // (C) 2004 Novell
  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. using System;
  30. using System.Collections;
  31. using System.ComponentModel.Design;
  32. namespace System.Web.UI.Design
  33. {
  34. public abstract class TemplatedControlDesigner : ControlDesigner
  35. {
  36. public TemplatedControlDesigner ()
  37. {
  38. }
  39. protected abstract ITemplateEditingFrame CreateTemplateEditingFrame (TemplateEditingVerb verb);
  40. protected abstract TemplateEditingVerb[] GetCachedTemplateEditingVerbs ();
  41. public abstract string GetTemplateContent (ITemplateEditingFrame editingFrame, string templateName, out bool allowEditing);
  42. public abstract void SetTemplateContent (ITemplateEditingFrame editingFrame, string templateName, string templateContent);
  43. [MonoTODO]
  44. public void EnterTemplateMode (ITemplateEditingFrame newTemplateEditingFrame)
  45. {
  46. throw new NotImplementedException ();
  47. }
  48. [MonoTODO]
  49. public void ExitTemplateMode (bool fSwitchingTemplates, bool fNested, bool fSave)
  50. {
  51. throw new NotImplementedException ();
  52. }
  53. [MonoTODO]
  54. public override string GetPersistInnerHtml ()
  55. {
  56. throw new NotImplementedException ();
  57. }
  58. public virtual string GetTemplateContainerDataItemProperty (string templateName)
  59. {
  60. return string.Empty;
  61. }
  62. public virtual IEnumerable GetTemplateContainerDataSource (string templateName)
  63. {
  64. return null;
  65. }
  66. [MonoTODO]
  67. public TemplateEditingVerb[] GetTemplateEditingVerbs ()
  68. {
  69. throw new NotImplementedException ();
  70. }
  71. [MonoTODO]
  72. protected ITemplate GetTemplateFromText (string text)
  73. {
  74. throw new NotImplementedException ();
  75. }
  76. public virtual Type GetTemplatePropertyParentType (string templateName)
  77. {
  78. return base.Component.GetType ();
  79. }
  80. [MonoTODO]
  81. protected string GetTextFromTemplate (ITemplate template)
  82. {
  83. throw new NotImplementedException ();
  84. }
  85. [MonoTODO]
  86. protected override void OnBehaviorAttached ()
  87. {
  88. throw new NotImplementedException ();
  89. }
  90. [MonoTODO]
  91. public override void OnComponentChanged (object sender, ComponentChangedEventArgs ce)
  92. {
  93. throw new NotImplementedException ();
  94. }
  95. [MonoTODO]
  96. public override void OnSetParent ()
  97. {
  98. throw new NotImplementedException ();
  99. }
  100. [MonoTODO]
  101. protected virtual void OnTemplateModeChanged ()
  102. {
  103. throw new NotImplementedException ();
  104. }
  105. [MonoTODO]
  106. protected override void PreFilterProperties (IDictionary properties)
  107. {
  108. throw new NotImplementedException ();
  109. }
  110. [MonoTODO]
  111. protected void SaveActiveTemplateEditingFrame ()
  112. {
  113. throw new NotImplementedException ();
  114. }
  115. [MonoTODO]
  116. public override void UpdateDesignTimeHtml ()
  117. {
  118. throw new NotImplementedException ();
  119. }
  120. public ITemplateEditingFrame ActiveTemplateEditingFrame {
  121. get {
  122. return _activeTemplateFrame;
  123. }
  124. }
  125. public bool CanEnterTemplateMode {
  126. get {
  127. return _enableTemplateEditing;
  128. }
  129. }
  130. protected virtual bool HidePropertiesInTemplateMode {
  131. get {
  132. return true;
  133. }
  134. }
  135. public bool InTemplateMode {
  136. get {
  137. return _templateMode;
  138. }
  139. }
  140. internal EventHandler TemplateEditingVerbHandler {
  141. get {
  142. return _templateVerbHandler;
  143. }
  144. }
  145. private ITemplateEditingFrame _activeTemplateFrame;
  146. private bool _enableTemplateEditing = true;
  147. private bool _templateMode;
  148. private EventHandler _templateVerbHandler;
  149. }
  150. }