當前位置: 首頁>>代碼示例>>C#>>正文


C# Design.EditableDesignerRegion類代碼示例

本文整理匯總了C#中System.Web.UI.Design.EditableDesignerRegion的典型用法代碼示例。如果您正苦於以下問題:C# EditableDesignerRegion類的具體用法?C# EditableDesignerRegion怎麽用?C# EditableDesignerRegion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EditableDesignerRegion類屬於System.Web.UI.Design命名空間,在下文中一共展示了EditableDesignerRegion類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetEditableDesignerRegionContent

        public override void SetEditableDesignerRegionContent(EditableDesignerRegion region, string content)
        {
            int regionIndex = Int32.Parse(region.Name.Substring(7));

            if (content == null)
            {
                if (regionIndex == 0)
                    myControl.View1 = null;
                else if (regionIndex == 1)
                    myControl.View2 = null;
                return;
            }

            IDesignerHost host =
                (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate template = ControlParser.ParseTemplate(host, content);

                if (template != null)
                {
                    if (regionIndex == 0)
                        myControl.View1 = template;
                    else if (regionIndex == 1)
                        myControl.View2 = template;
                }
            }
        }
開發者ID:netatomy,項目名稱:LearningNet,代碼行數:29,代碼來源:Listing26-43.cs

示例2: GetDesignTimeHtml

        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            this.CreateChildControls();

            for (int i = 0; i < _nbRegions; i++)
            {

                DesignerRegion r;

                if (_currentRegion == i)

                    r = new EditableDesignerRegion(this, i.ToString());

                else

                    r = new DesignerRegion(this, i.ToString());

                regions.Add(r);

            }

            if ((_currentRegion >= 0) && (_currentRegion < _nbRegions))

                regions[_currentRegion].Highlight = true;

            return base.GetDesignTimeHtml(regions);
        }
開發者ID:Ghostxx7Org,項目名稱:EShop,代碼行數:27,代碼來源:TitledBoxDisigner.cs

示例3: GetDesignTimeHtml

        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            string title = CurrentControl.Title;
            if (String.IsNullOrEmpty(title))
            {
                title = String.Format("[{0}]", CurrentControl.ID);
            }

            EditableDesignerRegion itemsRegion = new EditableDesignerRegion(this, "Items", true);
            regions.Add(itemsRegion);

            string itemsContent = String.Format("<div style=\"border:solid 1px #ccc;\"><div style=\"font-size:11px;background-color:#ddd;\">Items</div><div style=\"padding:2px;\" {0}=\"{1}\">{2}</div></div>",
                DesignerRegion.DesignerRegionAttributeName, "0", GetEditableDesignerRegionContent(itemsRegion));


            string toolbarsContent = "";

            if (CurrentControl.Toolbars.Count > 0)
            {
                EditableDesignerRegion toolbarsRegion = new EditableDesignerRegion(this, "Toolbars", true);
                regions.Add(toolbarsRegion);

                toolbarsContent = String.Format("<div style=\"border:solid 1px #ccc;margin-bottom:5px;\"><div style=\"font-size:11px;background-color:#ddd;\">Toolbars</div><div style=\"padding:2px;\" {0}=\"{1}\">{2}</div></div>",
                    DesignerRegion.DesignerRegionAttributeName, "1", GetEditableDesignerRegionContent(toolbarsRegion));
            }
            
            return String.Format(TEMPLATE, title, toolbarsContent, itemsContent);
        }
開發者ID:g992com,項目名稱:esb,代碼行數:28,代碼來源:SimpleFormDesigner.cs

示例4: GetDesignTimeHtml

 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     EditableDesignerRegion region = new EditableDesignerRegion(this, "Text") {
         Description = System.Design.SR.GetString("LocalizeDesigner_RegionWatermark")
     };
     region.Properties[typeof(Control)] = base.Component;
     regions.Add(region);
     return string.Format(CultureInfo.InvariantCulture, "<span {0}=0></span>", new object[] { DesignerRegion.DesignerRegionAttributeName });
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:LocalizeDesigner.cs

示例5: GetDesignTimeHtml

 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     EditableDesignerRegion region = new EditableDesignerRegion(this, "Content");
     regions.Add(region);
     Font captionFont = SystemFonts.CaptionFont;
     Color controlText = SystemColors.ControlText;
     Color control = SystemColors.Control;
     string str = base.Component.GetType().Name + " - " + base.Component.Site.Name;
     return string.Format(CultureInfo.InvariantCulture, "<table cellspacing=0 cellpadding=0 style=\"border:1px solid black; width:100%; height:200px\">\r\n            <tr>\r\n              <td style=\"width:100%; height:25px; font-family:Tahoma; font-size:{2}pt; color:{3}; background-color:{4}; padding:5px; border-bottom:1px solid black;\">\r\n                &nbsp;{0}\r\n              </td>\r\n            </tr>\r\n            <tr>\r\n              <td style=\"width:100%; height:175px; vertical-align:top;\" {1}=\"0\">\r\n              </td>\r\n            </tr>\r\n          </table>", new object[] { str, DesignerRegion.DesignerRegionAttributeName, captionFont.SizeInPoints, ColorTranslator.ToHtml(controlText), ColorTranslator.ToHtml(control) });
 }
