本文整理汇总了C#中System.Web.UI.WebControls.Panel.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Dispose方法的具体用法?C# Panel.Dispose怎么用?C# Panel.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Panel
的用法示例。
在下文中一共展示了Panel.Dispose方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateInfoCardUnsupportedPanel
private Panel CreateInfoCardUnsupportedPanel() {
Contract.Ensures(Contract.Result<Panel>() != null);
Panel unsupportedPanel = new Panel();
try {
if (this.UnsupportedTemplate != null) {
this.UnsupportedTemplate.InstantiateIn(unsupportedPanel);
}
return unsupportedPanel;
} catch {
unsupportedPanel.Dispose();
throw;
}
}
示例2: CreateInfoCardUnsupportedPanel
private Panel CreateInfoCardUnsupportedPanel() {
Panel unsupportedPanel = new Panel();
try {
if (this.UnsupportedTemplate != null) {
this.UnsupportedTemplate.InstantiateIn(unsupportedPanel);
}
return unsupportedPanel;
} catch {
unsupportedPanel.Dispose();
throw;
}
}
示例3: CreateInfoCardSupportedPanel
private Panel CreateInfoCardSupportedPanel() {
Contract.Ensures(Contract.Result<Panel>() != null);
Panel supportedPanel = new Panel();
try {
if (!this.DesignMode) {
// At the user agent, assume InfoCard is not supported until
// the JavaScript discovers otherwise and reveals this panel.
supportedPanel.Style[HtmlTextWriterStyle.Display] = "none";
}
supportedPanel.Controls.Add(this.CreateInfoCardImage());
// trigger the selector at page load?
if (this.AutoPopup && !this.Page.IsPostBack) {
this.Page.ClientScript.RegisterStartupScript(
typeof(InfoCardSelector),
"selector_load_trigger",
this.GetInfoCardSelectorActivationScript(true),
true);
}
return supportedPanel;
} catch {
supportedPanel.Dispose();
throw;
}
}
示例4: CreateRotatorContainer
/// <summary>Creates a <see cref="Panel" /> from a tag, setting its <see cref="Panel.CssClass" /> and supplying Text or inner controls, if it has any.</summary>
/// <param name="tag">The tag whose content is being represented.</param>
/// <param name="slide">The object from which to get the property.</param>
/// <param name="resourceFile">The resource file from which to get localized resources.</param>
/// <returns>The created container</returns>
private Panel CreateRotatorContainer(Tag tag, ITemplateable slide, string resourceFile)
{
Panel container = null;
try
{
container = new Panel();
container.CssClass = TemplateEngine.GetAttributeValue(tag, slide, null, resourceFile, "CssClass", "class");
if (tag.HasChildTags)
{
TemplateEngine.ProcessTags(container, tag.ChildTags, slide, null, resourceFile, this.ProcessTags, this.GetSlides);
}
else
{
var innerText = TemplateEngine.GetAttributeValue(tag, slide, (ITemplateable)null, resourceFile, "Text");
if (!string.IsNullOrEmpty(innerText))
{
container.Controls.Add(new LiteralControl(innerText));
}
}
return container;
}
catch
{
if (container != null)
{
container.Dispose();
}
throw;
}
}