Exemplo n.º 1
0
        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();

            TreeNode rootNode = new TreeNode();

            rootNode.ImageUrl = PortalUtils.GetThemedImage("folder.png");
            rootNode.Text     = GetLocalizedString("Text.Resources");
            rootNode.Value    = "Root";
            rootNode.Expanded = true;
            tree.Nodes.Add(rootNode);

            // populate root node
            ServiceProviderItemType[] types = ES.Services.Import.GetImportableItemTypes(PanelSecurity.PackageId);
            foreach (ServiceProviderItemType type in types)
            {
                TreeNode node = new TreeNode();
                node.Value            = "-" + type.ItemTypeId.ToString();
                node.Text             = GetSharedLocalizedString("ServiceItemType." + type.DisplayName);
                node.PopulateOnDemand = true;
                node.ImageUrl         = PortalUtils.GetThemedImage("folder.png");
                rootNode.ChildNodes.Add(node);
            }
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            Context = context;

            int ItemID    = Param("ItemID");
            int AccountID = Param("AccountID");

            BytesResult res = ES.Services.ExchangeServer.GetPicture(ItemID, AccountID);

            if (res.IsSuccess)
            {
                context.Response.ContentType = "image/jpeg";
                context.Response.BinaryWrite(res.Value);
            }
            else
            {
                context.Response.Redirect(PortalUtils.GetThemedImage("empty.gif"), true);
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public string GetThemedImage(string imageUrl)
 {
     return(PortalUtils.GetThemedImage(imageUrl));
 }
        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 (NotImplementedException ex)
                {
                    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);
                }
            }
        }