Share via


IVsDifferenceService.OpenComparisonWindow2 Method

Definition

Opens and displays a file comparison window in Visual Studio.

public:
 Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ OpenComparisonWindow2(System::String ^ leftFileMoniker, System::String ^ rightFileMoniker, System::String ^ caption, System::String ^ Tooltip, System::String ^ leftLabel, System::String ^ rightLabel, System::String ^ inlineLabel, System::String ^ roles, System::UInt32 grfDiffOptions);
public:
 Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ OpenComparisonWindow2(Platform::String ^ leftFileMoniker, Platform::String ^ rightFileMoniker, Platform::String ^ caption, Platform::String ^ Tooltip, Platform::String ^ leftLabel, Platform::String ^ rightLabel, Platform::String ^ inlineLabel, Platform::String ^ roles, unsigned int grfDiffOptions);
Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame OpenComparisonWindow2(std::wstring const & leftFileMoniker, std::wstring const & rightFileMoniker, std::wstring const & caption, std::wstring const & Tooltip, std::wstring const & leftLabel, std::wstring const & rightLabel, std::wstring const & inlineLabel, std::wstring const & roles, unsigned int grfDiffOptions);
public Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame OpenComparisonWindow2 (string leftFileMoniker, string rightFileMoniker, string caption, string Tooltip, string leftLabel, string rightLabel, string inlineLabel, string roles, uint grfDiffOptions);
abstract member OpenComparisonWindow2 : string * string * string * string * string * string * string * string * uint32 -> Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame
Public 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

Parameters

leftFileMoniker
String

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

rightFileMoniker
String

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

caption
String

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

Tooltip
String

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

leftLabel
String

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

rightLabel
String

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

inlineLabel
String

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

roles
String

[in] Additional text view roles added to the difference views. For more information about text view roles, see Language Service and Editor Extension Points.

grfDiffOptions
UInt32

[in] __VSDIFFSERVICEOPTIONS for the comparison window.

Returns

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".

Applies to