Esempio n. 1
0
        private void viewResult_SelectedRowChanged(object sender, EventArgs e)
        {
            try
            {
                ResultData data = (ResultData)e;
                CxViewerAction.CxVSWebService.CxWSResultPath resultPath = PerspectiveHelper.GetResultPath(data.ScanId, data.Result.PathId);

                PerspectiveGraphCtrl viewGraph = null;
                if (_graphWin != null)
                {
                    viewGraph = _graphWin.Window as PerspectiveGraphCtrl;
                    if (viewGraph != null)
                    {
                        CxViewerAction.BaseInterfaces.IGraphPath path = viewGraph.FindPath(resultPath);
                        viewGraph.SelectEdgeGraphByPath(path.DirectFlow[0], path.DirectFlow[1], path);
                        viewGraph.BindData();
                        viewGraph.PathItemClick = GraphClick;
                    }
                }

                #region [Bind path view]
                if (_pathWin != null)
                {
                    IPerspectivePathView viewPath = _pathWin.Window as IPerspectivePathView;
                    CxViewerAction.Entities.WebServiceEntity.ReportQueryItemResult path = new CxViewerAction.Entities.WebServiceEntity.ReportQueryItemResult()
                    {
                        Column   = resultPath.Nodes[0].Column,
                        FileName = resultPath.Nodes[0].FileName,
                        Line     = resultPath.Nodes[0].Line,
                        NodeId   = resultPath.Nodes[0].PathNodeId,
                        PathId   = resultPath.PathId,
                        Query    = data.NodeData.QueryResult
                    };
                    path.Paths = GraphHelper.ConvertNodesToPathes(resultPath.Nodes, data.NodeData.QueryResult, path);
                    viewPath.PathButtonClickHandler = PathButtonClick;

                    viewPath.QueryItemResult = path;

                    viewPath.BindData(resultPath.Nodes[0].PathNodeId);

                    showView(_pathWin);
                }
                #endregion

                ShowFile(resultPath.Nodes[0].FileName, resultPath.Nodes[0].Line, resultPath.Nodes[0].Column, resultPath.Nodes[0].Length);
            }
            catch (Exception ex)
            {
                if (ex is System.Net.WebException)
                {
                    Logger.Create().Error(ex.ToString());
                    TopMostMessageBox.Show(ex.Message, "Error");
                }
                else
                {
                    Logger.Create().Error(ex.ToString());
                    TopMostMessageBox.Show("General error occured, please check the log", "Error");
                }
            }
        }