コード例 #1
0
        //25Feb2015 exact copy of AddAnalyisFromFile from OutputWindow.xaml Not Sure if in future they will differ
        public void showOutput(string fullpathfilename)
        {
            FrameworkElement     lastElement  = null;//25Feb2015
            AnalyticsData        analysisdata = null;
            List <SessionOutput> allAnalysis  = null;
            BSkyOutputGenerator  bsog         = new BSkyOutputGenerator();

            allAnalysis = bsog.GenerateOutput(fullpathfilename);
            if (allAnalysis == null)
            {
                return;
            }
            foreach (SessionOutput so in allAnalysis)
            {
                bool isRSession = so.isRSessionOutput;
                if (isRSession)
                {
                    SessionItem            = new TreeViewItem();//15Nov2013
                    SessionItem.Header     = so.NameOfSession;
                    SessionItem.IsExpanded = true;
                }

                double extraspaceinbeginning = 0;
                if (mypanel.Children.Count > 0)//if its not the first item on panel
                {
                    extraspaceinbeginning = 10;
                }
                foreach (CommandOutput co in so)
                {
                    analysisdata              = new AnalyticsData(); //blank entry.
                    analysisdata.Output       = co;                  //saving reference.
                    analysisdata.AnalysisType = co.NameOfAnalysis;   //For Parent Node name 02Aug2012


                    foreach (DependencyObject obj in co)
                    {
                        FrameworkElement element = obj as FrameworkElement;
                        element.Margin = new Thickness(10, 2 + extraspaceinbeginning, 0, 2);;
                        mypanel.Children.Add(element);
                        extraspaceinbeginning = 0;
                        lastElement           = element;
                    }
                    PopulateTree(co, isRSession);
                    outputDataList.Add(analysisdata);
                }
                if (isRSession)
                {
                    NavTree.Items.Add(SessionItem);//15Nov2013
                }
            }

            //25Feb2015 bring last into focus
            if (lastElement != null)
            {
                lastElement.BringIntoView();
            }
        }
コード例 #2
0
        public void showOutput_old(string fullpathfilename)
        {
            List <SessionOutput> allAnalysis = null;
            BSkyOutputGenerator  bsog        = new BSkyOutputGenerator();// create generator

            // read .bso file and create
            allAnalysis = bsog.GenerateOutput(fullpathfilename);
            if (allAnalysis == null)
            {
                return;
            }
            foreach (SessionOutput so in allAnalysis)
            {
                bool isRSession = so.isRSessionOutput;
                if (isRSession)
                {
                    SessionItem            = new TreeViewItem();//15Nov2013
                    SessionItem.Header     = so.NameOfSession;
                    SessionItem.IsExpanded = true;
                }

                double extraspaceinbeginning = 0;
                if (mypanel.Children.Count > 0)//if its not the first item on panel
                {
                    extraspaceinbeginning = 10;
                }

                foreach (CommandOutput co in so)
                {
                    foreach (DependencyObject obj in co)
                    {
                        FrameworkElement element = obj as FrameworkElement;
                        element.Margin = new Thickness(10, 2 + extraspaceinbeginning, 0, 2);
                        mypanel.Children.Add(element);
                    }
                    PopulateTree(co, isRSession);
                }
            }
        }
コード例 #3
0
        private void createFlexGrid(XmlDocument xd, CommandOutput lst, string header)
        {
            AUXGrid xgrid = new AUXGrid();
            AUGrid c1FlexGrid1 = xgrid.Grid;// new C1flexgrid.
            xgrid.Header.Text = header;//FlexGrid header as well as Tree leaf node text(ControlType)
            //XmlDocument xd = new XmlDocument(); xd.LoadXml(xdoc);

            BSkyOutputGenerator bsog = new BSkyOutputGenerator();
            bsog.html2flex(xd, c1FlexGrid1);
            lst.Add(xgrid);
        }
