IVsDifferenceService::OpenComparisonWindow2 Method (String^, String^, String^, String^, String^, String^, String^, String^, UInt32)

 

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)

IVsWindowFrame^ OpenComparisonWindow2(
	String^ leftFileMoniker,
	String^ rightFileMoniker,
	String^ caption,
	String^ Tooltip,
	String^ leftLabel,
	String^ rightLabel,
	String^ inlineLabel,
	String^ roles,
	unsigned int grfDiffOptions
)

Parameters

leftFileMoniker
Type: System::String^

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

rightFileMoniker
Type: System::String^

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

caption
Type: System::String^

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

Tooltip
Type: System::String^

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

leftLabel
Type: System::String^

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

rightLabel
Type: System::String^

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

inlineLabel
Type: System::String^

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

roles
Type: System::String^

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

grfDiffOptions
Type: System::UInt32

[in] __VSDIFFSERVICEOPTIONS for the comparison window.

Return Value

Type: Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^

Window frame for the comparison view.

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

Return to top
Show: