GitSharp.Core.Diff.Edit.Swap C# (CSharp) Method

Swap() public method

Swap A and B, so the edit goes the other direction.
public Swap ( ) : void
return void
        public void Swap()
        {
            int sBegin = BeginA;
            int sEnd = EndA;

            BeginA = BeginB;
            EndA = EndB;

            BeginB = sBegin;
            EndB = sEnd;
        }

Usage Example

コード例 #1
0
ファイル: EditTest.cs プロジェクト: dev218/GitSharp
		public void testSwap()
		{
			Edit e = new Edit(1, 2, 3, 4);
			e.Swap();
			Assert.AreEqual(3, e.BeginA);
			Assert.AreEqual(4, e.EndA);
			Assert.AreEqual(1, e.BeginB);
			Assert.AreEqual(2, e.EndB);
		}