如何在Visual Studio中扩展代码审查窗口

时间:2017-07-12 19:58:36

标签: visual-studio visual-studio-2015 visual-studio-2017 visual-studio-extensions

我想编写一个Visual Studio扩展,允许我在现有的代码审查窗口中添加其他UI元素。这Stack Overflow question似乎确切地定义了我想要做的事情。但答案并没有解释如何在建议它可以实现的同时实现这一目标。

1 个答案:

答案 0 :(得分:0)

如果要禁用页面中的部分,请参阅以下代码。

Option Explicit

Sub MovePivotTable(ws As Worksheet)

Dim PvtTbl As PivotTable
Dim TblReport As ListObject
Dim InsurChtObj As ChartObject

With ws
    ' set the Pivot Table object
    Set PvtTbl = .PivotTables("pvtReport")

    ' set the Table object (ListObject)
    Set TblReport = .ListObjects("tblReport")

    ' set the Pivot Table Chart object
    Set InsurChtObj = .ChartObjects("InsuranceChart")

    ' move the Pivot Table at the end of the Table Object
    PvtTbl.TableRange2.Cut Destination:=.Cells(TblReport.Range.Rows.Count + 2, 13)

    ' move the Pivot chart at the end of the Table
    InsurChtObj.Top = PvtTbl.TableRange1.End(xlDown).Offset(2).Top ' go to the bottom of the Pivot-Table range + 2 more rows
    InsurChtObj.Left = PvtTbl.TableRange1.Left
End With

End Sub

如果要向页面添加部分,请参阅以下链接,其中提供了相关代码。

https://binary-stuff.com/post/getting-start-with-a-team-explorer-plugin-for-vs-2013-part-4 https://github.com/jakobehn/GitFlow.VS/tree/master/TeamExplorer.Common