本文整理汇总了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;
}
}
}
示例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);
}
示例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);
}
示例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 });
}
示例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 {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) });
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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...";
}
示例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);
}
示例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;
}
}
示例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 "";
}
示例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();
}