Esempio n. 1
0
        /// <summary>
        /// Add a new results page with a view of the specified type
        /// </summary>
        /// <param name="query"></param>
        /// <param name="viewType"></param>
        /// <returns></returns>

        public static void AddNewPageAndView(
            Query query,
            ResultsViewType viewType,
            string viewSubtype,
            out ResultsPage page,
            out ResultsViewProps view)
        {
            page = AddNewPage(query);
            view = ResultsViewProps.NewResultsView(query, page, viewType, viewSubtype);             // create the view & add to page
            return;
        }
Esempio n. 2
0
        /// <summary>
        /// Remove the specified page
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>

        public bool Remove(ResultsPage page)
        {
            if (!Pages.Remove(page))
            {
                return(false);
            }

            RemoveSubqueriesWithNoViews(RootQuery);

            return(true);
        }
Esempio n. 3
0
/// <summary>
/// Get the index of the page, if any, that contains the root query MoleculeGridView
/// </summary>
/// <returns></returns>

        public int GetRootQueryMoleculeGridPageIndex()
        {
            for (int pi = 0; pi < Pages.Count; pi++)
            {
                ResultsPage rp = Pages[pi];
                foreach (ResultsViewProps v in rp.Views)
                {
                    if (v.BaseQuery == RootQuery && v.ViewType == ResultsViewType.Table)
                    {
                        return(pi);
                    }
                }
            }

            return(-1);            // not found
        }
Esempio n. 4
0
        /// <summary>
        /// Add a new page to the set of results pages
        /// </summary>
        /// <returns></returns>

        public ResultsPage AddNewPage()
        {
            ResultsPage page = new ResultsPage();             // create the page

            page.SetDefaultTitle(this);

            if (Pages.Count > 0)             // if other pages use last page as model for extra windows to show
            {
                ResultsPage lastPage = Pages[Pages.Count - 1];
                page.ShowFilterPanel     = lastPage.ShowFilterPanel;
                page.ShowDetailsOnDemand = lastPage.ShowDetailsOnDemand;
            }

            AddPage(page);             // add page to query

            return(page);
        }
Esempio n. 5
0
/// <summary>
/// Add a new page for the specified query
/// </summary>
/// <param name="query"></param>
/// <returns></returns>

        public static ResultsPage AddNewPage(
            Query query)
        {
            int max, intVal;

            ResultsPages pages = query.Root.ResultsPages;

            if (pages == null)
            {
                pages = new ResultsPages();
                query.Root.ResultsPages = pages;
            }

            ResultsPage page = pages.AddNewPage();

            return(page);
        }
Esempio n. 6
0
/// <summary>
/// SetupQueryPagesAndViews
/// </summary>
/// <param name="query"></param>
/// <returns></returns>

        public void SetupQueryPagesAndViews(
            Query query,
            ResultsViewType tableViewType)
        {
            QueryTable       qt;
            ResultsPage      page;
            ResultsViewProps view;
            ResultsViewType  viewType;
            string           name, title;
            bool             createdTableView = false;
            int pi;

            List <ResultsPage> oldPages = query.ResultsPages.Pages;                            // existing pages
            List <ResultsPage> newPages = query.ResultsPages.Pages = new List <ResultsPage>(); // clear ResultsPages new pages built here

// Build/Copy views on data retrieved by the Mobius QE

            if (query.RetrievesMobiusData)                                         // if query retrieves data from Mobius then replace the existing table view with the specified type
            {
                AddNewPageAndView(query, tableViewType, null, out page, out view); // basic table view goes first
                page.Name  = view.Name = "TableView";
                page.Title = view.Title = "Table View";

                if (tableViewType == ResultsViewType.Table)                 // if regular grid table views add other views on Mobius QE data
                {
                    for (int opi = 1; opi < oldPages.Count; opi++)
                    {
                        ResultsPage op = oldPages[opi];

                        //if (op.Views.Count > 0 && op.Views[0].IsSpotfireUrlDrivenVisualization) continue; // Spotfire link view added later, not here

                        newPages.Add(op);
                    }
                }
            }

            return;
        }
Esempio n. 7
0
        /// <summary>
        /// Deserialize the results pages in a query
        /// </summary>
        /// <param name="tr"></param>
        /// <returns></returns>

        public static ResultsPages Deserialize(Query q, XmlTextReader tr)
        {
            ResultsPages pages = new ResultsPages();

            pages.RootQuery = q;

            if (!Lex.Eq(tr.Name, "ResultsPages"))
            {
                throw new Exception("ResultsPages element not found");
            }

            if (tr.IsEmptyElement)
            {
                return(pages);                               // no pages
            }
            while (true)
            {
                tr.Read(); tr.MoveToContent();

                if (tr.NodeType == XmlNodeType.EndElement && Lex.Eq(tr.Name, "ResultsPages"))
                {
                    break;
                }

                ResultsPage page = ResultsPage.Deserialize(q, tr);

                if (pages.Pages.Count == 1 && Query.DeserializeTruncateToSingleResultsPage)
                {
                    continue;
                }

                pages.AddPage(page);
            }

            return(pages);
        }
Esempio n. 8
0
        /// <summary>
        /// Add an existing page to the list of pages
        /// </summary>
        /// <param name="page"></param>

        public void AddPage(ResultsPage page)
        {
            Pages.Add(page);
        }