コード例 #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"));
        }
コード例 #2
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));
        }