protected override void OnPreRender(EventArgs e) { if (!DisplayGauge) { return; } string leftSideSrc = Page.ResolveUrl(PortalUtils.GetThemedImage("gauge_left.gif")); string rightSideSrc = Page.ResolveUrl(PortalUtils.GetThemedImage("gauge_right.gif")); string bkgSrc = Page.ResolveUrl(PortalUtils.GetThemedImage("gauge_bkg.gif")); // calculate the width of the gauge int fTotal = Total; int percent = (fTotal > 0) ? Convert.ToInt32(Math.Round((double)Progress / (double)fTotal * 100)) : 0; double fFilledWidth = (fTotal > 0) ? ((double)Progress / (double)fTotal * Width) : 0; int filledWidth = Convert.ToInt32(fFilledWidth); if (filledWidth > Width) { filledWidth = Width; } string fillSrc = "gauge_green.gif"; if (percent > 60 && percent < 90 && !oneColour) { fillSrc = "gauge_yellow.gif"; } else if (percent >= 90 && !oneColour) { fillSrc = "gauge_red.gif"; } fillSrc = Page.ResolveUrl(PortalUtils.GetThemedImage(fillSrc)); GaugeContent.Text = DrawImage(leftSideSrc, 1); GaugeContent.Text += DrawImage(fillSrc, filledWidth); GaugeContent.Text += DrawImage(bkgSrc, width - filledWidth); GaugeContent.Text += DrawImage(rightSideSrc, 1); }
private void PrepareTree() { // prepare tree tree.CollapseImageUrl = PortalUtils.GetThemedImage("min.gif"); tree.ExpandImageUrl = PortalUtils.GetThemedImage("max.gif"); tree.NoExpandImageUrl = PortalUtils.GetThemedImage("empty.gif"); tree.Nodes.Clear(); rootNode = new TreeNode(); rootNode.ImageUrl = PortalUtils.GetThemedImage("folder.png"); rootNode.Text = GetLocalizedString("Text.Resources"); rootNode.SelectAction = TreeNodeSelectAction.None; rootNode.Value = "Root"; rootNode.Expanded = true; tree.Nodes.Add(rootNode); // populate root node TreeNode node; ServiceProviderItemType[] types = ES.Services.Import.GetImportableItemTypes(PanelSecurity.PackageId); foreach (ServiceProviderItemType type in types) { node = new TreeNode(); node.Value = "-" + type.ItemTypeId.ToString(); node.Text = GetSharedLocalizedString("ServiceItemType." + type.DisplayName); node.PopulateOnDemand = true; node.SelectAction = TreeNodeSelectAction.None; node.ImageUrl = PortalUtils.GetThemedImage("folder.png"); rootNode.ChildNodes.Add(node); } // Add Import HostHeaders node = new TreeNode(); node.Value = "+100"; node.Text = GetSharedLocalizedString("ServiceItemType.HostHeader"); node.PopulateOnDemand = true; node.SelectAction = TreeNodeSelectAction.None; node.ImageUrl = PortalUtils.GetThemedImage("folder.png"); rootNode.ChildNodes.Add(node); }
protected void Page_Load(object sender, EventArgs e) { ClientScriptManager cs = Page.ClientScript; cs.RegisterClientScriptInclude("jquery", ResolveUrl("~/JavaScript/jquery-1.4.4.min.js")); if (!IsPostBack) { try { if (!ES.Services.Servers.CheckLoadUserProfile(PanelRequest.ServerId)) { CheckLoadUserProfilePanel.Visible = true; } } catch (AmbiguousMatchException) { CheckLoadUserProfilePanel.Visible = false; ShowWarningMessage("Server application pool \"Load User Profile\" setting unavailable. IIS7 or higher is expected."); } catch (Exception ex) { CheckLoadUserProfilePanel.Visible = false; ProductsPanel.Visible = false; keywordsList.Visible = false; SearchPanel.Visible = false; InstallButtons1.Visible = false; InstallButtons2.Visible = false; ShowErrorMessage("WPI_CHECK_LOAD_USER_PROFILE", ex); } try { ES.Services.Servers.InitWPIFeeds(PanelRequest.ServerId); } catch { ProductsPanel.Visible = false; keywordsList.Visible = false; SearchPanel.Visible = false; InstallButtons1.Visible = false; InstallButtons2.Visible = false; ShowWarningMessage("No products available. Please enable Web Platfrom Installer feeds in System Settings."); return; } ProgressAnimation.ImageUrl = PortalUtils.GetThemedImage("indicator_medium.gif"); ViewState["SearchResultShown"] = false; BindWpiProducts(); string message = UpdateProgress(); if (!string.IsNullOrEmpty(message)) { ShowProgressPanel(); } string gotoProducts = Request.QueryString["WPIProduct"]; if (!string.IsNullOrEmpty(gotoProducts)) { ArrayList wpiProductsForInstall = GetProductsToInstallList(); wpiProductsForInstall.AddRange(gotoProducts.Split(',')); SetProductsToInstallList(wpiProductsForInstall); btnInstall_Click(sender, e); } } }
public string GetThemedImage(string imageUrl) { return(PortalUtils.GetThemedImage(imageUrl)); }