PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/widgets/TextBox/widget.ascx.cs

#
C# | 69 lines | 36 code | 10 blank | 23 comment | 1 complexity | 39751647b3402aeabc4fc1f081e1891e MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <summary>
  3. // TextBox widget
  4. // </summary>
  5. // --------------------------------------------------------------------------------------------------------------------
  6. namespace Widgets.TextBox
  7. {
  8. using System.Web.UI;
  9. using App_Code.Controls;
  10. /// <summary>
  11. /// TextBox widget
  12. /// </summary>
  13. public partial class Widget : WidgetBase
  14. {
  15. #region Properties
  16. /// <summary>
  17. /// Gets wether or not the widget can be edited.
  18. /// <remarks>
  19. /// The only way a widget can be editable is by adding a edit.ascx file to the widget folder.
  20. /// </remarks>
  21. /// </summary>
  22. /// <value></value>
  23. public override bool IsEditable
  24. {
  25. get
  26. {
  27. return true;
  28. }
  29. }
  30. /// <summary>
  31. /// Gets the name. It must be exactly the same as the folder that contains the widget.
  32. /// </summary>
  33. /// <value></value>
  34. public override string Name
  35. {
  36. get
  37. {
  38. return "TextBox";
  39. }
  40. }
  41. #endregion
  42. #region Public Methods
  43. /// <summary>
  44. /// This method works as a substitute for Page_Load. You should use this method for
  45. /// data binding etc. instead of Page_Load.
  46. /// </summary>
  47. public override void LoadWidget()
  48. {
  49. var settings = this.GetSettings();
  50. if (!settings.ContainsKey("content"))
  51. {
  52. return;
  53. }
  54. var text = new LiteralControl(settings["content"]);
  55. this.Controls.Add(text);
  56. }
  57. #endregion
  58. }
  59. }