Beispiel #1
0
        /// <summary>
        /// Create the view display controls and link them into the QueryResultsControl and the ResultsView object
        /// </summary>
        /// <returns></returns>

        public override Control AllocateRenderingControl()
        {
            if (RealizeSubQueryView() == null)             // be sure the subquery and view still exist
            {
                MessageBoxMx.ShowError("Failed to realize SubQueryId: " + SubQueryId + ", SubQuerySelectedViewId: " + SubQuerySelectedViewId);
                return(null);
            }

            Query            sq     = SubQuery;
            ResultsViewProps sqView = SubQuerySelectedView;

            if (Lex.IsUndefined(CustomViewTypeImageName))
            {
                CustomViewTypeImageName = sqView.CustomViewTypeImageName;
            }

            if (Lex.IsUndefined(Title))
            {
                Title = sqView.Title;
            }

            if (Sqm == null)
            {
                Sqm = SetupAndExecuteSecondaryQuery(sq, sqView);
            }

            RenderingControl = sqView.AllocateRenderingControl();             // allocate proper control for the subquery view we want to use

            return(RenderingControl);
        }
Beispiel #2
0
        /// <summary>
        /// Configure the view in the view panel
        /// </summary>
        /// <param name="view"></param>
        /// <param name="viewPanel"></param>

        void ConfigureViewInPanel(
            ResultsViewProps view,
            XtraPanel viewPanel)
        {
            Stopwatch sw = Stopwatch.StartNew();

            long ms1 = sw.ElapsedMilliseconds;

            sw.Restart();

            if (viewPanel.Parent != null)
            {
                viewPanel.Size = viewPanel.Parent.Size;
            }

            //if (view.RenderingControl == null) // create the rendering control for the view if not done yet
            {
                view.AllocateRenderingControl();                 // allocate rendering control if needed
            }

            long ms2 = sw.ElapsedMilliseconds;

            sw.Restart();

            view.InsertRenderingControlIntoDisplayPanel(viewPanel);

            if (view.ConfigureCount == 0)             // configure if not done yet
            {
                view.ConfigureRenderingControl();
            }

            long ms3 = sw.ElapsedMilliseconds;

            return;
        }