IVsDifferenceService.OpenComparisonWindow2 Method

Opens and displays a file comparison window in Visual Studio.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)

Syntax

'Declaration
Function OpenComparisonWindow2 ( _
    leftFileMoniker As String, _
    rightFileMoniker As String, _
    caption As String, _
    Tooltip As String, _
    leftLabel As String, _
    rightLabel As String, _
    inlineLabel As String, _
    roles As String, _
    grfDiffOptions As UInteger _
) As IVsWindowFrame
IVsWindowFrame OpenComparisonWindow2(
    string leftFileMoniker,
    string rightFileMoniker,
    string caption,
    string Tooltip,
    string leftLabel,
    string rightLabel,
    string inlineLabel,
    string roles,
    uint grfDiffOptions
)
IVsWindowFrame^ OpenComparisonWindow2(
    [InAttribute] String^ leftFileMoniker, 
    [InAttribute] String^ rightFileMoniker, 
    [InAttribute] String^ caption, 
    [InAttribute] String^ Tooltip, 
    [InAttribute] String^ leftLabel, 
    [InAttribute] String^ rightLabel, 
    [InAttribute] String^ inlineLabel, 
    [InAttribute] String^ roles, 
    [InAttribute] unsigned int grfDiffOptions
)
abstract OpenComparisonWindow2 : 
        leftFileMoniker:string * 
        rightFileMoniker:string * 
        caption:string * 
        Tooltip:string * 
        leftLabel:string * 
        rightLabel:string * 
        inlineLabel:string * 
        roles:string * 
        grfDiffOptions:uint32 -> IVsWindowFrame
function OpenComparisonWindow2(
    leftFileMoniker : String, 
    rightFileMoniker : String, 
    caption : String, 
    Tooltip : String, 
    leftLabel : String, 
    rightLabel : String, 
    inlineLabel : String, 
    roles : String, 
    grfDiffOptions : uint
) : IVsWindowFrame

Parameters

  • leftFileMoniker
    Type: String

    [in] Path to the file that will be displayed in the left side of the comparison.

  • rightFileMoniker
    Type: String

    [in] Path to the file that will be displayed in the right side of the comparison.

  • caption
    Type: String

    [in] Caption to display in the document tab. If this parameter is null or empty, {0} vs. {1} is shown.

  • Tooltip
    Type: String

    [in] Tooltip to display for the document tab. If this parameter is null or empty, the default tooltip is used.

  • leftLabel
    Type: String

    [in] Label to display above the left view. If this parameter is null or empty, then no label is shown.

  • rightLabel
    Type: String

    [in] Label to display above the right view. If this parameter is null or empty, then no label is shown.

  • inlineLabel
    Type: String

    [in] Label to display above the inline view. If this parameter is null or empty, then no label is shown.

  • roles
    Type: String

    [in] Additional text view roles added to the difference views.

  • grfDiffOptions
    Type: UInt32

    [in] Mask of options for the comparison window.

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame
Window frame for the comparison view.

Remarks

The left and right files will, if possible, be retrieved from the running documents table. If either file is already in the running documents table but cannot be opened in the text editor (because, for example, they are project files in the current solution), the file(s) are copied to a temporary directory and opened instead of the specified file(s).

The caption, tooltip, and label parameters use C#-style string formatting where {0} corresponds to the name of the left file and {1} corresponds to the name of the right file. For example, if you set inlineLabel to "{0} => {1}" and compare fileA.txt with fileB.txt, then the displayed label will be "fileA.txt => fileB.txt".

.NET Framework Security

See Also

Reference

IVsDifferenceService Interface

Microsoft.VisualStudio.Shell.Interop Namespace