// Get the content string for the selected region. Called by the designer host
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion Region)
        {
            // Get a reference to the designer host
            System.ComponentModel.Design.IDesignerHost host = (System.ComponentModel.Design.IDesignerHost)(Component.Site.GetService(typeof(System.ComponentModel.Design.IDesignerHost)));

            if (host != null)
            {
                ITemplate template = null;
                switch (Region.Name)
                {
                case "FirstPanel":
                    template = Control.FirstPanel;
                    break;

                case "SecondPanel":
                    template = Control.SecondPanel;
                    break;
                }

                // Persist the template in the design host
                if (template != null)
                {
                    return(ControlPersister.PersistTemplate(template, host));
                }
            }

            return(string.Empty);
        }
Example #2
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null && region != null)
            {
                string[] parameters = region.Name.Split('_');

                if (parameters.Length == 2 && parameters[0] == "Body")
                {
                    int activeIndex = int.Parse(parameters[1]);

                    if (activeIndex >= 0)
                    {
                        ContentPanel panel = this.layout.Items[activeIndex] as ContentPanel;
                        if (panel != null)
                        {
                            ITemplate contentTemplate = panel.Body;

                            if (contentTemplate != null)
                            {
                                return(ControlPersister.PersistTemplate(contentTemplate, host));
                            }
                        }
                    }
                }
            }
            return(String.Empty);
        }
Example #3
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null && region != null)
            {
                string[] parameters = region.Name.Split('_');

                if (parameters.Length == 2 && parameters[0] == "Body")
                {
                    int activeIndex = int.Parse(parameters[1]);

                    if (activeIndex >= 0)
                    {
                        PanelBase tab = this.tabPanelControl.Items[activeIndex] as PanelBase;

                        if (tab != null && tab is IContent)
                        {
                            ITemplate contentTemplate = ((IContent)tab).Content;

                            if (contentTemplate != null)
                            {
                                return(ControlPersister.PersistTemplate(contentTemplate, host));
                            }
                        }
                    }
                }
            }

            return(String.Empty);
        }
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            ITemplate template = this.GetTemplate(this._changePassword);

            if (template == null)
            {
                return(this.GetEmptyDesignTimeHtml());
            }
            IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));

            return(ControlPersister.PersistTemplate(template, service));
        }
 public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
 {
     if (region is LoginViewDesignerRegion)
     {
         ITemplate template = ((LoginViewDesignerRegion)region).Template;
         if (template != null)
         {
             IDesignerHost service = (IDesignerHost)base.Component.Site.GetService(typeof(IDesignerHost));
             return(ControlPersister.PersistTemplate(template, service));
         }
     }
     return(base.GetEditableDesignerRegionContent(region));
 }
Example #6
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            var rldRegion = region as ReorderListDesignerRegion;

            if (rldRegion != null)
            {
                var template = rldRegion.Template;
                if (template != null)
                {
                    var host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));
                    return(ControlPersister.PersistTemplate(template, host));
                }
            }
            return(base.GetEditableDesignerRegionContent(region));
        }
Example #7
0
        /// <summary>
        /// 设置设计态的内容
        /// </summary>
        /// <param name="region"></param>
        /// <returns></returns>
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate contentTemplate;
                if (this.currentRegion == 0)
                {
                    contentTemplate = this.deluxeGrid.GridPagerTemplate;
                    return(ControlPersister.PersistTemplate(contentTemplate, host));
                }
            }
            return(String.Empty);
        }
Example #8
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate template = this.viewPort.Body;

                if (template != null && this.viewPort.Layout != null)
                {
                    return(ControlPersister.PersistTemplate(template, host));
                }
            }
            return(string.Empty);
        }
