Esempio n. 1
0
        public GenTextEditor(XmlNode xmlNod, string ctrlPath = "~/controls/TextEditor.ascx")
        {
            var oControl = LoadControl(ctrlPath);

            oControl = (Control)GenXmlFunctions.AssignByReflection(oControl, xmlNod);
            Controls.Add(oControl);
        }
Esempio n. 2
0
        public GenFileUpload(XmlNode xmlNod, string ctrlPath = "~/controls/filepickeruploader.ascx")
        {
            var oControl = LoadControl(ctrlPath);

            oControl = (Control)GenXmlFunctions.AssignByReflection(oControl, xmlNod);
            Controls.Add(oControl);
        }
Esempio n. 3
0
        public GenLabelControl(XmlNode xmlNod, string ctrlPath = "~/controls/LabelControl.ascx")
        {
            var oControl = (DotNetNuke.UI.UserControls.LabelControl)LoadControl(ctrlPath);

            oControl = (DotNetNuke.UI.UserControls.LabelControl)GenXmlFunctions.AssignByReflection(oControl, xmlNod);
            Controls.Add(oControl);
        }
Esempio n. 4
0
        private void CreateCaptcha(Control container, XmlNode xmlNod)
        {
            var rcap = new DotNetNuke.UI.WebControls.CaptchaControl();

            rcap              = (DotNetNuke.UI.WebControls.CaptchaControl)GenXmlFunctions.AssignByReflection(rcap, xmlNod);
            rcap.DataBinding += CaptchaControlDataBinding;
            container.Controls.Add(rcap);
        }
Esempio n. 5
0
        public override object PopulateGenObject(List <Control> genCtrls, object obj)
        {
            //check row exists (0 based)
            if (genCtrls.Count == 0)
            {
                return("");
            }

            var teCtrls = new List <Control>();
            var deCtrls = new List <Control>();

            //build list of controls
            foreach (var ctrl in genCtrls)
            {
                if (ctrl is GenTextEditor)
                {
                    teCtrls.Add(ctrl);
                }
                if (ctrl is GenDateControl)
                {
                    deCtrls.Add(ctrl);
                }
            }

            foreach (GenTextEditor gteCtrl in teCtrls)
            {
                if ((gteCtrl.Attributes["databind"] != null))
                {
                    obj = GenXmlFunctions.AssignByReflection(obj, gteCtrl.Attributes["databind"], gteCtrl.Text);
                }
            }

            foreach (GenDateControl dteCtrl in deCtrls)
            {
                if ((dteCtrl.Attributes["databind"] != null))
                {
                    obj = GenXmlFunctions.AssignByReflection(obj, dteCtrl.Attributes["databind"], dteCtrl.Value.ToString());
                }
            }

            return(obj);
        }
Esempio n. 6
0
        private void CreateCountryCheckBoxList(Control container, XmlNode xmlNod)
        {
            try
            {
                var cbl = new CheckBoxList();
                cbl = (CheckBoxList)GenXmlFunctions.AssignByReflection(cbl, xmlNod);
                var selected = false;
                if (xmlNod.Attributes != null && (xmlNod.Attributes["selected"] != null))
                {
                    if (xmlNod.Attributes["selected"].InnerText.ToLower() == "true")
                    {
                        selected = true;
                    }
                }

                var objCtrl = new DotNetNuke.Common.Lists.ListController();
                var tList   = objCtrl.GetListEntryInfoDictionary("Country");
                foreach (var tItem in tList)
                {
                    var li = new ListItem();
                    li.Text     = tItem.Value.Text;
                    li.Value    = tItem.Key;
                    li.Selected = selected;
                    cbl.Items.Add(li);
                }

                cbl.DataBinding += CbListDataBinding;
                container.Controls.Add(cbl);
            }
            catch (Exception e)
            {
                var lc = new Literal();
                lc.Text = e.ToString();
                container.Controls.Add(lc);
            }
        }