/// Gets or sets a value indicating whether to use character comparison on lines.
/// </summary>
/// <value><c>true</c> if to use character comparison on lines; otherwise, <c>false</c>.</value>
[Browsable(true)]
[Category("Behaviour")]
[Description("Gets or sets a value indicating whether to use character comparison on lines.")]
publicboolCharacterComparison
{
get=>characterComparison;
set
{
if(value!=characterComparison)
{
characterComparison=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets a value indicating whether the character comparison should mark added and removed characters.
/// </summary>
/// <value><c>true</c> if the character comparison should mark added and removed characters; otherwise, <c>false</c>.</value>
[Browsable(true)]
[Category("Behaviour")]
[Description("Gets or sets a value indicating whether the character comparison should mark added and removed characters.")]
publicboolCharacterComparisonMarkAddRemove
{
get=>characterComparisonMarkAddRemove;
set
{
if(value!=characterComparisonMarkAddRemove)
{
characterComparisonMarkAddRemove=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the symbol for a removed character.
/// </summary>
/// <value>The removed character symbol.</value>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the symbol for a removed character.")]
publiccharRemovedCharacterSymbol{get;set;}='-';
/// <summary>
/// Gets or sets the symbol for an added character.
/// </summary>
/// <value>The added character symbol.</value>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the symbol for an added character.")]
publiccharAddedCharacterSymbol{get;set;}='+';
/// <summary>
/// Gets or sets the index for the style for a mark color used by the <see cref="Scintilla"/> control to indicate a addition or a deletion difference.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">The value must be between 0 and 31.</exception>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the index for the style index for a mark color used by the Scintilla control to indicate a addition or a deletion difference.")]
publicintMarkColorIndexModifiedBackground
{
get=>markColorIndexModifiedBackground;
set
{
if(value!=markColorIndexModifiedBackground)
{
if(value<0||value>31)
{
// ReSharper disable once LocalizableElement
thrownewArgumentOutOfRangeException(nameof(value),"The value must be between 0 and 31.");
}
markColorIndexModifiedBackground=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the index for the style for a background color color used by the <see cref="Scintilla"/> control to indicate a change in file line.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">The value must be between 0 and 31.</exception>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the index for the style for a background color color used by the Scintilla control to indicate a change in file line.")]
publicintMarkColorIndexRemovedOrAdded
{
get=>markColorIndexRemovedOrAdded;
set
{
if(value!=markColorIndexRemovedOrAdded)
{
if(value<0||value>31)
{
// ReSharper disable once LocalizableElement
thrownewArgumentOutOfRangeException(nameof(value),"The value must be between 0 and 31.");
}
markColorIndexRemovedOrAdded=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets a value indicating whether to mark unchanged lines with an ok sign.
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets a value indicating whether to mark unchanged lines with an ok sign.")]
publicboolUseRowOkSign
{
get=>useRowOkSign;
set
{
if(useRowOkSign!=value)
{
useRowOkSign=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets a diff style of the control.
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets a diff style of the control.")]
publicDiffStyleDiffStyle
{
get=>diffStyle;
set
{
if(diffStyle!=value)
{
diffStyle=value;
// don't synchronize the scroll bars with list view..
if(diffStyle==DiffStyle.DiffList)
{
scintillaOne.ScrollSync=null;
scintillaTwo.ScrollSync=null;
}
else
{
// synchronize the scroll bars with side-by-side view..
scintillaOne.ScrollSync=scintillaTwo;
scintillaTwo.ScrollSync=scintillaOne;
}
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the indicator for the diff that a row was added.
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the indicator for the diff that a row was added.")]
publicBitmapImageRowAdded
{
get=>imageRowAdded;
set
{
if(value!=imageRowAdded&&value!=null)
{
imageRowAdded=value;
SetSymbols();
}
}
}
/// <summary>
/// Gets or sets the index for the <see cref="ImageRowAdded"/> used by the <see cref="Scintilla"/> control.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">The value must be between 0 and 31.</exception>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the index for the ImageRowAdded used by the Scintilla control.")]
publicintImageRowAddedScintillaIndex
{
get=>imageRowAddedScintillaIndex;
set
{
if(value!=imageRowAddedScintillaIndex)
{
if(value<0||value>31)
{
// ReSharper disable once LocalizableElement
thrownewArgumentOutOfRangeException(nameof(value),"The value must be between 0 and 31.");
}
imageRowAddedScintillaIndex=value;
SetSymbolMasks();
}
}
}
/// <summary>
/// Gets or sets the indicator for the diff that a row was deleted.
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the indicator for the diff that a row was deleted.")]
publicBitmapImageRowDeleted
{
get=>imageRowDeleted;
set
{
if(value!=imageRowDeleted&&value!=null)
{
imageRowDeleted=value;
SetSymbols();
}
}
}
/// <summary>
/// Gets or sets the index for the <see cref="ImageRowDeleted"/> used by the <see cref="Scintilla"/> control.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">The value must be between 0 and 31.</exception>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the index for the ImageRowDeleted used by the Scintilla control.")]
publicintImageRowDeletedScintillaIndex
{
get=>imageRowDeletedScintillaIndex;
set
{
if(value!=imageRowDeletedScintillaIndex)
{
if(value<0||value>31)
{
// ReSharper disable once LocalizableElement
thrownewArgumentOutOfRangeException(nameof(value),"The value must be between 0 and 31.");
}
imageRowDeletedScintillaIndex=value;
SetSymbolMasks();
}
}
}
/// <summary>
/// Gets or sets the indicator for the diff that a row hasn't changed.
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the indicator for the diff that a row hasn't changed.")]
publicBitmapImageRowOk
{
get=>imageRowOk;
set
{
if(value!=imageRowOk&&value!=null)
{
imageRowOk=value;
SetSymbols();
}
}
}
/// <summary>
/// Gets or sets the index for the <see cref="ImageRowOk"/> used by the <see cref="Scintilla"/> control.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">The value must be between 0 and 31.</exception>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the index for the ImageRowOk used by the Scintilla control.")]
publicintImageRowOkScintillaIndex
{
get=>imageRowOkScintillaIndex;
set
{
if(value!=imageRowOkScintillaIndex)
{
if(value<0||value>31)
{
// ReSharper disable once LocalizableElement
thrownewArgumentOutOfRangeException(nameof(value),"The value must be between 0 and 31.");
}
imageRowOkScintillaIndex=value;
SetSymbolMasks();
}
}
}
/// <summary>
/// Gets or sets the indicator for the diff that two rows have some differences.
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the indicator for the diff that two rows have some differences.")]
publicBitmapImageRowDiff
{
get=>imageRowDiff;
set
{
if(value!=imageRowDiff&&value!=null)
{
imageRowDiff=value;
SetSymbols();
}
}
}
/// <summary>
/// Gets or sets the index for the <see cref="ImageRowDiff"/> used by the <see cref="Scintilla"/> control.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">The value must be between 0 and 31.</exception>
[Browsable(true)]
[Category("Appearance")]
[Description("Gets or sets the index for the ImageRowDiff used by the Scintilla control.")]
publicintImageRowDiffScintillaIndex
{
get=>imageRowDiffScintillaIndex;
set
{
if(value!=imageRowDiffScintillaIndex)
{
if(value<0||value>31)
{
// ReSharper disable once LocalizableElement
thrownewArgumentOutOfRangeException(nameof(value),"The value must be between 0 and 31.");
}
imageRowDiffScintillaIndex=value;
SetSymbolMasks();
}
}
}
/// <summary>
/// Gets or sets the text on the left <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the text on the left Scintilla control.")]
publicstringTextLeft
{
get=>textLeft;
set
{
textLeft=value;
DiffTexts();
}
}
/// <summary>
/// 获取或修改左边区域的标题
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("获取或修改左边区域的标题")]
publicstringTitleLeft
{
get=>label1.Text;
set
{
label1.Text=value;
}
}
/// <summary>
/// 获取或修改右边区域的标题
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("获取或修改右边区域的标题")]
publicstringTitleRight
{
get=>label2.Text;
set
{
label2.Text=value;
}
}
/// <summary>
/// 获取或修改标题是否可见
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("获取或修改标题是否可见")]
publicboolTitleVisible
{
get=>panel1.Visible;
set
{
panel1.Visible=panel2.Visible=value;
}
}
/// <summary>
/// Gets or sets the text on the right <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the text on the right Scintilla control.")]
publicstringTextRight
{
get=>textRight;
set
{
textRight=value;
DiffTexts();
}
}
/// <summary>
/// Gets or sets the text deleted color for the <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the text deleted color for the Scintilla control.")]
publicColorDiffColorDeleted
{
get=>diffColorDeleted;
set
{
if(value!=diffColorDeleted)
{
diffColorDeleted=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the text inserted color for the <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the text inserted color for the Scintilla control.")]
publicColorDiffColorAdded
{
get=>diffColorAdded;
set
{
if(value!=diffColorAdded)
{
diffColorAdded=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the text deleted color for the <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the character deleted color for the Scintilla control.")]
publicColorDiffColorCharDeleted
{
get=>diffColorCharDeleted;
set
{
if(value!=diffColorCharDeleted)
{
diffColorCharDeleted=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the text inserted color for the <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the character inserted color for the Scintilla control.")]
publicColorDiffColorCharAdded
{
get=>diffColorCharAdded;
set
{
if(value!=diffColorCharAdded)
{
diffColorCharAdded=value;
DiffTexts();
}
}
}
/// <summary>
/// Gets or sets the background color for a changed text row for the <see cref="Scintilla"/> control.
/// </summary>
[Browsable(true)]
[Category("Diff")]
[Description("Gets or sets the background color for a changed text row for the Scintilla control.")]
publicColorDiffColorChangeBackground
{
get=>diffColorChangeBackground;
set
{
if(value!=diffColorChangeBackground)
{
diffColorChangeBackground=value;
DiffTexts();
}
}
}
#endregion
#regionPrivateProperties
#endregion
#regionPrivateMethods
/// <summary>
/// Re-calculates the split container's (<see cref="SplitContainer"/>) splitter position.
/// Sets a row added marker based on the given <paramref name="index"/> row amount to either the left side or the right side <see cref="Scintilla"/> document.
/// </summary>
/// <param name="index">The index of the row to set the marker to.</param>
/// <param name="left">A value indicating whether to append the marker to the left or to the right side <see cref="Scintilla"/> document.</param>
/// Sets a row deleted marker based on the given <paramref name="index"/> row amount to either the left side or the right side <see cref="Scintilla"/> document.
/// </summary>
/// <param name="index">The index of the row to set the marker to.</param>
/// <param name="left">A value indicating whether to append the marker to the left or to the right side <see cref="Scintilla"/> document.</param>
/// Sets a row ok marker based on the given <paramref name="index"/> row amount to either the left side or the right side <see cref="Scintilla"/> document.
/// </summary>
/// <param name="index">The index of the row to set the marker to.</param>
/// <param name="left">A value indicating whether to append the marker to the left or to the right side <see cref="Scintilla"/> document.</param>
/// Sets a row differ marker based on the given <paramref name="index"/> row amount to either the left side or the right side <see cref="Scintilla"/> document.
/// </summary>
/// <param name="index">The index of the row to set the marker to.</param>
/// <param name="left">A value indicating whether to append the marker to the left or to the right side <see cref="Scintilla"/> document.</param>