private void PathButtonClick(object sender, EventArgs e) { ReportQueryItemPathResult reportQueryItemPathResult = ((ColorButton.ColorButton)sender).Tag as ReportQueryItemPathResult; PerspectiveGraphCtrl viewGraph = null; if (_graphWin != null) { viewGraph = _graphWin.Window as PerspectiveGraphCtrl; if (viewGraph != null) { { viewGraph.SelectedPath = viewGraph.FindPath(reportQueryItemPathResult.QueryItem); DrawingHelper.SelectedPathItemUniqueID = reportQueryItemPathResult.UniqueID; DrawingHelper.isEdgeSelected = false; } viewGraph.BindData(); if (viewGraph.MsGalViewer != null) { viewGraph.MsGalViewer.Refresh(); viewGraph.MsGalViewer.ResumeLayout(); viewGraph.MsGalViewer.Update(); } } } ShowFile(reportQueryItemPathResult.FileName, reportQueryItemPathResult.Line, reportQueryItemPathResult.Column, reportQueryItemPathResult.Length); }
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"); } } }
private void GraphClick(object sender, EventArgs e) { ReportQueryItemPathResult graphItem = ((ReportQueryItemPathResult)sender); PerspectiveGraphCtrl viewGraph = null; if (_graphWin != null) { viewGraph = _graphWin.Window as PerspectiveGraphCtrl; if (viewGraph != null) { viewGraph.SelectedPath = viewGraph.FindPath(graphItem.QueryItem); DrawingHelper.SelectedPathItemUniqueID = graphItem.UniqueID; DrawingHelper.isEdgeSelected = false; if (viewGraph.MsGalViewer != null) { viewGraph.MsGalViewer.Refresh(); viewGraph.MsGalViewer.ResumeLayout(); viewGraph.MsGalViewer.Update(); } viewGraph.BindData(); } } #region [Bind path view] if (_pathWin != null) { IPerspectivePathView viewPath = _pathWin.Window as IPerspectivePathView; viewPath.PathButtonClickHandler = PathButtonClick; viewPath.QueryItemResult = graphItem.QueryItem; viewPath.BindData(graphItem.NodeId); showView(_pathWin); } #endregion PerspectiveResultCtrl viewResult = _resultWin.Window as PerspectiveResultCtrl; viewResult.MarkRowAsSelected(graphItem.QueryItem.PathId); ShowFile(graphItem.FileName, graphItem.Line, graphItem.Column, graphItem.Length); }