Example #9
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)this.Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                string[] parameters = region.Name.Split('_');

                if (parameters.Length == 3 && parameters[0] == "Body")
                {
                    BorderLayoutRegion layoutRegion = this.GetLayoutRegionByName(parameters[1]);

                    if (layoutRegion != null && layoutRegion.Items.Count > 0)
                    {
                        int      activeIndex  = int.Parse(parameters[2]);
                        IContent contentPanel = null;

                        if (layoutRegion.Items[0] is Panel)
                        {
                            contentPanel = layoutRegion.Items[0] as Panel;
                        }
                        else if (layoutRegion.Items[0] is TabPanel)
                        {
                            TabPanel tabPanel = layoutRegion.Items[0] as TabPanel;

                            if (activeIndex < tabPanel.Items.Count)
                            {
                                contentPanel = tabPanel.Items[activeIndex] as IContent;
                            }
                        }

                        if (contentPanel == null)
                        {
                            return("");
                        }

                        ITemplate contentTemplate = contentPanel.Content;

                        if (contentTemplate != null)
                        {
                            return(ControlPersister.PersistTemplate(contentTemplate, host));
                        }
                    }
                }
            }

            return("");
        }
Example #10
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate template = ((Component)this.Control).Content as ITemplate;

                if (template != null)
                {
                    return(ControlPersister.PersistTemplate(template, host));
                }
            }

            return("");
        }
Example #11
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            if (region is EntityRightsViewDesignerRegion)
            {
                var template = ((EntityRightsViewDesignerRegion)region).Template;

                if (template != null)
                {
                    var service = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

                    return(ControlPersister.PersistTemplate(template, service));
                }
            }

            return(base.GetEditableDesignerRegionContent(region));
        }
Example #12
0
        public override string GetEditableDesignerRegionContent(System.Web.UI.Design.EditableDesignerRegion Region)
        {
            IDesignerHost host = (IDesignerHost)(Component.Site.GetService(typeof(IDesignerHost)));

            if (host != null)
            {
                ITemplate template = Control.ContentTemplate;
                // Persist the template in the design host
                if (template != null)
                {
                    return(ControlPersister.PersistTemplate(template, host));
                }
            }

            return(string.Empty);
        }
Example #13
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)this.Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                string[] parameters = region.Name.Split('_');

                if (parameters.Length == 2 && parameters[0] == "Body" && this.fitLayout.Items.Count > 0)
                {
                    int          activeIndex  = int.Parse(parameters[1]);
                    ContentPanel contentPanel = null;

                    if (this.fitLayout.Items[0] is Panel)
                    {
                        contentPanel = this.fitLayout.Items[0] as Panel;
                    }
                    else if (this.fitLayout.Items[0] is TabPanel)
                    {
                        TabPanel tabPanel = this.fitLayout.Items[0] as TabPanel;

                        if (activeIndex < tabPanel.Tabs.Count)
                        {
                            contentPanel = tabPanel.Tabs[activeIndex];
                        }
                    }

                    if (contentPanel == null)
                    {
                        return(string.Empty);
                    }

                    ITemplate contentTemplate = contentPanel.Body;
                    if (contentTemplate != null)
                    {
                        return(ControlPersister.PersistTemplate(contentTemplate, host));
                    }
                }
            }
            return(string.Empty);
        }
Example #14
0
        // Get the content string for the selected region. Called by the designer host?
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            // Get a reference to the designer host
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate template = myControl.View1;
                if (region.Name == "Content1")
                {
                    template = myControl.View2;
                }

                // Persist the template in the design host
                if (template != null)
                {
                    return(ControlPersister.PersistTemplate(template, host));
                }
            }

            return(String.Empty);
        }
        // Get string value from template
        string PersistTemplate(ITemplate template)
        {
            var host = (IDesignerHost)GetService(typeof(IDesignerHost));

            return(ControlPersister.PersistTemplate(template, host));
        }
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));

            return(ControlPersister.PersistTemplate(this._login.LayoutTemplate, service));
        }
 public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
 {
     return(ControlPersister.PersistTemplate(this._zone.ZoneTemplate, (IDesignerHost)base.Component.Site.GetService(typeof(IDesignerHost))));
 }