protected override void Dispose(bool disposing)
        {
            PerspectiveGraphCtrl ctrl = this.Window as PerspectiveGraphCtrl;

            ctrl.ClearGraphView();
            base.Dispose(disposing);
        }
예제 #2
0
        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);
        }
예제 #3
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");
                }
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
        private void ShowProblemFile(CxViewerAction.Entities.WebServiceEntity.TreeNodeData treeNode)
        {
            #region [Bind graph view]

            try
            {
                PerspectiveGraphCtrl viewGraph = null;
                if (_graphWin != null)
                {
                    viewGraph = _graphWin.Window as PerspectiveGraphCtrl;
                    if (viewGraph != null)
                    {
                        viewGraph.ClearGraphView();
                        viewGraph.Graph        = null;
                        viewGraph.SelectedPath = null;
                        viewGraph.Graph        = new Graph(treeNode);
                        viewGraph.MsGalViewer.Refresh();
                        viewGraph.MsGalViewer.ResumeLayout();
                        viewGraph.MsGalViewer.Update();
                        viewGraph.BindData();
                        viewGraph.PathItemClick = GraphClick;
                    }

                    showView(_graphWin);
                }

                #endregion

                #region [Bind result view]
                if (_resultWin != null)
                {
                    PerspectiveResultCtrl viewResult = _resultWin.Window as PerspectiveResultCtrl;

                    viewResult.SelectedNode = treeNode;
                    //if (!_resultWin.Visible || viewResult.IsActive)
                    //{
                    if (!wasInit)
                    {
                        viewResult.SelectedRowChanged += new EventHandler(viewResult_SelectedRowChanged);
                        viewResult.Refresh            += new EventHandler(viewResult_Refresh);
                        wasInit = true;
                    }
                    // _resultWin.Visible = true;
                    viewResult.IsActive = false;
                    viewResult.SelectRow();
                    //}

                    showView(_resultWin);
                }
            }
            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");
                }
            }
            #endregion
        }