Example #1
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            if (this.IAmEditor)
            {

                this.lnkButton = new ImageLinkButton();
                //this.lnkButton.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(EditButton), @"Inventio.Engine.Resources.img.icon_edit_page.png");
                if (!string.IsNullOrWhiteSpace(icon))
                {
                    this.lnkButton.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), icon);
                }

                if (caption != null)
                {
                    if (caption.Length > 1)
                    {
                        //this.lnkButton.Text = this.EditMode ? "Terminar edición" : "Editar página";
                        this.lnkButton.Text = this.EditMode ? caption[0] : caption[1];
                    }
                    else
                    {
                        this.lnkButton.Text = caption[0];
                    }
                }
                this.lnkButton.Click += new EventHandler(lnkButton_Click);
                this.Controls.Add(this.lnkButton);

            }
        }
        protected override void CreateChildControls()
        {
            //base.CreateChildControls();
            lnkAnadir = new ImageLinkButton();
            lnkAnadir.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(ContainerRibbon), "Inventio.Engine.Resources.img.cambiar.png");
            lnkAnadir.ImageWidth = new Unit(16, UnitType.Pixel);
            lnkAnadir.Text = "Cambiar gadget";
            lnkAnadir.Click += new EventHandler(btnAnadir_Click);
            //ButtonHelper.CreateButton(ref btnAnadir, "Seleccionar Gadget", btnAnadir_click);
            this.Controls.Add(this.lnkAnadir);

            this.PanelGadgets = new Panel();
            this.PanelGadgets.CssClass = "ListaGadgets";
            radList = new RadioButtonList();
            this.PanelGadgets.Controls.Add(radList);

            lnkAceptar = new ImageLinkButton();
            lnkAceptar.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(ContainerRibbon), "Inventio.Engine.Resources.img.ok.gif");
            lnkAceptar.ImageWidth = new Unit(16, UnitType.Pixel);
            lnkAceptar.Text = "Aceptar";
            lnkAceptar.Click += new EventHandler(lnkAceptar_Click);
            this.PanelGadgets.Controls.Add(this.lnkAceptar);

            lnkCancelar = new ImageLinkButton();
            lnkCancelar.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(ContainerRibbon), "Inventio.Engine.Resources.img.cancel.png");
            lnkCancelar.ImageWidth = new Unit(16, UnitType.Pixel);
            lnkCancelar.Text = "Cancelar";
            lnkCancelar.Click += new EventHandler(lnkCancelar_Click);
            this.PanelGadgets.Controls.Add(this.lnkCancelar);

            this.Controls.Add(this.PanelGadgets);
        }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            if (this.IAmEditor)
            {
                this.lnkButton = new ImageLinkButton();
                this.lnkButton.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(EditButton), @"Inventio.Engine.Resources.img.cancel.png");
                this.lnkButton.Text = "Salir";
                this.lnkButton.Click += new EventHandler(lnkButton_Click);
                this.Controls.Add(this.lnkButton);
            }
        }
Example #4
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            if (this.IAmEditor)
            {

                this.lnkButton = new ImageLinkButton();
                this.lnkButton.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(EditButton), @"Inventio.Engine.Resources.img.icon_edit_page.png");
                this.lnkButton.Text = this.EditMode ? "Terminar edición" : "Editar página";
                this.lnkButton.Click += new EventHandler(lnkButton_Click);
                this.Controls.Add(this.lnkButton);

            }
        }
        protected void CreateControls()
        {
            this.Controls.Clear();

            //this.DataSource = ContainerDAL.GetContainerByIdContainer(this.IdContainer);
            this.DataSource = WidGetDAL.GetWidGetsByIdContainer(this.IdContainer);

            WidGet widget = null;

            if (this.DataSource != null && this.DataSource.Count > 0)
            {

                widget = this.DataSource[0]; // TODO más de un widget por container
                //Container container = this.DataSource[0];

                //gadget = (Gadget)Activator.CreateInstance(Type.GetType(container.Type));
                //gadget.ID = string.Format("GADGET_{0}_{1}", container.IdContainer, container.ID);
                //gadget.EditMode = this.EditMode;
                //gadget.IdContainer = container.IdContainer;
                gadget = (Gadget)Activator.CreateInstance(Type.GetType(widget.Type));
                gadget.ID = string.Format("GADGET_{0}_{1}", widget.IdContainer, widget.ID);

                gadget.Keys = new WidgetKeys(widget.ID, widget.IdContainer, widget.Type, 0); //TODO POS
                gadget.DataXML = widget.Data;

                gadget.EditMode = this.EditMode;

                this.Controls.Add(gadget);

                if (this.EditMode)
                {
                    JQueryManager jman = new JQueryManager();
                    jman.RegisterJQuerys(this.Page);
                }

            }

            if (this.EditMode)
            {
                TopRibbon = new ContainerRibbon(this.IdContainer, widget != null ? widget.ID : (Nullable<int>) null);
                TopRibbon.AddGadget += new GadgetContainerEventHandler(TopRibbon_AddGadget);
                this.Controls.Add(TopRibbon);
            }

            if (this.PageEditMode)
            {
                btnEditar = new ImageLinkButton();
                string texto = this.EditMode ? "Detener Edicion" : "Editar";
                btnEditar.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(GadgetContainer), "Inventio.Engine.Resources.img.engine.png");
                btnEditar.ImageWidth = new Unit(16, UnitType.Pixel);
                btnEditar.Text = texto;
                btnEditar.Click += new EventHandler(btnEditar_Click);
                this.Controls.Add(btnEditar);
            }
        }