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