protected void searchFilterControl_FilterRemoved(object sender, EventArgs e)
        {
            SearchFilterControl searchFilterControl = (SearchFilterControl)sender;

            this.SearchFilters.Remove(searchFilterControl.Name);

            this.RefreshSearchFiltersListPanel(this.SearchFiltersListPanel, this.SearchFilters, this.ContentType);
        }
Exemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.searchFilterControl1 = ((Sobiens.Connectors.WPF.Controls.Search.SearchFilterControl)(target));
                return;

            case 2:
                this.SearchFiltersListPanel = ((System.Windows.Controls.StackPanel)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private void RefreshSearchFiltersListPanel(StackPanel searchFiltersListPanel, Dictionary <string, SearchFilters> searchFilters, ContentType contentType)
        {
            IServiceManager serviceManager = ServiceManagerFactory.GetServiceManager(SiteSetting.SiteSettingType);
            Folder          targetFolder   = serviceManager.GetFolder(SiteSetting, TargetFolder);

            SearchFiltersListPanel.Children.Clear();
            foreach (string key in searchFilters.Keys)
            {
                SearchFilters       filters             = searchFilters[key];
                SearchFilterControl searchFilterControl = new SearchFilterControl();
                searchFilterControl.Name = key;
                searchFilterControl.Initialize(targetFolder.GetWebUrl(), contentType, filters[0], filters.IsOr);
                searchFilterControl.ReadOnly       = true;
                searchFilterControl.FilterRemoved += new EventHandler(searchFilterControl_FilterRemoved);
                searchFiltersListPanel.Children.Add(searchFilterControl);
            }
        }