TextComparison オブジェクト

On this page:

Description

このオブジェクトは、テキスト ファイル比較ウィンドウを表します。必ずしも画面にウィンドウを表示する必要はありませんが、クライアントにファイル比較サービスを実行したり、ファイル比較画面をユーザーに提示したりする場合に、このウィンドウを利用できます。

このオブジェクトが公開するメソッドとプロパティを使って、テキスト ファイルの比較、結果の抽出、テキスト ファイル比較ウィンドウの外観の変更を行います。

このオブジェクトによって表される比較が閉じると、Close イベントのハンドラーによって、メソッドやプロパティにアクセスする最後の機会が提供されます。その後はアクセスしようとすると、エラーになります。

プロパティ

Active 読み取り/書き込み、ICommonUI

比較ウィンドウのアクティブ状態。

IDL [propget] HRESULT Active([out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT Active([in] VARIANT_BOOL newValue)
.NET Boolean Active[get, set]

AllUnresolvedConflicts 読み取り専用、IFileComparison

すべての比較ファイルの中にある未解決の不一致の数を提供します。

IDL [propget] HRESULT AllUnresolvedConflicts([out, retval] long* pValue)
.NET Int32 AllUnresolvedConflicts[get]

AutoSaveOnClose 読み取り/書き込み、IFileComparison

Merge が閉じられるときに変更されたファイルが未保存の場合、通常、Merge はユーザーにこれらのファイルを保存するかどうかを尋ねます。これは PromptForUnsavedFilesfalse に設定されていない場合に限ります。設定されている場合は、未保存ファイルが破棄されます。ただし、AutoSaveOnClosetrue に設定されている場合、Merge はユーザーに尋ねることなく未保存ファイルを自動的に保存します。この機能は、Merge をほかのアプリケーションと統合する場合に便利です。

IDL [propget] HRESULT AutoSaveOnClose([out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT AutoSaveOnClose([in] VARIANT_BOOL newValue)
.NET Boolean AutoSaveOnClose[get, set]

ChangeLength 読み取り専用、ITextComparison

変更の行数。

IDL [propget] HRESULT ChangeLength(
    [in] long nChange,
    [in] long nSide,
    [in, optional] VARIANT nFilePair,
    [out, retval] long* pValue)
.NET Int32 get_ChangeLength(
    Int32 nChange,
    Int32 nSide,
    Object nFilePair)

ChangeStartLine 読み取り専用、ITextComparison

変更の開始行(0 ベース)。

IDL [propget] HRESULT ChangeStartLine(
    [in] long nChange,
    [in] long nSide,
    [in, optional] VARIANT nFilePair,
    [out, retval] long* pValue)
.NET Int32 get_ChangeStartLine(
    Int32 nChange,
    Int32 nSide,
    Object nFilePair)

ChangeType 読み取り専用、ITextComparison

変更のタイプ。変更は、挿入行、削除行、変更行、未変更行を表します。

IDL [propget] HRESULT ChangeType(
    [in] long nChange,
    [in, optional] VARIANT nFilePair,
    [out, retval] ChangeStyle* pValue)
.NET ChangeStyle get_ChangeType(
    Int32 nChange,
    Object nFilePair)

ComparisonError 読み取り専用、IFileComparison

Compare メソッドで発生したエラー(ある場合)。

IDL [propget] HRESULT ComparisonError(
    [in, optional] VARIANT nFilePair,
    [out, retval] FileComparisonError* pValue)
.NET FileComparisonError get_ComparisonError(
    Object nFilePair)

ComparisonResult 読み取り専用、IFileComparison

Compare メソッドで実行された比較の結果(fcrSamefcrDifferentfcrError)。

IDL [propget] HRESULT ComparisonResult(
    [in, optional] VARIANT nFilePair,
    [out, retval] FileComparisonResult* pValue)
.NET FileComparisonResult get_ComparisonResult(
    Object nFilePair)

ErrorInfo 読み取り/書き込み、IFileComparison

ファイルの 1 つを読み込み/比較している間に発生したエラーに関する詳細情報を提供します。nFile-1 の場合、3 つのファイルすべてに適用されるエラー(メモリ不足エラーなど)が返されます。

IDL [propget] HRESULT ErrorInfo(
    [in] short nFile,
    [out, retval] BSTR* pValue)
[propput] HRESULT ErrorInfo(
    [in] short nFile,
    [in] BSTR newValue)
.NET String get_ErrorInfo(
    Int16 nFile)
void set_ErrorInfo(
    Int16 nFile, String newValue)

FileContent 読み取り/書き込み、ITextComparison

ファイル ペインの内容の設定、取得、あるいは検索を可能にします。

IDL [propget] HRESULT FileContent(
    [in] short nFile,
    [out, retval] BSTR* pValue)
[propput] HRESULT FileContent(
    [in] short nFile,
    [in] BSTR newValue)
.NET String get_FileContent(
    Int16 nFile)
void set_FileContent(
    Int16 nFile, String newValue)

FullLineData 読み取り専用、ITextComparison

ファイルの 1 つにある行の内容。内容には CRLF の行終端文字が含まれます。

IDL [propget] HRESULT FullLineData(
    [in] long nLine,
    [in] short nFile,
    [out, retval] BSTR* pValue)
.NET String get_FullLineData(
    Int32 nLine,
    Int16 nFile)

FullLineLength 読み取り専用、ITextComparison

ファイルの 1 つにある行の長さ。長さには CRLF の行終端文字が含まれます。

IDL [propget] HRESULT FullLineLength(
    [in] long nLine,
    [in] short nFile,
    [out, retval] long* pValue)
.NET Int32 get_FullLineLength(
    Int32 nLine,
    Int16 nFile)

Height 読み取り/書き込み、ICommonUI

比較ウィンドウの高さ(ピクセル)。

IDL [propget] HRESULT Height([out, retval] long* pValue)
[propput] HRESULT Height([in] long newValue)
.NET Int32 Height[get, set]

Left 読み取り/書き込み、ICommonUI

比較ウィンドウの左端のピクセル座標の位置。

IDL [propget] HRESULT Left([out, retval] long* pValue)
[propput] HRESULT Left([in] long newValue)
.NET Int32 Left[get, set]

LineData 読み取り専用、ITextComparison

ファイルの 1 つにある行の内容。内容には CRLF の行終端文字は含まれません。

IDL [propget] HRESULT LineData(
    [in] long nLine,
    [in] short nFile,
    [out, retval] BSTR* pValue)
.NET String get_LineData(
    Int32 nLine,
    Int16 nFile)

LineLength 読み取り専用、ITextComparison

ファイルの 1 つにある行の長さ。長さには CRLF の行終端文字は含まれません。

IDL [propget] HRESULT LineLength(
    [in] long nLine,
    [in] short nFile,
    [out, retval] long* pValue)
.NET Int32 get_LineLength(
    Int32 nLine,
    Int16 nFile)

Maximized 読み取り/書き込み、ICommonUI

比較ウィンドウの最大化状態。

IDL [propget] HRESULT Maximized([out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT Maximized([in] VARIANT_BOOL newValue)
.NET Boolean Maximized[get, set]

Minimized 読み取り/書き込み、ICommonUI

比較ウィンドウの最小化状態。

IDL [propget] HRESULT Minimized([out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT Minimized([in] VARIANT_BOOL newValue)
.NET Boolean Minimized[get, set]

Modified 読み取り/書き込み、IFileComparison

ファイルの修正状態の設定または取得を可能にします。

IDL [propget] HRESULT Modified(
    [in] short nFile,
    [out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT Modified(
    [in] short nFile,
    [in] VARIANT_BOOL newValue)
.NET Boolean get_Modified(
    Int16 nFile)
void set_Modified(
    Int16 nFile, Boolean newValue)

NumberOfChanges 読み取り専用、IFileComparison

2 つのファイル間の変更数。このプロパティと ChangeTypeChangeStartLine、および ChangeLength プロパティを使用して、比較ファイル間の変更を繰り返し処理します。変更のセットには、削除/挿入/変更ブロック行のほかに未変更のブロック行も含まれることに留意してください。

IDL [propget] HRESULT NumberOfChanges(
    [in, optional] VARIANT nFilePair,
    [out, retval] long* pValue)
.NET Int32 get_NumberOfChanges(
    Object nFilePair)

NumberOfLines 読み取り専用、ITextComparison

比較ファイルのうちの 1 つの行数。

IDL [propget] HRESULT NumberOfLines(
    [in] short nFile,
    [out, retval] short* pValue)
.NET Int16 get_NumberOfLines(
    Int16 nFile)

PromptForUnsavedFiles 読み取り/書き込み、IFileComparison

修正されたファイルを含んでいるファイル比較ウィンドウが閉じられる場合、通常、Merge はそれらのファイルを保存する機会を提供します。このプロパティを false に設定すると、[’修正ファイルの保存]ウィンドウは表示されなくなります。AutoSaveOnClose プロパティも参照してください。

IDL [propget] HRESULT PromptForUnsavedFiles([out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT PromptForUnsavedFiles([in] VARIANT_BOOL newValue)
.NET Boolean PromptForUnsavedFiles[get, set]

ReadOnly 読み取り/書き込み、IFileComparison

ファイルの読み取り専用状態の設定または取得を可能にします。

IDL [propget] HRESULT ReadOnly(
    [in] short nFile,
    [out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT ReadOnly(
    [in] short nFile,
    [in] VARIANT_BOOL newValue)
.NET Boolean get_ReadOnly(
    Int16 nFile)
void set_ReadOnly(
    Int16 nFile, Boolean newValue)

SaveFileName 読み取り/書き込み、IFileComparison

テキスト比較ウィンドウで変更を保存(CtrlS または[上書き保存]コマンドを使用)するときに使うファイル名。

IDL [propget] HRESULT SaveFileName([out, retval] BSTR* pValue)
[propput] HRESULT SaveFileName([in] BSTR newValue)
.NET String SaveFileName[get, set]

ThreeWayMergeActions 読み取り専用、IFileComparison

1 番目と 3 番目のファイルの変更を中央の親ファイルへマージするために実行する必要があるアクションのコレクションを取得します。

IDL [propget] HRESULT ThreeWayMergeActions([out, retval] IThreeWayMergeActions** pValue)
.NET ThreeWayMergeActions ThreeWayMergeActions[get]

Top 読み取り/書き込み、ICommonUI

比較ウィンドウの上端のピクセル座標の位置。

IDL [propget] HRESULT Top([out, retval] long* pValue)
[propput] HRESULT Top([in] long newValue)
.NET Int32 Top[get, set]

UnresolvedConflicts 読み取り専用、IFileComparison

比較ファイルの 1 つの中にある未解決の不一致の数を提供します。

IDL [propget] HRESULT UnresolvedConflicts(
    [in] short nFile,
    [out, retval] long* pValue)
.NET Int32 get_UnresolvedConflicts(
    Int16 nFile)

ViewType 読み取り/書き込み、IComparison

比較タイプ(2 者間または 3 者間レイアウト)。

IDL [propget] HRESULT ViewType([out, retval] FileViewType* pValue)
[propput] HRESULT ViewType([in] FileViewType newValue)
.NET FileViewType ViewType[get, set]

Visible 読み取り/書き込み、ICommonUI

比較ウィンドウの表示状態。

IDL [propget] HRESULT Visible([out, retval] VARIANT_BOOL* pValue)
[propput] HRESULT Visible([in] VARIANT_BOOL newValue)
.NET Boolean Visible[get, set]

Width 読み取り/書き込み、ICommonUI

比較ウィンドウの幅(ピクセル)。

IDL [propget] HRESULT Width([out, retval] long* pValue)
[propput] HRESULT Width([in] long newValue)
.NET Int32 Width[get, set]

メソッド

Close ICommonUI

比較ウィンドウを閉じます。

IDL HRESULT Close()
.NET void Close()

Compare IComparison

2 つまたは 3 つのファイルを比較します。このメソッドは同期メソッドです。比較が完了して、エラーと結果を報告するときに ComparisonComplete イベントが発生します。

IDL HRESULT Compare(
    [in] VARIANT strFirstFile,
    [in] VARIANT strSecondFile,
    [in, optional] VARIANT strThirdFile)
.NET void Compare(
    Object strFirstFile,
    Object strSecondFile,
    Object strThirdFile)

CompareAsync IFileComparison

2 つまたは 3 つのファイルを比較します。このメソッドは非同期メソッドです(比較が完了する前に返されます)。比較が完了して、エラーと結果を報告するときに ComparisonComplete イベントが発生します。

IDL HRESULT CompareAsync(
    [in] VARIANT strFirstFile,
    [in] VARIANT strSecondFile,
    [in, optional] VARIANT strThirdFile)
.NET void CompareAsync(
    Object strFirstFile,
    Object strSecondFile,
    Object strThirdFile)

CompareAsyncWithEncoding ITextComparison2

ファイルを読み込む際、指定されたエンコードを使用して、2 つまたは 3 つのファイルを比較します。このメソッドは非同期メソッドです(比較が完了する前に返されます)。比較が完了して、エラーと結果を報告するときに ComparisonComplete イベントが発生します。

IDL HRESULT CompareAsyncWithEncoding(
    [in] VARIANT strFirstFile,
    [in] IEncoding* firstEncoding,
    [in] VARIANT strSecondFile,
    [in] IEncoding* secondEncoding,
    [in, optional] VARIANT strThirdFile,
    [in, optional] IEncoding* thirdEncoding)
.NET void CompareAsyncWithEncoding(
    Object strFirstFile,
    Encoding firstEncoding,
    Object strSecondFile,
    Encoding secondEncoding,
    Object strThirdFile,
    Encoding thirdEncoding)

CompareWithEncoding ITextComparison2

ファイルを読み込む際、指定されたエンコードを使用して、2 つまたは 3 つのファイルを比較します。このメソッドは同期メソッドです。比較が完了して、エラーと結果を報告するときに ComparisonComplete イベントが発生します。

IDL HRESULT CompareWithEncoding(
    [in] VARIANT strFirstFile,
    [in] IEncoding* firstEncoding,
    [in] VARIANT strSecondFile,
    [in] IEncoding* secondEncoding,
    [in, optional] VARIANT strThirdFile,
    [in, optional] IEncoding* thirdEncoding)
.NET void CompareWithEncoding(
    Object strFirstFile,
    Encoding firstEncoding,
    Object strSecondFile,
    Encoding secondEncoding,
    Object strThirdFile,
    Encoding thirdEncoding)

GiveUserControl ICommonUI

比較ウィンドウの起動から終了までをユーザーが制御できるようにします。未処理のオートメーション参照が解放されても、Merge は自動的に比較ウィンドウを閉じません。

IDL HRESULT GiveUserControl()
.NET void GiveUserControl()

Print IComparison

ファイル比較を印刷します。

IDL HRESULT Print(
    [in] VARIANT_BOOL bShowPrinterDialog,
    [in] PageOrientation nOrientation)
.NET void Print(
    Boolean bShowPrinterDialog,
    PageOrientation nOrientation)

Refresh IComparison

ウィンドウに表示されているファイルを再度比較します。これにより、未保存の変更は破棄されます。

IDL HRESULT Refresh()
.NET void Refresh()

Report IComparison

ファイル比較のレポートを生成します。

IDL HRESULT Report(
    [in] BSTR bstrReporter,
    [in] LineEndingStyle nLineEndingStyle,
    [in] BSTR strOutputFile)
.NET void Report(
    String bstrReporter,
    LineEndingStyle nLineEndingStyle,
    String strOutputFile)

Report2 IComparison

ファイル比較のレポートを生成します。

IDL HRESULT Report2(
    [in] BSTR bstrReporter,
    [in] LineEndingStyle nLineEndingStyle,
    [in] VARIANT vtEncoding,
    [in] BSTR strOutputFile)
.NET void Report2(
    String bstrReporter,
    LineEndingStyle nLineEndingStyle,
    Object vtEncoding,
    String strOutputFile)

Restore ICommonUI

比較ウィンドウを、最小化または最大化された状態から通常のサイズ変更可能な状態に戻します。

IDL HRESULT Restore()
.NET void Restore()

SaveComparison IComparison

比較をファイルに保存します。ファイル名には .cmp7 拡張子を使用することをお勧めします。

IDL HRESULT SaveComparison(
    [in] BSTR filename)
.NET void SaveComparison(
    String filename)

SaveFile IFileComparison

nFile パネルのファイルを保存します。strSaveTo 引数を使用すると、Merge は指定ファイルに対して名前を付けて保存を実行します。

IDL HRESULT SaveFile(
    [in] short nFile,
    [in, optional] VARIANT strSaveTo)
.NET void SaveFile(
    Int16 nFile,
    Object strSaveTo)

SaveFileAs IFileComparison

nFile パネルのファイルに新しい名前を付けて保存するようユーザーに指示するメッセージを表示します。

IDL HRESULT SaveFileAs(
    [in] short nFile)
.NET void SaveFileAs(
    Int16 nFile)

SetPanelTitles IComparison

ファイル ペインの上に表示するタイトルを設定します。

IDL HRESULT SetPanelTitles(
    [in] VARIANT strFirst,
    [in] VARIANT strSecond,
    [in, optional] VARIANT strThird)
.NET void SetPanelTitles(
    Object strFirst,
    Object strSecond,
    Object strThird)

ThreeWayMerge IFileComparison

3 者間比較で 2 つの(左右)外側のファイルを中央にある共通の親ファイルにマージします。マージが返される間に発生したマージの不一致の数。

IDL HRESULT ThreeWayMerge([out, retval] long* pValue)
.NET Int32 ThreeWayMerge()

イベント

Close IFileComparisonEvents

ファイル比較ウィンドウはユーザーによって閉じられました。

IDL HRESULT Close()
.NET void Close()

ComparisonComplete IFileComparisonEvents

ファイル比較が完了したときに発生します。2 ファイル間での比較では、最初の 2 つの引数のみが定義されます。3 ファイル間での比較では、4 つすべての引数が定義されます。

IDL HRESULT ComparisonComplete(
    [in] FileComparisonError error1,
    [in] FileComparisonResult result1,
    [in, optional] FileComparisonError error2,
    [in, optional] FileComparisonResult result2)
.NET void ComparisonComplete(
    FileComparisonError error1,
    FileComparisonResult result1,
    FileComparisonError error2,
    FileComparisonResult result2)