示例#1
0
		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;
			}
		}
		private Panel CreateInfoCardUnsupportedPanel() {
			Panel unsupportedPanel = new Panel();
			try {
				if (this.UnsupportedTemplate != null) {
					this.UnsupportedTemplate.InstantiateIn(unsupportedPanel);
				}
				return unsupportedPanel;
			} catch {
				unsupportedPanel.Dispose();
				throw;
			}
		}
示例#3
0
		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;
			}
		}
        /// <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;
            }
        }