public void eliminateDuplicates() { for (int i = 0; i < Content.Count; i++) { if (Content[i] is LMD_Plaintext && i + 1 < Content.Count && Content[i + 1] is LMD_Plaintext) { LMD_Plaintext c1 = Content[i] as LMD_Plaintext; LMD_Plaintext c2 = Content[i + 1] as LMD_Plaintext; String mergedText = c1.Text + c2.Text; LMD_Plaintext newPtext = new LMD_Plaintext(mergedText); Content.RemoveAt(i); Content.RemoveAt(i); Content.Insert(i, newPtext); } } }
public bool isEqualTo(LMD_Object cmpObj) { LMD_Plaintext cmpPt = cmpObj as LMD_Plaintext; return(cmpPt != null && Text == cmpPt.Text); }