public void AddAllContentText(ScreenContent ScreenContent) { // loop for each item within the content array. foreach (var contentItem in ScreenContent.ContentItems()) { if (contentItem is ContentText) { ContentItemBase item = null; var rc = this.TryGetValue(contentItem.RowCol, out item); if (rc == false) { this.Add(contentItem.RowCol, contentItem); } } } }
public static ContentItemBase GetContentItem(this ScreenContent Content, IScreenLoc loc) { ContentItemBase foundItem = null; foreach (var contentItem in Content.ContentItems()) { var itemLoc = contentItem.RowCol as IScreenLoc; var range = new ScreenLocRange( itemLoc, contentItem.GetItemLength(Content), Content.ScreenDim); if (range.Contains(loc)) { foundItem = contentItem; break; } } return(foundItem); }