開發者ID:Reegenerator,項目名稱:Sample-CustomizeDatasetCS,代碼行數:10,代碼來源:ContentDesigner.cs

示例6: GetDesignTimeHtml

        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            EditableDesignerRegion editableRegion = new EditableDesignerRegion(this, "Content", true);
            regions.Add(editableRegion);

            string content = String.Format("<div {0}='{1}'>{2}</div>",
                DesignerRegion.DesignerRegionAttributeName, 0, GetEditableDesignerRegionContent(editableRegion));

            return content;
        }
開發者ID:g992com,項目名稱:esb,代碼行數:10,代碼來源:ToolbarDesigner.cs

示例7: GetEditableDesignerRegionContent

 public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
 {
     IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));
     if (host != null)
     {
         ITemplate template = (region.Name == String.Concat(DesignerRegion.DesignerRegionAttributeName, "0")) ? _Control.FirstTemplate : _Control.SecondTemplate;
         if (template != null)
             return ControlPersister.PersistTemplate(template, host);
     }
     return String.Empty;
 }
開發者ID:cstruter,項目名稱:ASPNetDemoTemplateControl,代碼行數:11,代碼來源:CustomTemplateDesigner.cs

示例8: GetEditableDesignerRegionContent

 public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
 {
     if (this._content == null)
     {
         this._content = base.Tag.GetContent();
     }
     if (this._content == null)
     {
         return string.Empty;
     }
     return this._content;
 }
開發者ID:Reegenerator,項目名稱:Sample-CustomizeDatasetCS,代碼行數:12,代碼來源:ContentDesigner.cs

示例9: GetEditableDesignerRegionContent

 // 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)
       {
     TabPage tb;
     tb = (TabPage)tabView.Tabs[tabView.CurrentTabIndex];
     return ControlPersister.PersistControl(tb, host);
       }
       return String.Empty;
 }
開發者ID:Confirmit,項目名稱:Portal,代碼行數:13,代碼來源:TabViewDesigner.cs

示例10: SetEditableDesignerRegionContent

        public override void SetEditableDesignerRegionContent(EditableDesignerRegion region, string content)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate template = ControlParser.ParseTemplate(host, content);

                if (template != null)
                {
                    _Control.Content = template;
                }
            }
        }
開發者ID:trankimhieu,項目名稱:eCommerce-MVC,代碼行數:14,代碼來源:Designer.cs

示例11: GetEditableDesignerRegionContent

        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                ITemplate template = _Control.Content;

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

            return "oops...";
        }
開發者ID:trankimhieu,項目名稱:eCommerce-MVC,代碼行數:14,代碼來源:Designer.cs

示例12: GetDesignTimeHtml

        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            EditableDesignerRegion editableRegion = new EditableDesignerRegion(this, "Content", true);
            regions.Add(editableRegion);

            string title = CurrentControl.Title;
            if (String.IsNullOrEmpty(title))
            {
                title = String.Format("[{0}]", CurrentControl.ID);
            }
            string content = String.Format("<div {0}='{1}'>{2}</div>",
                DesignerRegion.DesignerRegionAttributeName, 0, GetEditableDesignerRegionContent(editableRegion));

            return String.Format(PANEL_TEMPLATE, title, content);
        }
開發者ID:g992com,項目名稱:esb,代碼行數:15,代碼來源:WindowDesigner.cs

示例13: SetEditableDesignerRegionContent

        public override void SetEditableDesignerRegionContent(EditableDesignerRegion region, string content)
        {
            if (content == null)
                return;

            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));
            if (host != null)
            {
                ITemplate template = ControlParser.ParseTemplate(host, content);
                if (region.Name == String.Concat(DesignerRegion.DesignerRegionAttributeName, "0"))
                    _Control.FirstTemplate = template;
                else
                    _Control.SecondTemplate = template;
            }
        }
開發者ID:cstruter,項目名稱:ASPNetDemoTemplateControl,代碼行數:15,代碼來源:CustomTemplateDesigner.cs

示例14: GetEditableDesignerRegionContent

        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 "";
        }
開發者ID:pgodwin,項目名稱:Ext.net,代碼行數:16,代碼來源:ContentPanelDesigner.cs

示例15: GetDesignTimeHtml

        public override String GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            int i = 0;
            foreach (TabPage tabPage in tabControl.TabPages)
            {
                regions.Add(new DesignerRegion(this, HEADER_PREFIX + i.ToString()));
                i++;
            }

            EditableDesignerRegion editableRegion =
                new EditableDesignerRegion(this,
                    CONTENT_PREFIX + tabControl.CurrentDesignTab, false);
            regions.Add(editableRegion);
            regions[tabControl.CurrentDesignTab].Highlight = true;
            return base.GetDesignTimeHtml();
        }
開發者ID:JadJabbour,項目名稱:SimpleCSharpTabControl,代碼行數:16,代碼來源:TabControlDesigner.cs


注:本文中的System.Web.UI.Design.EditableDesignerRegion類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。