コード例 #4
0
        private void createAUPara(string auparas, CommandOutput lst)
        {
            string startdatetime = string.Empty;
            if (lst.NameOfAnalysis == null || lst.NameOfAnalysis.Trim().Length < 1)
            {
                lst.NameOfAnalysis = "R-Output";//Parent Node name. 02Aug2012
            }
            if (auparas == null || auparas.Trim().Length < 1)
                return;
            string selectnode = "bskyoutput/bskyanalysis/aup";
            string AUPara = "<aup>" + auparas.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;") + "</aup>";//single AUPara for all lines
            XmlDocument xd = null;

            ///// Creating DOM for generation output ///////
            string fulldom = "<bskyoutput> <bskyanalysis>" + AUPara + "</bskyanalysis> </bskyoutput>";
            xd = new XmlDocument(); xd.LoadXml(fulldom);

            //// for creating AUPara //////////////
            BSkyOutputGenerator bsog = new BSkyOutputGenerator();
            int noofaup = xd.SelectNodes(selectnode).Count;// should be 3

            for (int k = 1; k <= noofaup; k++)
            {
                if (lst.NameOfAnalysis.Equals("R-Output") || lst.NameOfAnalysis.Contains("Command Editor Execution"))
                {
                    lst.Add(bsog.createAUPara(xd, selectnode + "[" + (1) + "]", ""));
                }
                else if (lst.NameOfAnalysis.Equals("Datasets"))
                {
                    lst.Add(bsog.createAUPara(xd, selectnode + "[" + (1) + "]", "Open Datasets"));
                }
                else
                {
                    lst.Add(bsog.createAUPara(xd, selectnode + "[" + k + "]", startdatetime));
                }
            }
        }
        //25Feb2015 exact copy of AddAnalyisFromFile from OutputWindow.xaml Not Sure if in future they will differ
        public void showOutput(string fullpathfilename)
        {
            FrameworkElement     lastElement  = null;//25Feb2015
            AnalyticsData        analysisdata = null;
            List <SessionOutput> allAnalysis  = null;
            BSkyOutputGenerator  bsog         = new BSkyOutputGenerator();

            allAnalysis = bsog.GenerateOutput(fullpathfilename);
            if (allAnalysis == null)
            {
                return;
            }
            foreach (SessionOutput so in allAnalysis)
            {
                bool isRSession = so.isRSessionOutput;
                if (isRSession)
                {
                    SessionItem            = new TreeViewItem(); //15Nov2013
                    SessionItem.Header     = so.NameOfSession;   // (sessionheader != null && sessionheader.Length > 0) ? sessionheader : "R-Session";//18Nov2013 cb;//
                    SessionItem.IsExpanded = true;
                }

                double extraspaceinbeginning = 0;
                if (mypanel.Children.Count > 0)//if its not the first item on panel
                {
                    extraspaceinbeginning = 10;
                }
                foreach (CommandOutput co in so)
                {
                    analysisdata              = new AnalyticsData(); //blank entry. There is no open dataset for old/saved ouput
                    analysisdata.Output       = co;                  //saving reference. so that whole outputwindo can be saved again
                    analysisdata.AnalysisType = co.NameOfAnalysis;   //For Parent Node name 02Aug2012


                    foreach (DependencyObject obj in co)
                    {
                        FrameworkElement element = obj as FrameworkElement;
                        element.Margin = new Thickness(10, 2 + extraspaceinbeginning, 0, 2);;
                        mypanel.Children.Add(element);
                        extraspaceinbeginning = 0;
                        lastElement           = element;
                    }
                    PopulateTree(co, isRSession);
                    outputDataList.Add(analysisdata);
                }
                if (isRSession)
                {
                    NavTree.Items.Add(SessionItem);//15Nov2013
                }
            }
            //20Oct2014 Did not Work
            //int itcnt = NavTree.Items.Count;
            //if (itcnt > 0 && (NavTree.Items.GetItemAt(itcnt - 1) as TreeViewItem).Tag != null)
            //{
            //    ((NavTree.Items.GetItemAt(itcnt - 1) as TreeViewItem).Tag as FrameworkElement).BringIntoView();
            //}

            //25Feb2015 bring last into focus
            if (lastElement != null)
            {
                lastElement.BringIntoView();
            }
            //BringOnTop();
        }