Beispiel #1
0
        public override void SetEditableDesignerRegionContent(EditableDesignerRegion region, string content)
        {
            if (region == null)
            {
                throw new ArgumentNullException("region");
            }

            string regionName = region.Name;

            Debug.Assert(regionName[0] == 'c' || regionName[0] == 'h', "Expected regionName to start with c or h, not " + regionName);

            bool setTabContent = regionName[0] == 'c';

            regionName = regionName.Substring(1);

            // figure out which tab we have.
            TabPanel activeTab = (TabPanel)TabContainer.FindControl(regionName);

            Debug.Assert(activeTab != null, "Couldn't find tab " + regionName);


            IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));

            Debug.Assert(host != null, "Failed to get IDesignerHost?!?");

            // push the content into the right template
            PersistTemplateContent(activeTab, host, content, (setTabContent ? "ContentTemplate" : "HeaderTemplate"));
        }
        protected void SelectTab(TabContainer tabContainer, string TabID)
        {
            if (tabContainer == null)
                throw new ArgumentNullException("tabContainer");

            if (!String.IsNullOrEmpty(TabID))
            {
                AjaxControlToolkit.TabPanel tab = tabContainer.FindControl(TabID) as AjaxControlToolkit.TabPanel;
                if (tab != null)
                {
                    tabContainer.ActiveTab = tab;
                }
            }
        }
Beispiel #3
0
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            if (region == null)
            {
                throw new ArgumentNullException("region");
            }

            string regionName = region.Name;

            Debug.Assert(regionName[0] == 'c' || regionName[0] == 'h', "Expected regionName to start with c or h, not " + regionName);

            // is it a content template or a header?
            //
            bool content = regionName[0] == 'c';

            regionName = regionName.Substring(1);

            TabPanel activeTab = (TabPanel)TabContainer.FindControl(regionName);

            Debug.Assert(activeTab != null, "Couldn't find tab " + regionName);

            return(GetTabContent(activeTab, content));
        }
        public void CreateImageControls(TabContainer oTabContainer)
        {
            //Image
            Hashtable oImageList = (Hashtable)Session[FormDesign.SessionImageList];
            if (oImageList != null)
            {
                foreach (object sKey in oImageList.Keys)
                {
                    if (oImageList.ContainsKey(sKey))
                    {

                        DesignFormField oItem = (DesignFormField)oImageList[sKey];

                        DesignFormTab oTab = DesignFormTab.Load<DesignFormTab>(oItem.TabID);
                        if (oTab != null)
                        {
                            TabPanel oPanel = (TabPanel)oTabContainer.FindControl(oTab.SysIdentity);
                            FormDesign oFrmDesign = new FormDesign();

                            UserControl oUserControl = (UserControl)LoadControl("~/" + FormDesign.ctrFormDesignImageControl);
                            // UserControl oUserControl = (UserControl)oPanel.FindControl(oItem.ColumnName);
                            oUserControl.ID = oItem.Name;
                            if (oUserControl != null)
                            {
                                ucImageControl oImageControl =
                                    (ucImageControl)oUserControl;
                                oImageControl.width = Convert.ToInt32(oItem.Width);
                                oImageControl.Height = Convert.ToInt32(oItem.Height);
                                //   oImageControl.EnlargeImageClientID = EnlargeClientID;
                                if (oItem.IsMandatory == true)
                                {
                                    oImageControl.IsEnlarge = true;
                                }
                                else
                                {
                                    oImageControl.IsEnlarge = false;
                                }
                                // permssion to set up
                                int num;
                                oImageControl.IsAllowFileUpload = true;
                                String cssStyle = string.Empty;
                                bool IsTop = int.TryParse(oItem.ControlTop.ToString(), out num);
                                if (IsTop == true)
                                {
                                    cssStyle = FormDesign.ccsRelative + FormDesign.ccsTop + num.ToString() + FormDesign.ccsPX;
                                    // oDDL.Attributes.Add(AppConstManager.cStyle, AppConstManager.ccsRelative);
                                    // oDDL.Attributes.Add(AppConstManager.cStyle, num.ToString() + AppConstManager.ccsPX);
                                }
                                bool IsLeft = int.TryParse(oItem.ControlLeft.ToString(), out num);
                                if (IsLeft == true)
                                {
                                    cssStyle = cssStyle + FormDesign.ccsLeft + num.ToString() + FormDesign.ccsPX;
                                    //oDDL.Attributes.Add(AppConstManager.cStyle, AppConstManager.ccsLeft + num.ToString() + AppConstManager.ccsPX);
                                }

                                FormDesign oDesign = new FormDesign();

                                if (oItem.WithLabel)
                                {
                                    oDesign.SetControlLabel(oPanel, oItem, eFormID);
                                }
                                LiteralControl oLiteral = new LiteralControl();
                                oLiteral.Text = "<Div id=\"DIV" + oImageControl.ID + "\" Style=\" display:block;visibility:visible;" + cssStyle + "\">";
                                // oLabel.Attributes.Add(AppConstManager.cStyle, cssStyle);
                                oPanel.Controls.Add(oLiteral);

                                oPanel.Controls.Add(oImageControl);
                                LiteralControl oEndLiteral = new LiteralControl();
                                oEndLiteral.Text = "</Div>";
                                oPanel.Controls.Add(oEndLiteral);
                            }
                        }

                    }

                }
            }

            Session[FormDesign.SessionImageList] = null;
        }