private void BindApplications()
        {
            WebAppGalleryHelpers helper = new WebAppGalleryHelpers();

            GalleryApplicationsResult result = helper.GetGalleryApplications("ZooTemplate", PanelSecurity.PackageId);

            List <GalleryApplication> applications         = result.Value as List <GalleryApplication>;
            List <GalleryApplication> filteredApplications = new List <GalleryApplication>();

            List <ShortHeliconZooEngine> allowedEngines = (List <ShortHeliconZooEngine>)ViewState["AllowedEngines"];

            if (null != allowedEngines)
            {
                foreach (GalleryApplication application in applications)
                {
                    foreach (string keyword in application.Keywords)
                    {
                        bool appAlreadyAdded = false;
                        if (keyword.StartsWith("ZooEngine", StringComparison.OrdinalIgnoreCase))
                        {
                            string appEngine = keyword.Substring("ZooEngine".Length);

                            foreach (ShortHeliconZooEngine engine in allowedEngines)
                            {
                                if (!engine.Enabled)
                                {
                                    continue; //skip
                                }

                                if (
                                    string.Equals(appEngine, engine.KeywordedName, StringComparison.OrdinalIgnoreCase)
                                    ||
                                    engine.Name == "*"
                                    )
                                {
                                    filteredApplications.Add(application);
                                    appAlreadyAdded = true;
                                    break;
                                }
                            }
                            if (appAlreadyAdded)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                filteredApplications.AddRange(applications);
            }


            gvApplications.DataSource = filteredApplications;
            gvApplications.DataBind();
        }
Esempio n. 2
0
        private void BindApplications()
        {
            WebAppGalleryHelpers helper = new WebAppGalleryHelpers();
            //
            GalleryApplicationsResult result = helper.GetGalleryApplications(ddlCategory.SelectedValue, PanelSecurity.PackageId);

            //
            gvApplications.DataSource = result.Value;
            gvApplications.DataBind();
        }
        private void BindApplications()
        {
            ViewState["IsSearchResults"] = false;
            WebAppGalleryHelpers helper = new WebAppGalleryHelpers();
            //
            GalleryApplicationsResult result = helper.GetGalleryApplications(rbsCategory.SelectedValue, PanelSecurity.PackageId);

            //
            gvApplications.DataSource = result.Value;
            gvApplications.DataBind();
        }
        protected void SearchButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            if ((bool)ViewState["IsSearchResults"] == false)
            {
                gvApplications.PageIndex = 0;
            }
            ViewState["IsSearchResults"] = true;

            WebAppGalleryHelpers      helper = new WebAppGalleryHelpers();
            GalleryApplicationsResult result = helper.GetGalleryApplicationsFiltered(searchBox.Text, PanelSecurity.PackageId);

            gvApplications.DataSource = result.Value;
            gvApplications.DataBind();
        }
		private void BindApplications()
		{
			WebAppGalleryHelpers helper = new WebAppGalleryHelpers();
			//
			GalleryApplicationsResult result = helper.GetGalleryApplications(ddlCategory.SelectedValue, PanelSecurity.PackageId);
			//
			gvApplications.DataSource = result.Value;
			gvApplications.DataBind();
		}