Beispiel #1
0
    private void RebindEngines()
    {
        Dictionary <string, HeliconZooEngine> engines = GetEngines();

        EngineGrid.DataSource = engines.Values;
        EngineGrid.DataBind();
    }
Beispiel #2
0
    private void BindEngines()
    {
        WPIProduct zooModule = ES.Services.Servers.GetWPIProductById(PanelRequest.ServerId, "HeliconZooModule");

        if (!zooModule.IsInstalled || zooModule.IsUpgrade)
        {
            HostModule.ShowWarningMessage("Zoo Module is not installed or out-of-date. To proceed press 'Add' or 'Update' next to Helicon Zoo Module below, then press 'Install'.");
        }

        // get all engines from IIS
        HeliconZooEngine[] engineList = ES.Services.HeliconZoo.GetEngines(PanelRequest.ServiceId);

        if (null != engineList && engineList.Length > 0)
        {
            // convert list to dict
            Dictionary <string, HeliconZooEngine> enginesDict = new Dictionary <string, HeliconZooEngine>();
            foreach (HeliconZooEngine engine in engineList)
            {
                enginesDict[engine.name] = engine;
            }

            // save engines in view state
            ViewState["HeliconZooEngines"] = enginesDict;

            // bind to grid
            EngineGrid.DataSource = engineList;
            EngineGrid.DataBind();

            // bind 'Enable quotas' checkbox
            bool enabled = ES.Services.HeliconZoo.IsEnginesEnabled(PanelRequest.ServiceId);
            QuotasEnabled.Checked = !enabled;

            WebCosoleEnabled.Checked = ES.Services.HeliconZoo.IsWebCosoleEnabled(PanelRequest.ServiceId);
        }
        else
        {
            EnginesPanel.Visible = false;
        }
    }