PageRenderTime 56ms CodeModel.GetById 7ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/widgets/Month List/widget.ascx.cs

#
C# | 66 lines | 36 code | 12 blank | 18 comment | 4 complexity | 2b718e4c9b4db3646f5b79143ad1711b MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <summary>
  3. // The widget.
  4. // </summary>
  5. // --------------------------------------------------------------------------------------------------------------------
  6. namespace Widgets.MonthList
  7. {
  8. using System.Collections.Specialized;
  9. using App_Code.Controls;
  10. /// <summary>
  11. /// The widget.
  12. /// </summary>
  13. public partial class Widget : WidgetBase
  14. {
  15. #region Properties
  16. /// <summary>
  17. /// Gets a value indicating whether the Widget is editable.
  18. /// </summary>
  19. public override bool IsEditable
  20. {
  21. get { return true; }
  22. }
  23. /// <summary>
  24. /// Gets the Widget name.
  25. /// </summary>
  26. public override string Name
  27. {
  28. get { return "Month List"; }
  29. }
  30. #endregion
  31. #region Public Methods
  32. /// <summary>
  33. /// This method works as a substitute for Page_Load. You should use this method for
  34. /// data binding etc. instead of Page_Load.
  35. /// </summary>
  36. public override void LoadWidget()
  37. {
  38. StringDictionary settings = GetSettings();
  39. if (settings.ContainsKey("groupbyyear"))
  40. {
  41. bool aGroupByYear = true;
  42. if (bool.TryParse(settings["groupbyyear"], out aGroupByYear))
  43. ctlMonthList.GroupByYear = aGroupByYear;
  44. }
  45. if (settings.ContainsKey("recentdatesattop"))
  46. {
  47. bool aRecentDatesAtTop = false;
  48. if (bool.TryParse(settings["recentdatesattop"], out aRecentDatesAtTop))
  49. ctlMonthList.RecentDatesAtTop = aRecentDatesAtTop;
  50. }
  51. }
  52. #endregion
  53. }
  54. }