public override Control DataEditorControls(XmlNode xml, Dictionary<string, object> properties)
        {
            //properties should be multiType properties ie. Name, Description, Mandatory, Validation
            Panel pnlDataEditor = new Panel();

            Label lblDataEditor = new Label() { Text = properties["Name"].ToString() };
            Literal litDescription = new Literal() { Text = properties["Description"].ToString() };

            dtpDataEditor = new umbraco.uicontrols.DatePicker.DateTimePicker();

            if (properties.ContainsKey("ShowTime"))
            {
                boolShowTime = bool.Parse(properties["ShowTime"].ToString());
                dtpDataEditor.ShowTime = boolShowTime;
            }

            if (xml != null)
            {
                //Anything special about the xml? no - just do innertext
                dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText);
            }
            
            pnlDataEditor.Controls.Add(lblDataEditor);
            pnlDataEditor.Controls.Add(litDescription);
            pnlDataEditor.Controls.Add(dtpDataEditor);

            if (xml != null)
            {
                //Anything special about the xml? no - just do innertext
                dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText);
            }

            return pnlDataEditor;
        }
Esempio n. 2
0
        /// <summary>
        /// Creates the child controls for this control
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            this.DatePicker = new DateTimePicker();
            this.DatePicker.ID = string.Concat(this.ID, "multipleDates");
            this.Controls.Add(this.DatePicker);

            this.Controls.Add(this.SelectedValues);
        }
Esempio n. 3
0
        public override Control DataEditorControls(XmlNode xml, Dictionary <string, object> properties)
        {
            //properties should be multiType properties ie. Name, Description, Mandatory, Validation
            Panel pnlDataEditor = new Panel();

            Label lblDataEditor = new Label()
            {
                Text = properties["Name"].ToString()
            };
            Literal litDescription = new Literal()
            {
                Text = properties["Description"].ToString()
            };

            dtpDataEditor = new umbraco.uicontrols.DatePicker.DateTimePicker();

            if (properties.ContainsKey("ShowTime"))
            {
                boolShowTime           = bool.Parse(properties["ShowTime"].ToString());
                dtpDataEditor.ShowTime = boolShowTime;
            }

            if (xml != null)
            {
                //Anything special about the xml? no - just do innertext
                dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText);
            }

            pnlDataEditor.Controls.Add(lblDataEditor);
            pnlDataEditor.Controls.Add(litDescription);
            pnlDataEditor.Controls.Add(dtpDataEditor);

            if (xml != null)
            {
                //Anything special about the xml? no - just do innertext
                dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText);
            }

            return(pnlDataEditor);
        }