本文整理汇总了C#中Difference.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Difference.Clone方法的具体用法?C# Difference.Clone怎么用?C# Difference.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Difference
的用法示例。
在下文中一共展示了Difference.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Clone
public void Clone()
{
Difference diff = new Difference(
new ScrReference(1, 1, 1, Paratext.ScrVers.English),
new ScrReference(1, 1, 30, Paratext.ScrVers.English),
4711, 1, 99, 4712, 11, 88,
DifferenceType.PictureDifference,
null, null, "Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
//diff.HvosSectionsCurr = new int[] {6, 7, 8};
Difference clonedDiff = diff.Clone();
Assert.AreEqual(1001001, clonedDiff.RefStart);
Assert.AreEqual(1001030, clonedDiff.RefEnd);
Assert.AreEqual(4711, clonedDiff.HvoCurr);
Assert.AreEqual(1, clonedDiff.IchMinCurr);
Assert.AreEqual(99, clonedDiff.IchLimCurr);
Assert.AreEqual(4712, clonedDiff.HvoRev);
Assert.AreEqual(11, clonedDiff.IchMinRev);
Assert.AreEqual(88, clonedDiff.IchLimRev);
//Assert.AreEqual(987654321, clonedDiff.hvoAddedSection);
Assert.AreEqual(DifferenceType.PictureDifference, clonedDiff.DiffType);
Assert.IsNull(clonedDiff.SubDiffsForParas);
Assert.IsNull(clonedDiff.SubDiffsForORCs);
Assert.AreEqual("Whatever", clonedDiff.StyleNameCurr);
Assert.AreEqual("Whateverelse", clonedDiff.StyleNameRev);
Assert.AreEqual("Esperanto", clonedDiff.WsNameCurr);
Assert.AreEqual("Latvian", clonedDiff.WsNameRev);
}
示例2: Clone
public void Clone()
{
IScrTxtPara[] paras = DiffTestHelper.CreateDummyParas(2, Cache);
Difference diff = new Difference(
new ScrReference(1, 1, 1, ScrVers.English),
new ScrReference(1, 1, 30, ScrVers.English),
paras[0], 1, 99, paras[1], 11, 88,
DifferenceType.PictureDifference,
null, null, "Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
//diff.SectionsCurr = new int[] {6, 7, 8};
Difference clonedDiff = diff.Clone();
Assert.AreEqual(1001001, clonedDiff.RefStart);
Assert.AreEqual(1001030, clonedDiff.RefEnd);
Assert.AreSame(paras[0], clonedDiff.ParaCurr);
Assert.AreEqual(1, clonedDiff.IchMinCurr);
Assert.AreEqual(99, clonedDiff.IchLimCurr);
Assert.AreSame(paras[1], clonedDiff.ParaRev);
Assert.AreEqual(11, clonedDiff.IchMinRev);
Assert.AreEqual(88, clonedDiff.IchLimRev);
//Assert.AreEqual(987654321, clonedDiff.hvoAddedSection);
Assert.AreEqual(DifferenceType.PictureDifference, clonedDiff.DiffType);
Assert.IsNull(clonedDiff.SubDiffsForParas);
Assert.IsNull(clonedDiff.SubDiffsForORCs);
Assert.AreEqual("Whatever", clonedDiff.StyleNameCurr);
Assert.AreEqual("Whateverelse", clonedDiff.StyleNameRev);
Assert.AreEqual("Esperanto", clonedDiff.WsNameCurr);
Assert.AreEqual("Latvian", clonedDiff.WsNameRev);
}
示例3: Clone_WithSubDiffs
public void Clone_WithSubDiffs()
{
Difference subSubDiff = new Difference(
new ScrReference(1, 1, 3, Paratext.ScrVers.English), new ScrReference(1, 1, 30, Paratext.ScrVers.English),
4715, 0, 99, 4716, 11, 88,
DifferenceType.PictureDifference, null, null,
"Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference subDiff1 = new Difference(
new ScrReference(1, 1, 2, Paratext.ScrVers.English), new ScrReference(1, 1, 30, Paratext.ScrVers.English),
4713, 0, 99, 4714, 11, 88,
DifferenceType.PictureDifference, new List<Difference>(new Difference[] { subSubDiff }),
new List<Difference>(new Difference[] { subSubDiff }), "Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference subDiff2 = new Difference(
new ScrReference(1, 1, 4, Paratext.ScrVers.English), new ScrReference(1, 1, 30, Paratext.ScrVers.English),
4717, 0, 99, 4718, 11, 88,
DifferenceType.PictureDifference, null, null,
"Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference diff = new Difference(
new ScrReference(1, 1, 1, Paratext.ScrVers.English), new ScrReference(1, 1, 30, Paratext.ScrVers.English),
4711, 0, 99, 4712, 11, 88,
DifferenceType.PictureDifference, new List<Difference>(new Difference[] { subDiff1, subDiff2 }),
new List<Difference>(new Difference[] { subDiff1, subDiff2 }), "Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference clonedDiff = diff.Clone();
Assert.AreEqual(2, clonedDiff.SubDiffsForORCs.Count);
Assert.AreEqual(1, clonedDiff.SubDiffsForORCs[0].SubDiffsForORCs.Count);
Assert.IsNull(clonedDiff.SubDiffsForORCs[1].SubDiffsForORCs);
Assert.IsNull(clonedDiff.SubDiffsForORCs[0].SubDiffsForORCs[0].SubDiffsForORCs);
Assert.AreEqual(2, clonedDiff.SubDiffsForParas.Count);
Assert.AreEqual(1, clonedDiff.SubDiffsForParas[0].SubDiffsForParas.Count);
Assert.IsNull(clonedDiff.SubDiffsForParas[1].SubDiffsForParas);
Assert.IsNull(clonedDiff.SubDiffsForParas[0].SubDiffsForParas[0].SubDiffsForParas);
}
示例4: Clone_WithSubDiffs
public void Clone_WithSubDiffs()
{
IScrTxtPara[] paras = DiffTestHelper.CreateDummyParas(8, Cache);
Difference subSubDiff = new Difference(
new ScrReference(1, 1, 3, ScrVers.English), new ScrReference(1, 1, 30, ScrVers.English),
paras[0], 0, 99, paras[1], 11, 88,
DifferenceType.PictureDifference, null, null,
"Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference subDiff1 = new Difference(
new ScrReference(1, 1, 2, ScrVers.English), new ScrReference(1, 1, 30, ScrVers.English),
paras[2], 0, 99, paras[3], 11, 88,
DifferenceType.PictureDifference, new List<Difference>(new Difference[] { subSubDiff }),
new List<Difference>(new Difference[] { subSubDiff }), "Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference subDiff2 = new Difference(
new ScrReference(1, 1, 4, ScrVers.English), new ScrReference(1, 1, 30, ScrVers.English),
paras[4], 0, 99, paras[5], 11, 88,
DifferenceType.PictureDifference, null, null,
"Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference diff = new Difference(
new ScrReference(1, 1, 1, ScrVers.English), new ScrReference(1, 1, 30, ScrVers.English),
paras[6], 0, 99, paras[7], 11, 88,
DifferenceType.PictureDifference, new List<Difference>(new Difference[] { subDiff1, subDiff2 }),
new List<Difference>(new Difference[] { subDiff1, subDiff2 }), "Whatever", "Whateverelse", "Esperanto", "Latvian",
null, null);
Difference clonedDiff = diff.Clone();
Assert.AreEqual(2, clonedDiff.SubDiffsForORCs.Count);
Assert.AreEqual(1, clonedDiff.SubDiffsForORCs[0].SubDiffsForORCs.Count);
Assert.IsNull(clonedDiff.SubDiffsForORCs[1].SubDiffsForORCs);
Assert.IsNull(clonedDiff.SubDiffsForORCs[0].SubDiffsForORCs[0].SubDiffsForORCs);
Assert.AreEqual(2, clonedDiff.SubDiffsForParas.Count);
Assert.AreEqual(1, clonedDiff.SubDiffsForParas[0].SubDiffsForParas.Count);
Assert.IsNull(clonedDiff.SubDiffsForParas[1].SubDiffsForParas);
Assert.IsNull(clonedDiff.SubDiffsForParas[0].SubDiffsForParas[0].SubDiffsForParas);
}