Пример #1
0
        /*
         * private Address MixedCodeDataView_GetAnchorAddress()
         * {
         * var addr = combinedCodeView.MixedCodeDataView.GetAnchorAddress();
         * ImageMapItem item;
         * if (program.ImageMap.TryFindItem(addr, out item))
         * {
         *  var blockItem = item as ImageMapBlock;
         *  if (blockItem != null)
         *  {
         *      addr = program.GetProcedureAddress(blockItem.Block.Procedure);
         *  }
         *  else if (!(item.DataType is UnknownType))
         *  {
         *      addr = item.Address;
         *  }
         * }
         * return addr;
         * }
         *
         * private Address GetAnchorAddress()
         * {
         * if (combinedCodeView.CodeView.Focused)
         *  return CodeView_GetAnchorAddress();
         * if (combinedCodeView.MixedCodeDataView.Focused)
         *  return MixedCodeDataView_GetAnchorAddress();
         * return null;
         * }
         *
         * private void EditDeclaration()
         * {
         * var addr = GetAnchorAddress();
         * if (addr == null)
         *  return;
         * var anchorPt = FocusedTextView.GetAnchorTopPoint();
         * var screenPoint = FocusedTextView.PointToScreen(anchorPt);
         * declarationFormInteractor.Show(screenPoint, program, addr);
         * }
         */

        public void ViewGraph()
        {
            gViewer.Parent = codeView.Parent;
            using (var g = codeView.CreateGraphics())
            {
                var uiPreferences = services.RequireService <IUiPreferencesService>();
                gViewer.Graph = CfgGraphGenerator.Generate(uiPreferences, proc, g, codeView.Font);
            }
            codeView.Visible = false;
            gViewer.Visible  = true;
            gViewer.BringToFront();
        }